1. 30 12月, 2013 1 次提交
    • Y
      tipc: fix deadlock during socket release · 84602761
      Ying Xue 提交于
      A deadlock might occur if name table is withdrawn in socket release
      routine, and while packets are still being received from bearer.
      
             CPU0                       CPU1
      T0:   recv_msg()               release()
      T1:   tipc_recv_msg()          tipc_withdraw()
      T2:   [grab node lock]         [grab port lock]
      T3:   tipc_link_wakeup_ports() tipc_nametbl_withdraw()
      T4:   [grab port lock]*        named_cluster_distribute()
      T5:   wakeupdispatch()         tipc_link_send()
      T6:                            [grab node lock]*
      
      The opposite order of holding port lock and node lock on above two
      different paths may result in a deadlock. If socket lock instead of
      port lock is used to protect port instance in tipc_withdraw(), the
      reverse order of holding port lock and node lock will be eliminated,
      as a result, the deadlock is killed as well.
      Reported-by: NLars Everbrand <lars.everbrand@ericsson.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Signed-off-by: NYing Xue <ying.xue@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      84602761
  2. 19 10月, 2013 1 次提交
  3. 18 6月, 2013 6 次提交
  4. 08 12月, 2012 1 次提交
    • P
      tipc: standardize across connect/disconnect function naming · bc879117
      Paul Gortmaker 提交于
      Currently we have tipc_disconnect and tipc_disconnect_port.  It is
      not clear from the names alone, what they do or how they differ.
      It turns out that tipc_disconnect just deals with the port locking
      and then calls tipc_disconnect_port which does all the work.
      
      If we rename as follows: tipc_disconnect_port --> __tipc_disconnect
      then we will be following typical linux convention, where:
      
         __tipc_disconnect: "raw" function that does all the work.
      
         tipc_disconnect: wrapper that deals with locking and then calls
      		    the real core __tipc_disconnect function
      
      With this, the difference is immediately evident, and locking
      violations are more apt to be spotted by chance while working on,
      or even just while reading the code.
      
      On the connect side of things, we currently only have the single
      "tipc_connect2port" function.  It does both the locking at enter/exit,
      and the core of the work.  Pending changes will make it desireable to
      have the connect be a two part locking wrapper + worker function,
      just like the disconnect is already.
      
      Here, we make the connect look just like the updated disconnect case,
      for the above reason, and for consistency.  In the process, we also
      get rid of the "2port" suffix that was on the original name, since
      it adds no descriptive value.
      
      On close examination, one might notice that the above connect
      changes implicitly move the call to tipc_link_get_max_pkt() to be
      within the scope of tipc_port_lock() protected region; when it was
      not previously.  We don't see any issues with this, and it is in
      keeping with __tipc_connect doing the work and tipc_connect just
      handling the locking.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      bc879117
  5. 11 7月, 2012 1 次提交
  6. 01 5月, 2012 1 次提交
    • P
      tipc: compress out gratuitous extra carriage returns · 617d3c7a
      Paul Gortmaker 提交于
      Some of the comment blocks are floating in limbo between two
      functions, or between blocks of code.  Delete the extra line
      feeds between any comment and its associated following block
      of code, to be consistent with the majority of the rest of
      the kernel.  Also delete trailing newlines at EOF and fix
      a couple trivial typos in existing comments.
      
      This is a 100% cosmetic change with no runtime impact.  We get
      rid of over 500 lines of non-code, and being blank line deletes,
      they won't even show up as noise in git blame.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      617d3c7a
  7. 20 4月, 2012 2 次提交
    • A
      tipc: Ensure network address change doesn't impact local connections · f0712e86
      Allan Stephens 提交于
      Revises routines that deal with connections between two ports on
      the same node to ensure the connection is not impacted if the node's
      network address is changed in mid-operation. The routines now treat
      the default node address of <0.0.0> as an alias for "this node" in
      the following situations:
      
      1) Incoming messages destined to a connected port now handle the alias
      properly when validating that the message was sent by the expected
      peer port, ensuring that the message will be accepted regardless of
      whether it specifies the node's old network address or it's current one.
      
      2) The code which completes connection establishment now handles the
      alias properly when determining if the peer port is on the same node
      as the connected port.
      
      An added benefit of addressing issue 1) is that some peer port
      validation code has been relocated to TIPC's socket subsystem, which
      means that validation is no longer done twice when a message is
      sent to a non-socket port (such as TIPC's configuration service or
      network topology service).
      Signed-off-by: NAllan Stephens <allan.stephens@windriver.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      f0712e86
    • A
      tipc: delete duplicate peerport/peernode helper functions · d0e17fed
      Allan Stephens 提交于
      Prior to commit 23dd4cce
      
          "tipc: Combine port structure with tipc_port structure"
      
      there was a need for the two sets of helper functions.  But
      now they are just duplicates.  Remove the globally visible
      ones, and mark the remaining ones as inline.
      Signed-off-by: NAllan Stephens <allan.stephens@windriver.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      d0e17fed
  8. 01 3月, 2012 1 次提交
  9. 30 12月, 2011 1 次提交
  10. 11 5月, 2011 1 次提交
    • A
      tipc: Avoid recomputation of outgoing message length · 26896904
      Allan Stephens 提交于
      Rework TIPC's message sending routines to take advantage of the total
      amount of data value passed to it by the kernel socket infrastructure.
      This change eliminates the need for TIPC to compute the size of outgoing
      messages itself, as well as the check for an oversize message in
      tipc_msg_build().  In addition, this change warrants an explanation:
      
         -     res = send_packet(NULL, sock, &my_msg, 0);
         +     res = send_packet(NULL, sock, &my_msg, bytes_to_send);
      
      Previously, the final argument to send_packet() was ignored (since the
      amount of data being sent was recalculated by a lower-level routine)
      and we could just pass in a dummy value (0). Now that the
      recalculation is being eliminated, the argument value being passed to
      send_packet() is significant and we have to supply the actual amount
      of data we want to send.
      Signed-off-by: NAllan Stephens <Allan.Stephens@windriver.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      26896904
  11. 24 2月, 2011 3 次提交
    • A
      tipc: Remove support for per-connection message sequence numbering · 741de3e9
      Allan Stephens 提交于
      Eliminates TIPC's prototype support for message sequence numbering
      on routable connections (i.e. connections requiring more than one hop).
      This capability isn't currently used, and can be removed since TIPC
      only supports systems in which all inter-node communication can be
      achieved in a single hop.
      Signed-off-by: NAllan Stephens <Allan.Stephens@windriver.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      741de3e9
    • A
      tipc: Fix port counter handling to correct congestion control · cb7ce914
      Allan Stephens 提交于
      Modifies TIPC's congestion control between a connected port and its
      peer so that it works as documented. The following changes have been
      made:
      
      1) The counter of the number of messages sent by a port now starts
         at zero, rather than one. This prevents the port from reporting port
         congestion one message earlier than it was supposed to.
      
      2) The counter of the number of messages sent by a port is now
         incremented only if a non-empty message is sent successfully.
         This prevents the port from becoming permanently congested if
         too many send attempts are unsuccessful because of congestion
         (or other reasons). It also removes the risk that empty hand-
         shaking messages used during connection setup might cause the
         port to report congestion earlier than it was supposed to.
      
      3) The counter of the number of unacknowledged messages received by
         a port controlled by an internal TIPC service is now incremented
         only if the message is non-empty, in order to be consistent with
         the aforementioned changes.
      Signed-off-by: NAllan Stephens <Allan.Stephens@windriver.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      cb7ce914
    • A
      tipc: Combine port structure with tipc_port structure · 23dd4cce
      Allan Stephens 提交于
      Merge two distinct structures containing information about a TIPC port
      into a single structure. The structures were previously kept separate
      so that public information about a port could be made available to
      applications using TIPC's native API, while the remaining information
      was kept private for use by TIPC itself. However, now that the native
      API has been removed there is no longer any need for this somewhat
      confusing arrangement.
      
      Since one of the structures was already embedded within the other, the
      change largely involves replacing instances of "publ.foo" with "foo".
      The changes do not otherwise alter the operation of TIPC ports.
      Signed-off-by: NAllan Stephens <Allan.Stephens@windriver.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      23dd4cce
  12. 02 1月, 2011 3 次提交
  13. 03 12月, 2010 6 次提交
  14. 17 10月, 2010 1 次提交
  15. 24 9月, 2010 1 次提交
  16. 13 5月, 2010 1 次提交
  17. 03 9月, 2008 1 次提交
  18. 11 7月, 2007 1 次提交
    • A
      [TIPC]: Optimize stream send routine to avoid fragmentation · 05646c91
      Allan Stephens 提交于
      This patch enhances TIPC's stream socket send routine so that
      it avoids transmitting data in chunks that require fragmentation
      and reassembly, thereby improving performance at both the
      sending and receiving ends of the connection.
      
      The "maximum packet size" hint that records MTU info allows
      the socket to decide how big a chunk it should send; in the
      event that the hint has become stale, fragmentation may still
      occur, but the data will be passed correctly and the hint will
      be updated in time for the following send.  Note: The 66060 byte
      pseudo-MTU used for intra-node connections requires the send
      routine to perform an additional check to ensure it does not
      exceed TIPC"s limit of 66000 bytes of user data per chunk.
      Signed-off-by: NAllan Stephens <allan.stephens@windriver.com>
      Signed-off-by: NJon Paul Maloy <jon.maloy@ericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05646c91
  19. 11 2月, 2007 1 次提交
  20. 18 1月, 2006 2 次提交
  21. 13 1月, 2006 4 次提交