1. 14 3月, 2011 5 次提交
    • A
      tipc: manually inline net_start/stop, make assoc. vars static · 34e46258
      Allan Stephens 提交于
      Relocates network-related variables into the subsystem files where
      they are now primarily used (following the recent rework of TIPC's
      node table), and converts globals into locals where possible. Changes
      the initialization of tipc_num_links from run-time to compile-time,
      and eliminates the net_start routine that becomes empty as a result.
      Also eliminates the corresponding net_stop routine by moving its
      (trivial) content into the one location that called the routine.
      Signed-off-by: NAllan Stephens <allan.stephens@windriver.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      34e46258
    • A
      tipc: Convert node object array to a hash table · 672d99e1
      Allan Stephens 提交于
      Replaces the dynamically allocated array of pointers to the cluster's
      node objects with a static hash table. Hash collisions are resolved
      using chaining, with a typical hash chain having only a single node,
      to avoid degrading performance during processing of incoming packets.
      The conversion to a hash table reduces the memory requirements for
      TIPC's node table to approximately the same size it had prior to
      the previous commit.
      
      In addition to the hash table itself, TIPC now also maintains a
      linked list for the node objects, sorted by ascending network address.
      This list allows TIPC to continue sending responses to user space
      applications that request node and link information in sorted order.
      The list also improves performance when name table update messages are
      sent by making it easier to identify the nodes that must be notified.
      Signed-off-by: NAllan Stephens <allan.stephens@windriver.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      672d99e1
    • A
      tipc: Eliminate configuration for maximum number of cluster nodes · f831c963
      Allan Stephens 提交于
      Gets rid of the need for users to specify the maximum number of
      cluster nodes supported by TIPC. TIPC now automatically provides
      support for all 4K nodes allowed by its addressing scheme.
      
      Note: This change sets TIPC's memory usage to the amount used by
      a maximum size node table with 4K entries.  An upcoming patch that
      converts the node table from a linear array to a hash table will
      compact the node table to a more efficient design, but for clarity
      it is nice to have all the Kconfig infrastruture go away separately.
      Signed-off-by: NAllan Stephens <Allan.Stephens@windriver.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      f831c963
    • A
      tipc: Split up unified structure of network-related variables · d1bcb115
      Allan Stephens 提交于
      Converts the fields of the global "tipc_net" structure into individual
      variables.  Since the struct was never referenced as a complete unit,
      its existence was pointless.  This will facilitate upcoming changes to
      TIPC's node table and simpify upcoming relocation of the variables so
      they are only visible to the files that actually use them.
      
      This change is essentially cosmetic in nature, and doesn't affect the
      operation of TIPC.
      Signed-off-by: NAllan Stephens <allan.stephens@windriver.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      d1bcb115
    • A
      tipc: Fix problem with missing link in "tipc-config -l" output · 9df3b7eb
      Allan Stephens 提交于
      Removes a race condition that could cause TIPC's internal counter
      of the number of links it has to neighboring nodes to have the
      incorrect value if two independent threads of control simultaneously
      create new link endpoints connecting to two different nodes using two
      different bearers. Such under counting would result in TIPC failing to
      list the final link(s) in its response to a configuration request to
      list all of the node's links. The counter is now updated atomically
      to ensure that simultaneous increments do not interfere with each
      other.
      
      Thanks go to Peter Butler <pbutler@pt.com> for his assistance in
      diagnosing and fixing this problem.
      Signed-off-by: NAllan Stephens <Allan.Stephens@windriver.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      9df3b7eb
  2. 02 1月, 2011 5 次提交
  3. 03 12月, 2010 1 次提交
  4. 14 10月, 2010 1 次提交
  5. 10 9月, 2010 1 次提交
  6. 13 5月, 2010 1 次提交
  7. 31 3月, 2010 1 次提交
  8. 25 3月, 2010 1 次提交
  9. 04 3月, 2010 1 次提交
    • N
      tipc: Fix oops on send prior to entering networked mode (v3) · d0021b25
      Neil Horman 提交于
      Fix TIPC to disallow sending to remote addresses prior to entering NET_MODE
      
      user programs can oops the kernel by sending datagrams via AF_TIPC prior to
      entering networked mode.  The following backtrace has been observed:
      
      ID: 13459  TASK: ffff810014640040  CPU: 0   COMMAND: "tipc-client"
      [exception RIP: tipc_node_select_next_hop+90]
      RIP: ffffffff8869d3c3  RSP: ffff81002d9a5ab8  RFLAGS: 00010202
      RAX: 0000000000000001  RBX: 0000000000000001  RCX: 0000000000000001
      RDX: 0000000000000000  RSI: 0000000000000001  RDI: 0000000001001001
      RBP: 0000000001001001   R8: 0074736575716552   R9: 0000000000000000
      R10: ffff81003fbd0680  R11: 00000000000000c8  R12: 0000000000000008
      R13: 0000000000000001  R14: 0000000000000001  R15: ffff810015c6ca00
      ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
      RIP: 0000003cbd8d49a3  RSP: 00007fffc84e0be8  RFLAGS: 00010206
      RAX: 000000000000002c  RBX: ffffffff8005d116  RCX: 0000000000000000
      RDX: 0000000000000008  RSI: 00007fffc84e0c00  RDI: 0000000000000003
      RBP: 0000000000000000   R8: 00007fffc84e0c10   R9: 0000000000000010
      R10: 0000000000000000  R11: 0000000000000246  R12: 0000000000000000
      R13: 00007fffc84e0d10  R14: 0000000000000000  R15: 00007fffc84e0c30
      ORIG_RAX: 000000000000002c  CS: 0033  SS: 002b
      
      What happens is that, when the tipc module in inserted it enters a standalone
      node mode in which communication to its own address is allowed <0.0.0> but not
      to other addresses, since the appropriate data structures have not been
      allocated yet (specifically the tipc_net pointer).  There is nothing stopping a
      client from trying to send such a message however, and if that happens, we
      attempt to dereference tipc_net.zones while the pointer is still NULL, and
      explode.  The fix is pretty straightforward.  Since these oopses all arise from
      the dereference of global pointers prior to their assignment to allocated
      values, and since these allocations are small (about 2k total), lets convert
      these pointers to static arrays of the appropriate size.  All the accesses to
      these bits consider 0/NULL to be a non match when searching, so all the lookups
      still work properly, and there is no longer a chance of a bad dererence
      anywhere.  As a bonus, this lets us eliminate the setup/teardown routines for
      those pointers, and elimnates the need to preform any locking around them to
      prevent access while their being allocated/freed.
      
      I've updated the tipc_net structure to behave this way to fix the exact reported
      problem, and also fixed up the tipc_bearers and media_list arrays to fix an
      obvious simmilar problem that arises from issuing tipc-config commands to
      manipulate bearers/links prior to entering networked mode
      
      I've tested this for a few hours by running the sanity tests and stress test
      with the tipcutils suite, and nothing has fallen over.  There have been a few
      lockdep warnings, but those were there before, and can be addressed later, as
      they didn't actually result in any deadlock.
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      CC: Allan Stephens <allan.stephens@windriver.com>
      CC: David S. Miller <davem@davemloft.net>
      CC: tipc-discussion@lists.sourceforge.net
      
       bearer.c |   37 ++++++-------------------------------
       bearer.h |    2 +-
       net.c    |   25 ++++---------------------
       3 files changed, 11 insertions(+), 53 deletions(-)
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d0021b25
  10. 03 9月, 2008 1 次提交
  11. 15 7月, 2008 1 次提交
  12. 22 5月, 2008 1 次提交
  13. 11 2月, 2007 1 次提交
  14. 22 7月, 2006 1 次提交
  15. 28 6月, 2006 1 次提交
  16. 21 3月, 2006 2 次提交
  17. 18 1月, 2006 1 次提交
  18. 13 1月, 2006 4 次提交