1. 27 9月, 2013 4 次提交
    • V
      bonding: remove bond_for_each_slave_continue_reverse() · 81f23b13
      Veaceslav Falico 提交于
      We only use it in rollback scenarios and can easily use the standart
      bond_for_each_dev() instead.
      
      CC: Jay Vosburgh <fubar@us.ibm.com>
      CC: Andy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      81f23b13
    • V
      bonding: modify bond_get_slave_by_dev() to use neighbours · 46bb4807
      Veaceslav Falico 提交于
      It should be used under rtnl/bonding lock, so use the non-RCU version.
      
      CC: Jay Vosburgh <fubar@us.ibm.com>
      CC: Andy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      46bb4807
    • V
      bonding: populate neighbour's private on enslave · 1f718f0f
      Veaceslav Falico 提交于
      Use the new provided function when attaching the lower slave to populate
      its ->private with struct slave *new_slave. Also, move it to the end to
      be able to 'find' it only after it was completely initialized, and
      deinitialize in the first place on release.
      
      CC: Jay Vosburgh <fubar@us.ibm.com>
      CC: Andy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1f718f0f
    • V
      net: add adj_list to save only neighbours · 2f268f12
      Veaceslav Falico 提交于
      Currently, we distinguish neighbours (first-level linked devices) from
      non-neighbours by the neighbour bool in the netdev_adjacent. This could be
      quite time-consuming in case we would like to traverse *only* through
      neighbours - cause we'd have to traverse through all devices and check for
      this flag, and in a (quite common) scenario where we have lots of vlans on
      top of bridge, which is on top of a bond - the bonding would have to go
      through all those vlans to get its upper neighbour linked devices.
      
      This situation is really unpleasant, cause there are already a lot of cases
      when a device with slaves needs to go through them in hot path.
      
      To fix this, introduce a new upper/lower device lists structure -
      adj_list, which contains only the neighbours. It works always in
      pair with the all_adj_list structure (renamed from upper/lower_dev_list),
      i.e. both of them contain the same links, only that all_adj_list contains
      also non-neighbour device links. It's really a small change visible,
      currently, only for __netdev_adjacent_dev_insert/remove(), and doesn't
      change the main linked logic at all.
      
      Also, add some comments a fix a name collision in
      netdev_for_each_upper_dev_rcu() and rework the naming by the following
      rules:
      
      netdev_(all_)(upper|lower)_*
      
      If "all_" is present, then we work with the whole list of upper/lower
      devices, otherwise - only with direct neighbours. Uninline functions - to
      get better stack traces.
      
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Eric Dumazet <edumazet@google.com>
      CC: Jiri Pirko <jiri@resnulli.us>
      CC: Alexander Duyck <alexander.h.duyck@intel.com>
      CC: Cong Wang <amwang@redhat.com>
      Signed-off-by: NVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2f268f12
  2. 16 9月, 2013 1 次提交
  3. 12 9月, 2013 2 次提交
  4. 04 9月, 2013 7 次提交
  5. 30 8月, 2013 8 次提交
  6. 26 8月, 2013 1 次提交
  7. 09 8月, 2013 2 次提交
  8. 06 8月, 2013 4 次提交
  9. 03 8月, 2013 1 次提交
  10. 02 8月, 2013 6 次提交
    • N
      bonding: initial RCU conversion · 278b2083
      nikolay@redhat.com 提交于
      This patch does the initial bonding conversion to RCU. After it the
      following modes are protected by RCU alone: roundrobin, active-backup,
      broadcast and xor. Modes ALB/TLB and 3ad still acquire bond->lock for
      reading, and will be dealt with later. curr_active_slave needs to be
      dereferenced via rcu in the converted modes because the only thing
      protecting the slave after this patch is rcu_read_lock, so we need the
      proper barrier for weakly ordered archs and to make sure we don't have
      stale pointer. It's not tagged with __rcu yet because there's still work
      to be done to remove the curr_slave_lock, so sparse will complain when
      rcu_assign_pointer and rcu_dereference are used, but the alternative to use
      rcu_dereference_protected would've created much bigger code churn which is
      more difficult to test and review. That will be converted in time.
      
      1. Active-backup mode
       1.1 Perf recording while doing iperf -P 4
        - old bonding: iperf spent 0.55% in bonding, system spent 0.29% CPU
                       in bonding
        - new bonding: iperf spent 0.29% in bonding, system spent 0.15% CPU
                       in bonding
       1.2. Bandwidth measurements
        - old bonding: 16.1 gbps consistently
        - new bonding: 17.5 gbps consistently
      
      2. Round-robin mode
       2.1 Perf recording while doing iperf -P 4
        - old bonding: iperf spent 0.51% in bonding, system spent 0.24% CPU
                       in bonding
        - new bonding: iperf spent 0.16% in bonding, system spent 0.11% CPU
                       in bonding
       2.2 Bandwidth measurements
        - old bonding: 8 gbps (variable due to packet reorderings)
        - new bonding: 10 gbps (variable due to packet reorderings)
      
      Of course the latency has improved in all converted modes, and moreover
      while
      doing enslave/release (since it doesn't affect tx anymore).
      
      Also I've stress tested all modes doing enslave/release in a loop while
      transmitting traffic.
      Signed-off-by: NNikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      278b2083
    • N
      bonding: factor out slave id tx code and simplify xmit paths · 15077228
      Nikolay Aleksandrov 提交于
      I factored out the tx xmit code which relies on slave id in
      bond_xmit_slave_id. It is global because later it can be used also in
      3ad mode xmit. Unnecessary obvious comments are removed. Active-backup
      mode is simplified because bond_dev_queue_xmit always consumes the skb.
      bond_xmit_xor becomes one line because of bond_xmit_slave_id.
      bond_for_each_slave_from is not used in bond_xmit_slave_id because later
      when RCU is used we can avoid important race condition by using standard
      rculist routines.
      Signed-off-by: NNikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      15077228
    • N
      bonding: simplify broadcast_xmit function · 78a646ce
      Nikolay Aleksandrov 提交于
      We don't need to start from the curr_active_slave as the frame will be
      sent to all eligible slaves anyway, so we remove the unnecessary local
      variables, checks and comments, and make it use the standard list API.
      This has the nice side-effect that later when it's converted to RCU
      a race condition will be avoided which could lead to double packet tx.
      Signed-off-by: NNikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      78a646ce
    • N
      bonding: remove unnecessary read_locks of curr_slave_lock · 71bc3b2d
      nikolay@redhat.com 提交于
      In all the cases we already hold bond->lock for reading, so the slave
      can't get away and the check != NULL is sufficient. curr_active_slave
      can still change after the read_lock is unlocked prior to use of the
      dereferenced value, so there's no need for it. It either contains a
      valid slave which we use (and can't get away), or it is NULL which is
      checked.
      In some places the read_lock of curr_slave_lock was left because we need
      it not to change while performing some action (e.g. syncing current
      active slave's addresses, sending ARP requests through the active slave)
      such cases will be dealt with individually while converting to RCU.
      Signed-off-by: NNikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      71bc3b2d
    • N
      bonding: convert to list API and replace bond's custom list · dec1e90e
      nikolay@redhat.com 提交于
      This patch aims to remove struct bonding's first_slave and struct
      slave's next and prev pointers, and replace them with the standard Linux
      list API. The old macros are converted to list API as well and some new
      primitives are available now. The checks if there're slaves that used
      slave_cnt have been replaced by the list_empty macro.
      Also a few small style fixes, changing longest -> shortest line in local
      variable declarations, leaving an empty line before return and removing
      unnecessary brackets.
      This is the first step to gradual RCU conversion.
      Signed-off-by: NNikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dec1e90e
    • N
      bonding: fix system hang due to fast igmp timer rescheduling · 4beac029
      Nikolay Aleksandrov 提交于
      After commit 4aa5dee4 ("net: convert resend IGMP to notifier event")
      we try to acquire rtnl in bond_resend_igmp_join_requests but it can be
      scheduled with rtnl already held (e.g. when bond_change_active_slave is
      called with rtnl) causing a loop of immediate reschedules + calls because
      rtnl_trylock fails each time since it's being already held.
      For me this issue leads to system hangs very easy:
      modprobe bonding; ifconfig bond0 up; ifenslave bond0 eth0; rmmod
      bonding;
      
      The fix is to introduce a small (1 jiffy) delay which is enough for the
      sections holding rtnl to finish without putting any strain on the system.
      Also adjust the timer in bond_change_active_slave to be 1 jiffy, since
      most of the time it's called with rtnl already held.
      Signed-off-by: NNikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4beac029
  11. 28 7月, 2013 1 次提交
  12. 27 7月, 2013 2 次提交
  13. 25 7月, 2013 1 次提交