1. 27 Mar, 2014 12 commits
    • Ying Xue's avatar
      tipc: rename node create lock to protect node list and hlist · 46651c59
      Ying Xue authored
      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: default avatarYing Xue <ying.xue@windriver.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      46651c59
    • Ying Xue's avatar
      tipc: make broadcast bearer store in bearer_list array · 987b58be
      Ying Xue authored
      Now unicast bearer is dynamically allocated and placed into its
      identity specified slot of bearer_list array. When we search
      bearer_list array with a bearer identity, the corresponding bearer
      instance can be found. But broadcast bearer is statically allocated
      and it is not located in the bearer_list array yet. So we decide to
      enlarge bearer_list array into MAX_BEARERS + 1 slots, and its last
      slot stores the broadcast bearer so that the broadcast bearer can
      be found from bearer_list array with MAX_BEARERS as index. The
      change will help us reduce the complex relationship between bearer
      and link in the future.
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      987b58be
    • Ying Xue's avatar
      tipc: remove active flag from tipc_bearer structure · f47de12b
      Ying Xue authored
      After the allocation of tipc_bearer structure instance is converted
      from statical way to dynamical way, we identify whether a certain
      tipc_bearer structure pointer is valid by checking whether the pointer
      is NULL or not. So the active flag in tipc_bearer structure becomes
      redundant.
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f47de12b
    • Ying Xue's avatar
      tipc: convert tipc_bearers array to pointer list · 3874ccbb
      Ying Xue authored
      As part of the effort to introduce RCU protection for the bearer
      list, we first need to change it to a list of pointers.
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3874ccbb
    • Ying Xue's avatar
      tipc: acquire necessary locks in named_cluster_distribute routine · 78dfb789
      Ying Xue authored
      The 'tipc_node_list' is guarded by tipc_net_lock and 'links' array
      defined in 'tipc_node' structure is protected by node lock as well.
      Without acquiring the two locks in named_cluster_distribute() a fatal
      oops may happen in case that a destroyed link might be got and then
      accessed. Therefore, above mentioned two locks must be held in
      named_cluster_distribute() to prevent the issue from happening
      accidentally.
      
      As 'links' array in node struct must be protected by node lock,
      we have to move the code of selecting an active link from
      tipc_link_xmit() to named_cluster_distribute() and then call
      __tipc_link_xmit() with the selected link to deliver name messages.
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      78dfb789
    • Ying Xue's avatar
      tipc: obsolete the remote management feature · 5902385a
      Ying Xue authored
      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: default avatarYing Xue <ying.xue@windriver.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5902385a
    • Ying Xue's avatar
      tipc: remove unnecessary checking for node object · 76d78824
      Ying Xue authored
      tipc_node_create routine doesn't need to check whether a node
      object specified with a node address exists or not because its
      caller(ie, tipc_disc_recv_msg routine) has checked this before
      calling it.
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      76d78824
    • David S. Miller's avatar
      Merge branch 'sxgbe' · 1dbe1369
      David S. Miller authored
      Byungho An says:
      
      ====================
      This is 14th posting for SAMSUNG SXGBE driver.
      
      Changes since v1:
      - changed name of driver to SXGbE as per Ben's comment
      - squashed Joe's neatening for many stuff in original patches
      
      Changes since v2:
      - updated and split binding document as per Mark's comment
      - clean up codes as per Joe's comment
      - removed unused fields and clean up codes as per Francois's comment
      - removed module parameters as per Dave's comment
      - moved driver directory to samsung/sxgbe/
      
      Changes since v3:
      - fixed Missing a blank line after declarations as per Dave's comment
      - clean up codes as per Joe's comment
      - removed reference of net_device.{irq, base_addr} as per Francois's comment
      
      Changes since v4:
      - updated binding document and DT related function as per Mark's comment
      
      Changes since v5:
      - updated binding document and DT related function as per Florian's comment
      - fixed typo and shortened code as per Joe's comment
      
      Changes since v6:
      - updated TSO related functions as per Rayagond's comment
      - updated binding document as per Mark's comment
      - removed WoL patch from this patch set
      
      Changes since v7:
      - updated TSO related functions as per Rayagond's comment
      
      Changes since v8:
      - removed select and depends statement from vendor sub-section as per
        Dave's comment
      
      Changes since v9:
      - removed adv-add-map, force-sf-dma-modei and force-thresh-dma-mode from
        binding documnet as per Mark's comment
      
      Changes since v10:
      - clean up codes as per Francois's comment
      
      Changes since v11:
      - clean up mdio_read/write codes as per Francois's comment
      - changed irq acquisition error path as per Francois's comment
      - updated mdio and platform related codes as per Tomasz'comment
      - clean up dma related codes as per Vince's comment
      
      Changes since v12:
      - fixed typo
      
      Changes since v13:
      - clean up error path codes for irqs as per Francois's comment
      - removed unsupported functions for ehttoolirq as per Ben's comment
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1dbe1369
    • Monam Agarwal's avatar
      net/core: Use RCU_INIT_POINTER(x, NULL) in netpoll.c · fcb144b5
      Monam Agarwal authored
      This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL)
      
      The rcu_assign_pointer() ensures that the initialization of a structure
      is carried out before storing a pointer to that structure.
      And in the case of the NULL pointer, there is no structure to initialize.
      So, rcu_assign_pointer(p, NULL) can be safely converted to RCU_INIT_POINTER(p, NULL)
      Signed-off-by: default avatarMonam Agarwal <monamagarwal123@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fcb144b5
    • Monam Agarwal's avatar
      net/bridge: Use RCU_INIT_POINTER(x, NULL) in br_vlan.c · cd18721e
      Monam Agarwal authored
      This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL)
      
      The rcu_assign_pointer() ensures that the initialization of a structure
      is carried out before storing a pointer to that structure.
      And in the case of the NULL pointer, there is no structure to initialize.
      So, rcu_assign_pointer(p, NULL) can be safely converted to RCU_INIT_POINTER(p, NULL)
      Signed-off-by: default avatarMonam Agarwal <monamagarwal123@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cd18721e
    • Monam Agarwal's avatar
      drivers/net: Use RCU_INIT_POINTER(x, NULL) in tun.c · c956674b
      Monam Agarwal authored
      This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL)
      
      The rcu_assign_pointer() ensures that the initialization of a structure
      is carried out before storing a pointer to that structure.
      And in the case of the NULL pointer, there is no structure to initialize.
      So, rcu_assign_pointer(p, NULL) can be safely converted to RCU_INIT_POINTER(p, NULL)
      Signed-off-by: default avatarMonam Agarwal <monamagarwal123@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c956674b
    • Monam Agarwal's avatar
      drivers/net: Use RCU_INIT_POINTER(x, NULL) in bonding/bond_options.c · 8800a244
      Monam Agarwal authored
      This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL)
      
      The rcu_assign_pointer() ensures that the initialization of a structure
      is carried out before storing a pointer to that structure.
      And in the case of the NULL pointer, there is no structure to initialize.
      So, rcu_assign_pointer(p, NULL) can be safely converted to RCU_INIT_POINTER(p, NULL)
      Signed-off-by: default avatarMonam Agarwal <monamagarwal123@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8800a244
  2. 26 Mar, 2014 28 commits