05 Dec, 2006

1 commit

  • This is a small fix-up to finish out the work done by Jay Vosburgh to add
    carrier-state support for bonding devices. The output in
    /proc/net/bonding/bondX was correct, but when collecting the same info via
    an iotcl it could still be incorrect.

    Signed-off-by: Andy Gospodarek
    Cc: Jeff Garzik
    Cc: Stephen Hemminger
    Signed-off-by: Andrew Morton
    Signed-off-by: Jeff Garzik

    Andy Gospodarek
     

30 Nov, 2006

1 commit


11 Nov, 2006

1 commit


05 Oct, 2006

1 commit

  • In bond_alb_monitor the bond->curr_slave_lock write lock is taken
    and then dev_set_promiscuity maybe called which can take some time,
    depending on the network HW. If a network IRQ for this card come in
    the softirq handler maybe try to deliver more packets which end up in
    a request to the read lock of bond->curr_slave_lock -> deadlock.
    This issue was found by a test lab during network stress tests, this patch
    disable the softirq handler for this case and solved the issue.

    Signed-off-by: Karsten Keil
    Acked-by: Jay Vosburgh
    Signed-off-by: Jeff Garzik

    Karsten Keil
     

29 Sep, 2006

1 commit

  • ifa_local, ifa_address, ifa_mask, ifa_broadcast and ifa_anycast are
    net-endian. Annotated them and variables that are inferred to be
    net-endian.

    Signed-off-by: Al Viro
    Signed-off-by: David S. Miller

    Al Viro
     

28 Sep, 2006

1 commit


26 Sep, 2006

10 commits

  • At enslavement time, the primary slave might not be activated if
    there is already an active slave and the new slave is the primary.
    Replaced complicated logic with a call to bond_select_active_slave(),
    which does the right thing.

    Fixes http://bugzilla.kernel.org/show_bug.cgi?id=6378

    Signed-off-by: Jay Vosburgh
    Signed-off-by: Jeff Garzik

    Jay Vosburgh
     
  • Fixed handling of 802.3ad LACPDUs. Do not byte swap data in
    place in the packet. Updated nomenclature of "__ntohs_lacpdu" to be
    "htons"; it was previously used for both ntohs and htons operations, but
    only called ntohs functions.

    Signed-off-by: Jay Vosburgh
    Signed-off-by: Jeff Garzik

    Jay Vosburgh
     
  • Add logic to check ARP request / reply packets used for ARP
    monitor link integrity checking.

    The current method simply examines the slave device to see if it
    has sent and received traffic; this can be fooled by extraneous traffic.
    For example, if multiple hosts running bonding are behind a common
    switch, the probe traffic from the multiple instances of bonding will
    update the tx/rx times on each other's slave devices.

    Signed-off-by: Jay Vosburgh
    Signed-off-by: Jeff Garzik

    Jay Vosburgh
     
  • When a bonding netdevice is admin-ed down it loses the slaves
    attributes (set via ifenslave). This is not consistent with other
    behavior of netdevices (example a qdisc attached to a netdevice doesnt
    disappear or an attached IP address etc).
    The included patch fixes this. Ive tested by ifenslaving, downing the
    bond, checking /proc and making sure it still has the slaves, up-ing the
    bond and making sure things continue to work.

    Jay/Bonding folks if you are ok with it, just ACK it or include it in
    your tree etc. Otherwise we can discuss.

    Acked-by: Jay Vosburgh

    Signed-off-by: Jeff Garzik

    jamal
     
  • Add priv_flag to specifically identify bonding-involved devices. Needed
    because IFF_MASTER is an unreliable identifier (vlan interfaces above bonding
    will inherit IFF_MASTER). Misidentification of devices would cause
    notifier events for other devices to be erroneously processed by bonding,
    causing various havoc.

    Bug discovered by Martin Papik ; this patch is
    modified from his original.

    Signed-off-by: Martin Papik
    Signed-off-by: Jay Vosburgh
    Signed-off-by: Jeff Garzik

    Jay Vosburgh
     
  • The bonding driver fails to adjust its hard_header_len when enslaving
    interfaces. Whenever an interface with a hard_header_len greater than the
    ETH_HLEN default is enslaved, the potential for an oops exists, and if the
    oops happens while responding to an arp request, for example, the system
    panics. GIANFAR devices may use an extended hard_header for VLAN or
    hardware checksumming. Enslaving such a device and then transmitting over
    it causes a kernel panic.

    Patch modified from submitter's original, but submitter agreed with this
    patch in private email.

    Signed-off-by: Mark Huth
    Signed-off-by: Jay Vosburgh
    Signed-off-by: Jeff Garzik

    Jay Vosburgh
     
  • Remove unneeded test for NULL. Reported by Thomas Dillig
    and Isil Dillig via Stephen
    Hemminger .

    Signed-off-by: Jay Vosburgh
    Signed-off-by: Jeff Garzik

    Jay Vosburgh
     
  • Though link_failure_count is type unsigned int, this value is outputted to
    /proc/net/bonding/bondX file using "%d" instead of "%u".

    The attached patch fixes this problem.

    Signed-off-by: Kenzo Iwami
    Acked-by: Jay Vosburgh
    Signed-off-by: Jeff Garzik

    Kenzo Iwami
     
  • The value of "downdelay/miimon" and "updelay/miimon" are stored in
    slave->delay. The type of downdelay, updelay, and miimon are all int.
    However, slave->delay is type short, and it is not possible to store the
    value of "downdelay/miimon" or "updelay/miimon" in some cases. (For example,
    miimon=1 downdelay=32768)

    The attached patch fixes this problem.

    Signed-off-by: Kenzo Iwami
    Acked-by: Jay Vosburgh
    Signed-off-by: Jeff Garzik

    Jay Vosburgh
     
  • Allow channel bonding to enslave a 10 Gig adapter without errors.

    Signed-off-by: Mitch Williams
    Acked-by: Jay Vosburgh
    Signed-off-by: Jeff Garzik

    Jay Vosburgh
     

14 Sep, 2006

1 commit


01 Jul, 2006

1 commit


18 Jun, 2006

2 commits

  • The current stack treats NETIF_F_HW_CSUM and NETIF_F_NO_CSUM
    identically so we test for them in quite a few places. For the sake
    of brevity, I'm adding the macro NETIF_F_GEN_CSUM for these two. We
    also test the disjunct of NETIF_F_IP_CSUM and the other two in various
    places, for that purpose I've added NETIF_F_ALL_CSUM.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • Various drivers use xmit_lock internally to synchronise with their
    transmission routines. They do so without setting xmit_lock_owner.
    This is fine as long as netpoll is not in use.

    With netpoll it is possible for deadlocks to occur if xmit_lock_owner
    isn't set. This is because if a printk occurs while xmit_lock is held
    and xmit_lock_owner is not set can cause netpoll to attempt to take
    xmit_lock recursively.

    While it is possible to resolve this by getting netpoll to use
    trylock, it is suboptimal because netpoll's sole objective is to
    maximise the chance of getting the printk out on the wire. So
    delaying or dropping the message is to be avoided as much as possible.

    So the only alternative is to always set xmit_lock_owner. The
    following patch does this by introducing the netif_tx_lock family of
    functions that take care of setting/unsetting xmit_lock_owner.

    I renamed xmit_lock to _xmit_lock to indicate that it should not be
    used directly. I didn't provide irq versions of the netif_tx_lock
    functions since xmit_lock is meant to be a BH-disabling lock.

    This is pretty much a straight text substitution except for a small
    bug fix in winbond. It currently uses
    netif_stop_queue/spin_unlock_wait to stop transmission. This is
    unsafe as an IRQ can potentially wake up the queue. So it is safer to
    use netif_tx_disable.

    The hamradio bits used spin_lock_irq but it is unnecessary as
    xmit_lock must never be taken in an IRQ handler.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

30 Mar, 2006

1 commit

  • Add support for the bonding master to specify its carrier state
    based upon the state of the slaves. For 802.3ad, the bond is up if
    there is an active, parterned aggregator. For other modes, the bond is
    up if any slaves are up. Updates driver version to 3.0.3.

    Based on a patch by jamal .

    Signed-off-by: Jay Vosburgh
    Signed-off-by: Jeff Garzik

    Jay Vosburgh
     

28 Mar, 2006

1 commit

  • The kernel's implementation of notifier chains is unsafe. There is no
    protection against entries being added to or removed from a chain while the
    chain is in use. The issues were discussed in this thread:

    http://marc.theaimsgroup.com/?l=linux-kernel&m=113018709002036&w=2

    We noticed that notifier chains in the kernel fall into two basic usage
    classes:

    "Blocking" chains are always called from a process context
    and the callout routines are allowed to sleep;

    "Atomic" chains can be called from an atomic context and
    the callout routines are not allowed to sleep.

    We decided to codify this distinction and make it part of the API. Therefore
    this set of patches introduces three new, parallel APIs: one for blocking
    notifiers, one for atomic notifiers, and one for "raw" notifiers (which is
    really just the old API under a new name). New kinds of data structures are
    used for the heads of the chains, and new routines are defined for
    registration, unregistration, and calling a chain. The three APIs are
    explained in include/linux/notifier.h and their implementation is in
    kernel/sys.c.

    With atomic and blocking chains, the implementation guarantees that the chain
    links will not be corrupted and that chain callers will not get messed up by
    entries being added or removed. For raw chains the implementation provides no
    guarantees at all; users of this API must provide their own protections. (The
    idea was that situations may come up where the assumptions of the atomic and
    blocking APIs are not appropriate, so it should be possible for users to
    handle these things in their own way.)

    There are some limitations, which should not be too hard to live with. For
    atomic/blocking chains, registration and unregistration must always be done in
    a process context since the chain is protected by a mutex/rwsem. Also, a
    callout routine for a non-raw chain must not try to register or unregister
    entries on its own chain. (This did happen in a couple of places and the code
    had to be changed to avoid it.)

    Since atomic chains may be called from within an NMI handler, they cannot use
    spinlocks for synchronization. Instead we use RCU. The overhead falls almost
    entirely in the unregister routine, which is okay since unregistration is much
    less frequent that calling a chain.

    Here is the list of chains that we adjusted and their classifications. None
    of them use the raw API, so for the moment it is only a placeholder.

    ATOMIC CHAINS
    -------------
    arch/i386/kernel/traps.c: i386die_chain
    arch/ia64/kernel/traps.c: ia64die_chain
    arch/powerpc/kernel/traps.c: powerpc_die_chain
    arch/sparc64/kernel/traps.c: sparc64die_chain
    arch/x86_64/kernel/traps.c: die_chain
    drivers/char/ipmi/ipmi_si_intf.c: xaction_notifier_list
    kernel/panic.c: panic_notifier_list
    kernel/profile.c: task_free_notifier
    net/bluetooth/hci_core.c: hci_notifier
    net/ipv4/netfilter/ip_conntrack_core.c: ip_conntrack_chain
    net/ipv4/netfilter/ip_conntrack_core.c: ip_conntrack_expect_chain
    net/ipv6/addrconf.c: inet6addr_chain
    net/netfilter/nf_conntrack_core.c: nf_conntrack_chain
    net/netfilter/nf_conntrack_core.c: nf_conntrack_expect_chain
    net/netlink/af_netlink.c: netlink_chain

    BLOCKING CHAINS
    ---------------
    arch/powerpc/platforms/pseries/reconfig.c: pSeries_reconfig_chain
    arch/s390/kernel/process.c: idle_chain
    arch/x86_64/kernel/process.c idle_notifier
    drivers/base/memory.c: memory_chain
    drivers/cpufreq/cpufreq.c cpufreq_policy_notifier_list
    drivers/cpufreq/cpufreq.c cpufreq_transition_notifier_list
    drivers/macintosh/adb.c: adb_client_list
    drivers/macintosh/via-pmu.c sleep_notifier_list
    drivers/macintosh/via-pmu68k.c sleep_notifier_list
    drivers/macintosh/windfarm_core.c wf_client_list
    drivers/usb/core/notify.c usb_notifier_list
    drivers/video/fbmem.c fb_notifier_list
    kernel/cpu.c cpu_chain
    kernel/module.c module_notify_list
    kernel/profile.c munmap_notifier
    kernel/profile.c task_exit_notifier
    kernel/sys.c reboot_notifier_list
    net/core/dev.c netdev_chain
    net/decnet/dn_dev.c: dnaddr_chain
    net/ipv4/devinet.c: inetaddr_chain

    It's possible that some of these classifications are wrong. If they are,
    please let us know or submit a patch to fix them. Note that any chain that
    gets called very frequently should be atomic, because the rwsem read-locking
    used for blocking chains is very likely to incur cache misses on SMP systems.
    (However, if the chain's callout routines may sleep then the chain cannot be
    atomic.)

    The patch set was written by Alan Stern and Chandra Seetharaman, incorporating
    material written by Keith Owens and suggestions from Paul McKenney and Andrew
    Morton.

    [jes@sgi.com: restructure the notifier chain initialization macros]
    Signed-off-by: Alan Stern
    Signed-off-by: Chandra Seetharaman
    Signed-off-by: Jes Sorensen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Stern
     

04 Mar, 2006

3 commits


18 Feb, 2006

1 commit


07 Feb, 2006

2 commits


27 Jan, 2006

1 commit


13 Jan, 2006

1 commit

  • I believe I see the race Michael refers to (tlb_choose_channel
    may set head, which tlb_init_slave clears), although I was not able to
    reproduce it. I have updated his patch for the current netdev-2.6.git
    tree and added a version update. His original comment follows:

    Our systems have been crashing during testing of PCI HotPlug
    support in the various networking components. We've faulted in
    the bonding driver due to a bug in bond_alb.c:tlb_clear_slave()

    In that routine, the last modification to the TLB hash table is
    made without protection of the lock, allowing a race that can lead
    tlb_choose_channel() to select an invalid table element.

    -J

    Signed-off-by: Jeff Garzik

    Jay Vosburgh
     

09 Jan, 2006

1 commit


29 Nov, 2005

1 commit


14 Nov, 2005

8 commits