1. 29 9月, 2013 1 次提交
    • V
      bonding: correctly verify for the first slave in bond_enslave · 23c147e0
      Veaceslav Falico 提交于
      After commit 1f718f0f ("bonding: populate
      neighbour's private on enslave"), we've moved the actual 'linking' in the
      end of the function - so that, once linked, the slave is ready to be used,
      and is not still in the process of enslaving.
      
      However, 802.3ad verified if it's the first slave by looking at the
      
      if (bond_first_slave(bond) == new_slave)
      
      which, because we've moved the linking to the end, became broken - on the
      first slave bond_first_slave(bond) returns NULL.
      
      Fix this by verifying if the prev_slave, that equals bond_last_slave(), is
      actually populated - if it is - then it's not the first slave, and vice
      versa.
      
      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>
      23c147e0
  2. 27 9月, 2013 11 次提交
  3. 16 9月, 2013 1 次提交
  4. 12 9月, 2013 1 次提交
  5. 04 9月, 2013 4 次提交
  6. 30 8月, 2013 5 次提交
  7. 26 8月, 2013 1 次提交
  8. 09 8月, 2013 2 次提交
  9. 06 8月, 2013 4 次提交
  10. 03 8月, 2013 1 次提交
  11. 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
  12. 28 7月, 2013 1 次提交
  13. 27 7月, 2013 2 次提交