1. 08 10月, 2009 2 次提交
  2. 07 10月, 2009 1 次提交
    • J
      bonding: introduce primary_reselect option · a549952a
      Jiri Pirko 提交于
      In some cases there is not desirable to switch back to primary interface when
      it's link recovers and rather stay with currently active one. We need to avoid
      packetloss as much as we can in some cases. This is solved by introducing
      primary_reselect option. Note that enslaved primary slave is set as current
      active no matter what.
      
      Patch modified by Jay Vosburgh as follows: fixed bug in action
      after change of option setting via sysfs, revised the documentation
      update, and bumped the bonding version number.
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a549952a
  3. 17 9月, 2009 1 次提交
  4. 15 9月, 2009 1 次提交
  5. 01 9月, 2009 1 次提交
  6. 29 8月, 2009 4 次提交
  7. 14 8月, 2009 1 次提交
  8. 17 7月, 2009 1 次提交
    • M
      bonding: clean muticast addresses when device changes type · e36b9d16
      Moni Shoua 提交于
      Bonding device forbids slave device of different types under the same
      master.
      
      However, it is possible for a bonding master to change type during its
      lifetime.  This can be either from ARPHRD_ETHER to ARPHRD_INFINIBAND
      or the other way arround.  The change of type requires device level
      multicast address cleanup because device level multicast addresses
      depend on the device type.
      
      The patch adds a call to dev_close() before the bonding master changes
      type and dev_open() just after that.
      
      In the example below I enslaved an IPoIB device (ib0) under
      bond0. Since each bonding master starts as device of type ARPHRD_ETHER
      by default, a change of type occurs when ib0 is enslaved.
      
      This is how /proc/net/dev_mcast looks like without the patch
      
      5    bond0           1     0     00ffffffff12601bffff000000000001ff96ca05
      5    bond0           1     0     01005e000116
      5    bond0           1     0     01005e7ffffd
      5    bond0           1     0     01005e000001
      5    bond0           1     0     333300000001
      6    ib0             1     0     00ffffffff12601bffff000000000001ff96ca05
      6    ib0             1     0     333300000001
      6    ib0             1     0     01005e000001
      6    ib0             1     0     01005e7ffffd
      6    ib0             1     0     01005e000116
      6    ib0             1     0     00ffffffff12401bffff00000000000000000001
      6    ib0             1     0     00ffffffff12601bffff00000000000000000001
      
      and this is how it looks like after the patch.
      
      5    bond0           1     0     00ffffffff12601bffff000000000001ff96ca05
      5    bond0           1     0     00ffffffff12601bffff00000000000000000001
      5    bond0           1     0     00ffffffff12401bffff0000000000000ffffffd
      5    bond0           1     0     00ffffffff12401bffff00000000000000000116
      5    bond0           1     0     00ffffffff12401bffff00000000000000000001
      6    ib0             1     0     00ffffffff12601bffff000000000001ff96ca05
      6    ib0             1     0     00ffffffff12401bffff00000000000000000116
      6    ib0             1     0     00ffffffff12401bffff0000000000000ffffffd
      6    ib0             2     0     00ffffffff12401bffff00000000000000000001
      6    ib0             2     0     00ffffffff12601bffff00000000000000000001
      Signed-off-by: NMoni Shoua <monis@voltaire.com>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e36b9d16
  9. 06 7月, 2009 1 次提交
  10. 14 6月, 2009 7 次提交
  11. 30 5月, 2009 1 次提交
  12. 19 5月, 2009 1 次提交
    • E
      net: release dst entry in dev_hard_start_xmit() · 93f154b5
      Eric Dumazet 提交于
      One point of contention in high network loads is the dst_release() performed
      when a transmited skb is freed. This is because NIC tx completion calls
      dev_kree_skb() long after original call to dev_queue_xmit(skb).
      
      CPU cache is cold and the atomic op in dst_release() stalls. On SMP, this is
      quite visible if one CPU is 100% handling softirqs for a network device,
      since dst_clone() is done by other cpus, involving cache line ping pongs.
      
      It seems right place to release dst is in dev_hard_start_xmit(), for most
      devices but ones that are virtual, and some exceptions.
      
      David Miller suggested to define a new device flag, set in alloc_netdev_mq()
      (so that most devices set it at init time), and carefuly unset in devices
      which dont want a NULL skb->dst in their ndo_start_xmit().
      
      List of devices that must clear this flag is :
      
      - loopback device, because it calls netif_rx() and quoting Patrick :
          "ip_route_input() doesn't accept loopback addresses, so loopback packets
           already need to have a dst_entry attached."
      - appletalk/ipddp.c : needs skb->dst in its xmit function
      
      - And all devices that call again dev_queue_xmit() from their xmit function
      (as some classifiers need skb->dst) : bonding, vlan, macvlan, eql, ifb, hdlc_fr
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      93f154b5
  13. 18 5月, 2009 1 次提交
    • E
      net: tx scalability works : trans_start · 9d21493b
      Eric Dumazet 提交于
      struct net_device trans_start field is a hot spot on SMP and high performance
      devices, particularly multi queues ones, because every transmitter dirties
      it. Is main use is tx watchdog and bonding alive checks.
      
      But as most devices dont use NETIF_F_LLTX, we have to lock
      a netdev_queue before calling their ndo_start_xmit(). So it makes
      sense to move trans_start from net_device to netdev_queue. Its update
      will occur on a already present (and in exclusive state) cache line, for
      free.
      
      We can do this transition smoothly. An old driver continue to
      update dev->trans_start, while an updated one updates txq->trans_start.
      
      Further patches could also put tx_bytes/tx_packets counters in 
      netdev_queue to avoid dirtying dev->stats (vlan device comes to mind)
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9d21493b
  14. 10 5月, 2009 1 次提交
  15. 06 5月, 2009 1 次提交
  16. 02 5月, 2009 2 次提交
  17. 27 4月, 2009 2 次提交
    • J
      bonding: ignore updelay param when there is no active slave · 41f89100
      Jiri Pirko 提交于
      Pointed out by Sean E. Millichamp.
      
      Quote from Documentation/networking/bonding.txt:
      "Note that when a bonding interface has no active links, the
      driver will immediately reuse the first link that goes up, even if the
      updelay parameter has been specified (the updelay is ignored in this
      case).  If there are slave interfaces waiting for the updelay timeout
      to expire, the interface that first went into that state will be
      immediately reused.  This reduces down time of the network if the
      value of updelay has been overestimated, and since this occurs only in
      cases with no connectivity, there is no additional penalty for
      ignoring the updelay."
      
      This patch actually changes the behaviour in this way.
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      
       drivers/net/bonding/bond_main.c |    8 ++++++++
       1 files changed, 8 insertions(+), 0 deletions(-)
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      41f89100
    • J
      bonding: use ethtool for link checking first · 29112f4e
      Jiri Pirko 提交于
      This patch only changes the order of interfaces to use for checking slave link
      status in bond_check_dev_link() to priorize ethtool interface. Should safe some
      troubles as ethtool seems to be more supported.
      
      Jirka
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      
       drivers/net/bonding/bond_main.c |   26 ++++++++++++--------------
       1 files changed, 12 insertions(+), 14 deletions(-)
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      29112f4e
  18. 13 4月, 2009 1 次提交
  19. 31 3月, 2009 1 次提交
    • A
      proc 2/2: remove struct proc_dir_entry::owner · 99b76233
      Alexey Dobriyan 提交于
      Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
      as correctly noted at bug #12454. Someone can lookup entry with NULL
      ->owner, thus not pinning enything, and release it later resulting
      in module refcount underflow.
      
      We can keep ->owner and supply it at registration time like ->proc_fops
      and ->data.
      
      But this leaves ->owner as easy-manipulative field (just one C assignment)
      and somebody will forget to unpin previous/pin current module when
      switching ->owner. ->proc_fops is declared as "const" which should give
      some thoughts.
      
      ->read_proc/->write_proc were just fixed to not require ->owner for
      protection.
      
      rmmod'ed directories will be empty and return "." and ".." -- no harm.
      And directories with tricky enough readdir and lookup shouldn't be modular.
      We definitely don't want such modular code.
      
      Removing ->owner will also make PDE smaller.
      
      So, let's nuke it.
      
      Kudos to Jeff Layton for reminding about this, let's say, oversight.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=12454Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      99b76233
  20. 26 3月, 2009 1 次提交
    • J
      bonding: select current active slave when enslaving device for mode tlb and alb · 5a29f789
      Jiri Pirko 提交于
      I've hit an issue on my system when I've been using RealTek RTL8139D cards in
      bonding interface in mode balancing-alb. When I enslave a card, the current
      active slave (bond->curr_active_slave) is not set and the link is therefore
      not functional.
      
      ----
      # cat /proc/net/bonding/bond0
      Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)
      
      Bonding Mode: adaptive load balancing
      Primary Slave: None
      Currently Active Slave: None
      MII Status: up
      MII Polling Interval (ms): 100
      Up Delay (ms): 0
      Down Delay (ms): 0
      
      Slave Interface: eth1
      MII Status: up
      Link Failure Count: 0
      Permanent HW addr: 00:1f:1f:01:2f:22
      ----
      
      The thing that gets it right is when I unplug the cable and then I put it back
      into the NIC. Then the current active slave is set to eth1 and link is working
      just fine. Here is dmesg log with bonding DEBUG messages turned on:
      ----
      ADDRCONF(NETDEV_UP): bond0: link is not ready
      event_dev: bond0, event: 1
      IFF_MASTER
      event_dev: bond0, event: 8
      IFF_MASTER
      bond_ioctl: master=bond0, cmd=35216
      slave_dev=cac5d800: 
      slave_dev->name=eth1: 
      eth1: ! NETIF_F_VLAN_CHALLENGED
      event_dev: eth1, event: 8
      eth1: link up, 100Mbps, full-duplex, lpa 0xC5E1
      event_dev: eth1, event: 1
      event_dev: eth1, event: 8
      IFF_SLAVE
      Initial state of slave_dev is BOND_LINK_UP
      bonding: bond0: enslaving eth1 as an active interface with an up link.
      ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
      event_dev: bond0, event: 4
      IFF_MASTER
      bond0: no IPv6 routers present
      
      <<<<cable unplug>>>>
      
      eth1: link down
      event_dev: eth1, event: 4
      IFF_SLAVE
      bonding: bond0: link status definitely down for interface eth1, disabling it
      event_dev: bond0, event: 4
      IFF_MASTER
      
      <<<<cable plug>>>>
      
      eth1: link up, 100Mbps, full-duplex, lpa 0xC5E1
      event_dev: eth1, event: 4
      IFF_SLAVE
      bonding: bond0: link status definitely up for interface eth1.
      bonding: bond0: making interface eth1 the new active one.
      event_dev: eth1, event: 8
      IFF_SLAVE
      event_dev: eth1, event: 8
      IFF_SLAVE
      bonding: bond0: first active interface up!
      event_dev: bond0, event: 4
      IFF_MASTER
      ----
      
      The current active slave is set by calling bond_select_active_slave() function
      from bond_miimon_commit() function when the slave (eth1) link goes to state up.
      
      I also tested this on other machine with Broadcom NetXtreme II BCM5708
      1000Base-T NIC and there all works fine. The thing is that this adapter is down
      and goes up after few seconds after it is enslaved.
      
      This patch calls bond_select_active_slave() in bond_enslave() function for modes
      alb and tlb and makes sure that the current active slave is set up properly even
      when the slave state is already up. Tested on both systems, works fine.
      
      Notice: The same problem can maybe also occrur in mode 8023AD but I'm unable to
      test that.
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a29f789
  21. 19 3月, 2009 1 次提交
    • J
      bonding: Fix updating of speed/duplex changes · 17d04500
      Jay Vosburgh 提交于
      	This patch corrects an omission from the following commit:
      
      commit f0c76d61
      Author: Jay Vosburgh <fubar@us.ibm.com>
      Date:   Wed Jul 2 18:21:58 2008 -0700
      
          bonding: refactor mii monitor
      
      	The un-refactored code checked the link speed and duplex of
      every slave on every pass; the refactored code did not do so.
      
      	The 802.3ad and balance-alb/tlb modes utilize the speed and
      duplex information, and require it to be kept up to date.  This patch
      adds a notifier check to perform the appropriate updating when the slave
      device speed changes.
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      17d04500
  22. 05 3月, 2009 1 次提交
  23. 18 2月, 2009 2 次提交
  24. 22 1月, 2009 1 次提交
  25. 07 1月, 2009 1 次提交
  26. 26 12月, 2008 1 次提交
  27. 10 12月, 2008 1 次提交