1. 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
  2. 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
  3. 05 3月, 2009 1 次提交
  4. 18 2月, 2009 2 次提交
  5. 22 1月, 2009 1 次提交
  6. 07 1月, 2009 1 次提交
  7. 26 12月, 2008 1 次提交
  8. 10 12月, 2008 5 次提交
  9. 04 12月, 2008 1 次提交
  10. 21 11月, 2008 1 次提交
  11. 20 11月, 2008 2 次提交
  12. 13 11月, 2008 1 次提交
    • W
      netdevice: safe convert to netdev_priv() #part-1 · 454d7c9b
      Wang Chen 提交于
      We have some reasons to kill netdev->priv:
      1. netdev->priv is equal to netdev_priv().
      2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously
         netdev_priv() is more flexible than netdev->priv.
      But we cann't kill netdev->priv, because so many drivers reference to it
      directly.
      
      This patch is a safe convert for netdev->priv to netdev_priv(netdev).
      Since all of the netdev->priv is only for read.
      But it is too big to be sent in one mail.
      I split it to 4 parts and make every part smaller than 100,000 bytes,
      which is max size allowed by vger.
      Signed-off-by: NWang Chen <wangchen@cn.fujitsu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      454d7c9b
  13. 06 11月, 2008 2 次提交
    • J
      bonding: alternate agg selection policies for 802.3ad · fd989c83
      Jay Vosburgh 提交于
      	This patch implements alternative aggregator selection policies
      for 802.3ad.  The existing policy, now termed "stable," selects the active
      aggregator by greatest bandwidth, and only reselects a new aggregator
      if the active aggregator is entirely disabled (no more ports or all ports
      down).
      
      	This patch adds two new policies: bandwidth and count, selecting
      the active aggregator by total bandwidth (like the stable policy) or by
      the number of ports in the aggregator, respectively.  These two policies
      also differ from the stable policy in that they will reselect the active
      aggregator when availability-related changes occur in the bond (e.g.,
      link state change).
      
      	This permits "gang failover" within 802.3ad, allowing redundant
      aggregators along parallel paths to always maintain the "best" aggregator
      as the active aggregator (rather than having to wait for the active to
      entirely fail).
      
      	This patch also updates the driver version to 3.5.0.
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      fd989c83
    • B
      bonding: send IPv6 neighbor advertisement on failover · 305d552a
      Brian Haley 提交于
      This patch adds better IPv6 failover support for bonding devices,
      especially when in active-backup mode and there are only IPv6 addresses
      configured, as reported by Alex Sidorenko.
      
      - Creates a new file, net/drivers/bonding/bond_ipv6.c, for the
         IPv6-specific routines.  Both regular bonds and VLANs over bonds
         are supported.
      
      - Adds a new tunable, num_unsol_na, to limit the number of unsolicited
         IPv6 Neighbor Advertisements that are sent on a failover event.
         Default is 1.
      
      - Creates two new IPv6 neighbor discovery functions:
      
         ndisc_build_skb()
         ndisc_send_skb()
      
         These were required to support VLANs since we have to be able to
         add the VLAN id to the skb since ndisc_send_na() and friends
         shouldn't be asked to do this.  These two routines are basically
         __ndisc_send() split into two pieces, in a slightly different order.
      
      - Updates Documentation/networking/bonding.txt and bumps the rev of bond
         support to 3.4.0.
      
      On failover, this new code will generate one packet:
      
      - An unsolicited IPv6 Neighbor Advertisement, which helps the switch
         learn that the address has moved to the new slave.
      
      Testing has shown that sending just the NA results in pretty good
      behavior when in active-back mode, I saw no lost ping packets for example.
      Signed-off-by: NBrian Haley <brian.haley@hp.com>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      305d552a
  14. 04 11月, 2008 1 次提交
  15. 31 10月, 2008 3 次提交
  16. 30 10月, 2008 1 次提交
  17. 28 10月, 2008 1 次提交
  18. 23 10月, 2008 1 次提交
    • H
      net: Fix disjunct computation of netdev features · b63365a2
      Herbert Xu 提交于
      My change
      
          commit e2a6b852
          net: Enable TSO if supported by at least one device
      
      didn't do what was intended because the netdev_compute_features
      function was designed for conjunctions.  So what happened was that
      it would simply take the TSO status of the last constituent device.
      
      This patch extends it to support both conjunctions and disjunctions
      under the new name of netdev_increment_features.
      
      It also adds a new function netdev_fix_features which does the
      sanity checking that usually occurs upon registration.  This ensures
      that the computation doesn't result in an illegal combination
      since this checking is absent when the change is initiated via
      ethtool.
      
      The two users of netdev_compute_features have been converted.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b63365a2
  19. 25 9月, 2008 1 次提交
  20. 03 9月, 2008 1 次提交
  21. 07 8月, 2008 1 次提交
    • J
      bonding: refactor mii monitor · f0c76d61
      Jay Vosburgh 提交于
      	Refactor mii monitor.  As with the previous ARP monitor refactor,
      the motivation for this is to handle locking rationally (in this case,
      removing conditional locking) and generally clean up the code.
      
      	This patch breaks up the monolithic mii monitor into two phases:
      an inspection phase, followed by an optional commit phase.  The commit phase
      is the only portion that requires RTNL or makes changes to state, and is
      only called when inspection finds something to change.
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      f0c76d61
  22. 23 7月, 2008 1 次提交
  23. 18 7月, 2008 1 次提交
    • D
      netdev: Allocate multiple queues for TX. · e8a0464c
      David S. Miller 提交于
      alloc_netdev_mq() now allocates an array of netdev_queue
      structures for TX, based upon the queue_count argument.
      
      Furthermore, all accesses to the TX queues are now vectored
      through the netdev_get_tx_queue() and netdev_for_each_tx_queue()
      interfaces.  This makes it easy to grep the tree for all
      things that want to get to a TX queue of a net device.
      
      Problem spots which are not really multiqueue aware yet, and
      only work with one queue, can easily be spotted by grepping
      for all netdev_get_tx_queue() calls that pass in a zero index.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e8a0464c
  24. 15 7月, 2008 3 次提交
  25. 09 7月, 2008 1 次提交
  26. 18 6月, 2008 4 次提交
    • J
      bonding: Allow setting max_bonds to zero · b8a9787e
      Jay Vosburgh 提交于
      	Permit bonding to function rationally if max_bonds is set to
      zero.  This will load the module, but create no master devices (which can
      be created via sysfs).
      
      	Requires some change to bond_create_sysfs; currently, the
      netdev sysfs directory is determined from the first bonding device created,
      but this is no longer possible.  Instead, an interface from net/core is
      created to create and destroy files in net_class.
      
      	Based on a patch submitted by Phil Oester <kernel@linuxaces.com>.
      Modified by Jay Vosburgh to fix the sysfs issue mentioned above and to
      update the documentation.
      Signed-off-by: NPhil Oester <kernel@linuxace.com>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      b8a9787e
    • J
      bonding: Rework / fix multiple gratuitous ARP support · b59f9f74
      Jay Vosburgh 提交于
      	Support for sending multiple gratuitous ARPs during failovers
      was added by commit:
      
      commit 7893b249
      Author: Moni Shoua <monis@voltaire.com>
      Date:   Sat May 17 21:10:12 2008 -0700
      
          bonding: Send more than one gratuitous ARP when slave takes over
      
      	This change modifies that support to remove duplicated code,
      add support for ARP monitor (the original only supported miimon), clear
      the grat ARP counter in bond_close (lest a later "ifconfig up" immediately
      start spewing ARPs), and add documentation for the module parameter.
      
      	Also updated driver version to 3.3.0.
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      b59f9f74
    • O
      bonding: deliver netdev event for fail-over under the active-backup mode · 01f3109d
      Or Gerlitz 提交于
      under active-backup mode and when there's actual new_active slave,
      have bond_change_active_slave() call the networking core to deliver
      NETDEV_BONDING_FAILOVER event such that the fail-over can be notable
      by code outside of the bonding driver such as the RDMA stack and
      monitoring tools.
      
      As the correct context of locking appropriate for notifier calls is RTNL
      and nothing else, bond->curr_slave_lock and bond->lock are unlocked and
      later locked again. This is ensured by the rest of the code to be safe
      under backup-mode AND when new_active is not NULL.
      
      Jay Vosburgh modified the original patch for formatting and fixed a
      compiler error.
      Signed-off-by: NOr Gerlitz <ogerlitz@voltaire.com>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      01f3109d
    • O
      bonding: bond_change_active_slave() cleanup under active-backup · 709f8a45
      Or Gerlitz 提交于
      simplified the code of bond_change_active_slave() such that under
      active-backup mode there's one "if (new_active)" test and the rest
      of the code only does extra checks on top of it. This removed an
      unneeded "if (bond->send_grat_arp > 0)" check and avoid calling
      bond_send_gratuitous_arp when there's no active slave.
      
      Jay Vosburgh made minor coding style changes to the orignal patch.
      Signed-off-by: NOr Gerlitz <ogerlitz@voltaire.com>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      709f8a45