26 May, 2011

2 commits

  • Improves the documentation about how IGMP resend parameter
    works, fix two missing checks and coding style issues.

    Signed-off-by: Flavio Leitner
    Acked-by: Rick Jones
    Signed-off-by: David S. Miller

    Flavio Leitner
     
  • This soft lockup was recently reported:

    [root@dell-per715-01 ~]# echo +bond5 > /sys/class/net/bonding_masters
    [root@dell-per715-01 ~]# echo +eth1 > /sys/class/net/bond5/bonding/slaves
    bonding: bond5: doing slave updates when interface is down.
    bonding bond5: master_dev is not up in bond_enslave
    [root@dell-per715-01 ~]# echo -eth1 > /sys/class/net/bond5/bonding/slaves
    bonding: bond5: doing slave updates when interface is down.

    BUG: soft lockup - CPU#12 stuck for 60s! [bash:6444]
    CPU 12:
    Modules linked in: bonding autofs4 hidp rfcomm l2cap bluetooth lockd sunrpc
    be2d
    Pid: 6444, comm: bash Not tainted 2.6.18-262.el5 #1
    RIP: 0010:[] []
    .text.lock.spinlock+0x26/00
    RSP: 0018:ffff810113167da8 EFLAGS: 00000286
    RAX: ffff810113167fd8 RBX: ffff810123a47800 RCX: 0000000000ff1025
    RDX: 0000000000000000 RSI: ffff810123a47800 RDI: ffff81021b57f6f8
    RBP: ffff81021b57f500 R08: 0000000000000000 R09: 000000000000000c
    R10: 00000000ffffffff R11: ffff81011d41c000 R12: ffff81021b57f000
    R13: 0000000000000000 R14: 0000000000000282 R15: 0000000000000282
    FS: 00002b3b41ef3f50(0000) GS:ffff810123b27940(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 00002b3b456dd000 CR3: 000000031fc60000 CR4: 00000000000006e0

    Call Trace:
    [] _spin_lock_bh+0x9/0x14
    [] :bonding:tlb_clear_slave+0x22/0xa1
    [] :bonding:bond_alb_deinit_slave+0xba/0xf0
    [] :bonding:bond_release+0x1b4/0x450
    [] __down_write_nested+0x12/0x92
    [] :bonding:bonding_store_slaves+0x25c/0x2f7
    [] sysfs_write_file+0xb9/0xe8
    [] vfs_write+0xce/0x174
    [] sys_write+0x45/0x6e
    [] tracesys+0xd5/0xe0

    It occurs because we are able to change the slave configuarion of a bond while
    the bond interface is down. The bonding driver initializes some data structures
    only after its ndo_open routine is called. Among them is the initalization of
    the alb tx and rx hash locks. So if we add or remove a slave without first
    opening the bond master device, we run the risk of trying to lock/unlock a
    spinlock that has garbage for data in it, which results in our above softlock.

    Note that sometimes this works, because in many cases an unlocked spinlock has
    the raw_lock parameter initialized to zero (meaning that the kzalloc of the
    net_device private data is equivalent to calling spin_lock_init), but thats not
    true in all cases, and we aren't guaranteed that condition, so we need to pass
    the relevant spinlocks through the spin_lock_init function.

    Fix it by moving the spin_lock_init calls for the tx and rx hashtable locks to
    the ndo_init path, so they are ready for use by the bond_store_slaves path.

    Change notes:
    v2) Based on conversation with Jay and Nicolas it seems that the ability to
    enslave devices while the bond master is down should be safe to do. As such
    this is an outlier bug, and so instead we'll just initalize the errant spinlocks
    in the init path rather than the open path, solving the problem. We'll also
    remove the warnings about the bond being down during enslave operations, since
    it should be safe

    v3) Fix spelling error

    Signed-off-by: Neil Horman
    Reported-by: jtluka@redhat.com
    CC: Jay Vosburgh
    CC: Andy Gospodarek
    CC: nicolas.2p.debian@gmail.com
    CC: "David S. Miller"
    Signed-off-by: Jay Vosburgh
    Signed-off-by: David S. Miller

    Neil Horman
     

30 Apr, 2011

1 commit

  • For backward compatibility, we should retain the module parameters and
    sysfs attributes to control the number of peer notifications
    (gratuitous ARPs and unsolicited NAs) sent after bonding failover.
    Also, it is possible for failover to take place even though the new
    active slave does not have link up, and in that case the peer
    notification should be deferred until it does.

    Change ipv4 and ipv6 so they do not automatically send peer
    notifications on bonding failover.

    Change the bonding driver to send separate NETDEV_NOTIFY_PEERS
    notifications when the link is up, as many times as requested. Since
    it does not directly control which protocols send notifications, make
    num_grat_arp and num_unsol_na aliases for a single parameter. Bump
    the bonding version number and update its documentation.

    Signed-off-by: Ben Hutchings
    Signed-off-by: Jay Vosburgh
    Acked-by: Brian Haley
    Signed-off-by: David S. Miller

    Ben Hutchings
     

26 Apr, 2011

1 commit

  • Since now when bonding uses rx_handler, all traffic going into bond
    device goes thru bond_handle_frame. So there's no need to go back into
    bonding code later via ptype handlers. This patch converts
    original ptype handlers into "bonding receive probes". These functions
    are called from bond_handle_frame and they are registered per-mode.

    Note that vlan packets are also handled because they are always untagged
    thanks to vlan_untag()

    Note that this also allows arpmon for eth-bond-bridge-vlan topology.

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     

18 Apr, 2011

1 commit


17 Mar, 2011

3 commits


16 Mar, 2011

1 commit

  • When the bonding module is loaded, it creates bond0 by default.
    Then, when attempting to create bond0, the following messages
    are printed to syslog:

    kernel: bonding: bond0 is being created...
    kernel: bonding: Bond creation failed.

    Which seems to indicate a problem, when in reality there is no
    problem. Since the actual error code is passed down from bond_create,
    make use of it to print a bit less ominous message:

    kernel: bonding: bond0 is being created...
    kernel: bond0 already exists.

    Signed-off-by: Phil Oester
    Signed-off-by: Andy Gospodarek
    Signed-off-by: David S. Miller

    Phil Oester
     

26 Jan, 2011

1 commit


18 Oct, 2010

1 commit

  • The monitoring paths in the bonding driver take write locks that are shared by
    the tx path. If netconsole is in use, these paths can call printk which puts us
    in the netpoll tx path, which, if netconsole is attached to the bonding driver,
    result in deadlock (the xmit_lock guards are useless in netpoll_send_skb, as the
    monitor paths in the bonding driver don't claim the xmit_lock, nor should they).
    The solution is to use a per cpu flag internal to the driver to indicate when a
    cpu is holding the lock in a path that might recusrse into the tx path for the
    driver via netconsole. By checking this flag on transmit, we can defer the
    sending of the netconsole frames until a later time using the retransmit feature
    of netpoll_send_skb that is triggered on the return code NETDEV_TX_BUSY. I've
    tested this and am able to transmit via netconsole while causing failover
    conditions on the bond slave links.

    Signed-off-by: Neil Horman
    Signed-off-by: David S. Miller

    Neil Horman
     

06 Oct, 2010

1 commit


31 Jul, 2010

1 commit

  • When using module options arp monitoring and balance-alb/balance-tlb
    are mutually exclusive options. Anytime balance-alb/balance-tlb are
    enabled mii monitoring is forced to 100ms if not set. When configuring
    via sysfs no checking is currently done.

    Handling these cases with sysfs has to be done a bit differently because
    we do not have all configuration information available at once. This
    patch will not allow a mode change to balance-alb/balance-tlb if
    arp_interval is already non-zero. It will also not allow the user to
    set a non-zero arp_interval value if the mode is already set to
    balance-alb/balance-tlb. They are still mutually exclusive on a
    first-come, first serve basis.

    Tested with initscripts on Fedora and manual setting via sysfs.

    Signed-off-by: Andy Gospodarek
    Signed-off-by: Jay Vosburgh
    Signed-off-by: David S. Miller

    Andy Gospodarek
     

15 Jul, 2010

1 commit


05 Jun, 2010

2 commits

  • v2: changed bonding module version, modified to apply on top of changes
    from previous patch in series, and updated documentation to elaborate on
    multiqueue awareness that now exists in bonding driver.

    This patch give the user the ability to control the output slave for
    round-robin and active-backup bonding. Similar functionality was
    discussed in the past, but Jay Vosburgh indicated he would rather see a
    feature like this added to existing modes rather than creating a
    completely new mode. Jay's thoughts as well as Neil's input surrounding
    some of the issues with the first implementation pushed us toward a
    design that relied on the queue_mapping rather than skb marks.
    Round-robin and active-backup modes were chosen as the first users of
    this slave selection as they seemed like the most logical choices when
    considering a multi-switch environment.

    Round-robin mode works without any modification, but active-backup does
    require inclusion of the first patch in this series and setting
    the 'all_slaves_active' flag. This will allow reception of unicast traffic on
    any of the backup interfaces.

    This was tested with IPv4-based filters as well as VLAN-based filters
    with good results.

    More information as well as a configuration example is available in the
    patch to Documentation/networking/bonding.txt.

    Signed-off-by: Andy Gospodarek
    Signed-off-by: Neil Horman
    Signed-off-by: David S. Miller

    Andy Gospodarek
     
  • v2: changed parameter name from 'keep_all' to 'all_slaves_active' and
    skipped setting slaves to inactive rather than creating a new flag at
    Jay's suggestion.

    In an effort to suppress duplicate frames on certain bonding modes
    (specifically the modes that do not require additional configuration on
    the switch or switches connected to the host), code was added in the
    generic receive patch in 2.6.16. The current behavior works quite well
    for most users, but there are some times it would be nice to restore old
    functionality and allow all frames to make their way up the stack.

    This patch adds support for a new module option and sysfs file called
    'all_slaves_active' that will restore pre-2.6.16 functionality if the
    user desires. The default value is '0' and retains existing behavior,
    but the user can set it to '1' and allow all frames up if desired.

    Signed-off-by: Andy Gospodarek
    Signed-off-by: Jay Vosburgh
    Signed-off-by: Neil Horman
    Signed-off-by: David S. Miller

    Andy Gospodarek
     

02 Jun, 2010

5 commits


08 Mar, 2010

1 commit

  • Passing the attribute to the low level IO functions allows all kinds
    of cleanups, by sharing low level IO code without requiring
    an own function for every piece of data.

    Also drivers can extend the attributes with own data fields
    and use that in the low level function.

    This makes the class attributes the same as sysdev_class attributes
    and plain attributes.

    This will allow further cleanups in drivers.

    Full tree sweep converting all users.

    Signed-off-by: Andi Kleen
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     

14 Dec, 2009

1 commit

  • Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
    Remove DRV_NAME from pr_s
    Consolidate long format strings
    Remove some extra tab indents
    Remove some unnecessary ()s from pr_s arguments
    Align pr_ arguments

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

19 Nov, 2009

1 commit


31 Oct, 2009

2 commits


12 Oct, 2009

1 commit


07 Oct, 2009

1 commit

  • 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: Jiri Pirko
    Signed-off-by: Jay Vosburgh
    Signed-off-by: David S. Miller

    Jiri Pirko
     

02 Oct, 2009

1 commit

  • Primary module parameter passed to bonding is pernament. That means if you
    release the primary slave and enslave it again, it becomes the primary slave
    again. But if you set primary slave via sysfs, the primary slave is only set
    once and it's not remembered in bond->params structure. Therefore the setting is
    lost after releasing the primary slave. This simple one-liner fixes this.

    Signed-off-by: Jiri Pirko
    Signed-off-by: Jay Vosburgh
    Signed-off-by: David S. Miller

    Jiri Pirko
     

14 Aug, 2009

1 commit


14 Jun, 2009

7 commits


11 Jun, 2009

1 commit

  • Some users still load bond module multiple times to create bonding
    devices. This accidentally was broken by a later patch about
    the time sysfs was fixed. According to Jay, it was broken
    by:
    commit b8a9787eddb0e4665f31dd1d64584732b2b5d051
    Author: Jay Vosburgh
    Date: Fri Jun 13 18:12:04 2008 -0700

    bonding: Allow setting max_bonds to zero

    Note: sysfs and procfs still produce WARN() messages when this is done
    so the sysfs method is the recommended API.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: Jay Vosburgh
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

19 May, 2009

1 commit

  • Sysfs files for a network device can not unconditionally take the
    rtnl_lock as the bonding sysfs files do. If someone accesses those
    sysfs files while the network device is being unregistered with the
    rtnl_lock held we will deadlock.

    So use trylock and restart_syscall to avoid this problem.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     

13 Apr, 2009

1 commit

  • Fix a zero address hole bug in the bonding arp_ip_target list
    that was causing the bond to ignore ARP replies (bugz 13006).
    Instead of just setting the array entry to zero, we now
    copy any additional entries down one slot, putting the
    zero entry at the end. With this change we can now have
    all the loops that walk the array stop when they hit a zero
    since there will be no addresses after it.

    Changes are based in part on code fragment provided in kernel:
    bugzilla 13006:

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

    by Steve Howard

    Signed-off-by: Brian Haley
    Signed-off-by: Jay Vosburgh
    Signed-off-by: David S. Miller

    Brian Haley