1. 15 5月, 2015 1 次提交
    • J
      tipc: simplify include dependencies · a6bf70f7
      Jon Paul Maloy 提交于
      When we try to add new inline functions in the code, we sometimes
      run into circular include dependencies.
      
      The main problem is that the file core.h, which really should be at
      the root of the dependency chain, instead is a leaf. I.e., core.h
      includes a number of header files that themselves should be allowed
      to include core.h. In reality this is unnecessary, because core.h does
      not need to know the full signature of any of the structs it refers to,
      only their type declaration.
      
      In this commit, we remove all dependencies from core.h towards any
      other tipc header file.
      
      As a consequence of this change, we can now move the function
      tipc_own_addr(net) from addr.c to addr.h, and make it inline.
      
      There are no functional changes in this commit.
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: NYing Xue <ying.xue@windriver.com>
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a6bf70f7
  2. 10 2月, 2015 3 次提交
  3. 13 1月, 2015 7 次提交
  4. 22 11月, 2014 2 次提交
  5. 24 8月, 2014 2 次提交
  6. 28 6月, 2014 2 次提交
  7. 15 5月, 2014 1 次提交
  8. 06 5月, 2014 1 次提交
  9. 23 4月, 2014 2 次提交
    • Y
      tipc: purge tipc_net_lock lock · 7216cd94
      Ying Xue 提交于
      Now tipc routing hierarchy comprises the structures 'node', 'link'and
      'bearer'. The whole hierarchy is protected by a big read/write lock,
      tipc_net_lock, to ensure that nothing is added or removed while code
      is accessing any of these structures. Obviously the locking policy
      makes node, link and bearer components closely bound together so that
      their relationship becomes unnecessarily complex. In the worst case,
      such locking policy not only has a negative influence on performance,
      but also it's prone to lead to deadlock occasionally.
      
      In order o decouple the complex relationship between bearer and node
      as well as link, the locking policy is adjusted as follows:
      
      - Bearer level
        RTNL lock is used on update side, and RCU is used on read side.
        Meanwhile, all bearer instances including broadcast bearer are
        saved into bearer_list array.
      
      - Node and link level
        All node instances are saved into two tipc_node_list and node_htable
        lists. The two lists are protected by node_list_lock on write side,
        and they are guarded with RCU lock on read side. All members in node
        structure including link instances are protected by node spin lock.
      
      - The relationship between bearer and node
        When link accesses bearer, it first needs to find the bearer with
        its bearer identity from the bearer_list array. When bearer accesses
        node, it can iterate the node_htable hash list with the node
        address to find the corresponding node.
      
      In the new locking policy, every component has its private locking
      solution and the relationship between bearer and node is very simple,
      that is, they can find each other with node address or bearer identity
      from node_htable hash list or bearer_list array.
      
      Until now above all changes have been done, so tipc_net_lock can be
      removed safely.
      Signed-off-by: NYing Xue <ying.xue@windriver.com>
      Reviewed-by: NJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Tested-by: NErik Hugne <erik.hugne@ericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7216cd94
    • Y
      tipc: use RTNL lock to protect tipc_net_stop routine · f97e455a
      Ying Xue 提交于
      As the tipc network initialization(ie, tipc_net_start routine) is
      under RTNL protection, its corresponding deinitialization part(ie,
      tipc_net_stop routine) should be protected by RTNL too.
      Signed-off-by: NYing Xue <ying.xue@windriver.com>
      Reviewed-by: NJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Tested-by: NErik Hugne <erik.hugne@ericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f97e455a
  10. 04 4月, 2014 1 次提交
  11. 28 3月, 2014 2 次提交
    • Y
      tipc: rename node create lock to protect node list and hlist · 46651c59
      Ying Xue 提交于
      When a node is created, tipc_net_lock read lock is first held and
      then node_create_lock is grabbed in order to prevent the same node
      from being created and inserted into both node list and hlist twice.
      But when we query node from the two node lists, we only hold
      tipc_net_lock read lock without grabbing node_create_lock. Obviously
      this locking policy is unable to guarantee that the two node lists
      are always synchronized especially when the operation of changing
      and accessing them occurs in different contexts like currently doing.
      
      Therefore, rename node_create_lock to node_list_lock to protect the
      two node lists, that is, whenever node is inserted into them or node
      is queried from them, the node_list_lock should be always held. As a
      result, tipc_net_lock read lock becomes redundant and then can be
      removed from the node query functions.
      Signed-off-by: NYing Xue <ying.xue@windriver.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: NJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      46651c59
    • Y
      tipc: obsolete the remote management feature · 5902385a
      Ying Xue 提交于
      Due to the lacking of any credential, it's allowed to accept commands
      requested from remote nodes to query the local node status, which is
      prone to involve potential security risks. Instead, if we login to
      a remote node with ssh command, this approach is not only more safe
      than the remote management feature, but also it can give us more
      permissions like changing the remote node configuration. So it's
      reasonable for us to obsolete the remote management feature now.
      Signed-off-by: NYing Xue <ying.xue@windriver.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5902385a
  12. 19 2月, 2014 1 次提交
    • Y
      tipc: align tipc function names with common naming practice in the network · 247f0f3c
      Ying Xue 提交于
      Rename the following functions, which are shorter and more in line
      with common naming practice in the network subsystem.
      
      tipc_bclink_send_msg->tipc_bclink_xmit
      tipc_bclink_recv_pkt->tipc_bclink_rcv
      tipc_disc_recv_msg->tipc_disc_rcv
      tipc_link_send_proto_msg->tipc_link_proto_xmit
      link_recv_proto_msg->tipc_link_proto_rcv
      link_send_sections_long->tipc_link_iovec_long_xmit
      tipc_link_send_sections_fast->tipc_link_iovec_xmit_fast
      tipc_link_send_sync->tipc_link_sync_xmit
      tipc_link_recv_sync->tipc_link_sync_rcv
      tipc_link_send_buf->__tipc_link_xmit
      tipc_link_send->tipc_link_xmit
      tipc_link_send_names->tipc_link_names_xmit
      tipc_named_recv->tipc_named_rcv
      tipc_link_recv_bundle->tipc_link_bundle_rcv
      tipc_link_dup_send_queue->tipc_link_dup_queue_xmit
      link_send_long_buf->tipc_link_frag_xmit
      
      tipc_multicast->tipc_port_mcast_xmit
      tipc_port_recv_mcast->tipc_port_mcast_rcv
      tipc_port_reject_sections->tipc_port_iovec_reject
      tipc_port_recv_proto_msg->tipc_port_proto_rcv
      tipc_connect->tipc_port_connect
      __tipc_connect->__tipc_port_connect
      __tipc_disconnect->__tipc_port_disconnect
      tipc_disconnect->tipc_port_disconnect
      tipc_shutdown->tipc_port_shutdown
      tipc_port_recv_msg->tipc_port_rcv
      tipc_port_recv_sections->tipc_port_iovec_rcv
      
      release->tipc_release
      accept->tipc_accept
      bind->tipc_bind
      get_name->tipc_getname
      poll->tipc_poll
      send_msg->tipc_sendmsg
      send_packet->tipc_send_packet
      send_stream->tipc_send_stream
      recv_msg->tipc_recvmsg
      recv_stream->tipc_recv_stream
      connect->tipc_connect
      listen->tipc_listen
      shutdown->tipc_shutdown
      setsockopt->tipc_setsockopt
      getsockopt->tipc_getsockopt
      
      Above changes have no impact on current users of the functions.
      Signed-off-by: NYing Xue <ying.xue@windriver.com>
      Reviewed-by: NJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      247f0f3c
  13. 20 8月, 2012 1 次提交
  14. 14 7月, 2012 1 次提交
  15. 27 4月, 2012 2 次提交
    • A
      tipc: Enhance re-initialization of network topology service · eb3865a9
      Allan Stephens 提交于
      Streamlines the job of re-initializing TIPC's network topology service
      when a node's network address is first assigned. Rather than destroying
      the topology server port and breaking its connections to existing
      subscribers, TIPC now simply lets the service continue running (since
      the change to the port identifier of each port used by the topology
      service no longer impacts the flow of messages between the service and
      its subscribers).
      
      This enhancement means that applications that utilize the topology
      service prior to the assignment of TIPC's network address no longer need
      to re-establish their subscriptions when the address is finally assigned.
      
      However, it is worth noting that any subsequent events for existing
      subscriptions report the new port identifier of the publishing port,
      rather than the original port identifier. (For example, a name that was
      previously reported as being published by <0.0.0:ref> may be subsequently
      withdrawn by <Z.C.N:ref>.)
      
      This doesn't impact any of the existing known userspace in tipc-utils,
      since (a) TIPC continues to treat references to the original port ID
      correctly and (b) normal use cases assign an address before active use.
      
      However if there does happen to be some rare/custom application out
      there that was relying on this, they can simply bypass the enhancement
      by issuing a subscription to {0,0} and break its connection to the
      topology service, if an associated withdrawal event occurs.
      Signed-off-by: NAllan Stephens <allan.stephens@windriver.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      eb3865a9
    • A
      tipc: Optimize re-initialization of configuration service · a2cfd45b
      Allan Stephens 提交于
      Streamlines the job of re-initializing TIPC's configuration service
      when a node's network address is first assigned. Rather than destroying
      the configuration server port and then recreating it, TIPC now simply
      withdraws the existing {0,<0.0.0>} name publication and creates a new
      {0,<Z.C.N>} name publication that identifies the node's network address
      to interested subscribers.
      Signed-off-by: NAllan Stephens <allan.stephens@windriver.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      a2cfd45b
  16. 20 4月, 2012 1 次提交
  17. 25 2月, 2012 2 次提交
  18. 28 12月, 2011 2 次提交
  19. 01 9月, 2011 1 次提交
  20. 15 3月, 2011 1 次提交
  21. 14 3月, 2011 4 次提交
    • 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