#12 Configure multiple bonds with differing parameters on RHEL 4

open
nobody
None
5
2006-04-29
2006-04-29
Anonymous
No

It seems that RH/Fedora kernels which doesn't support
the modprobe.conf example in the the bonding driver
howto works with the settings below:
==
install bond0 /sbin/modprobe bonding -o bond0 mode=1
miimon=100 primary=eth0 primary=eth1
install bond0 /sbin/modprobe bonding -o bond0 mode=1
miimon=100 primary=eth0 primary=eth3

Discussion

  • Arnd
    Arnd
    2006-08-25

    Logged In: YES
    user_id=1583773

    This problem still remains. Even on Gentoo with a compiled
    gentoo-kernel (or vanilla-sources 2.6.18). The settings
    mentioned above are no solution here. It is not possible to
    load the bonding-module more than one times. Renaming works:

    server / # modprobe -c | grep bond
    server / # modprobe bonding -o bond111 mode=1 miimon=100
    server / # lsmod | grep bond
    bond111 80208 0
    server / # modprobe bonding -o bond112 mode=1 miimon=123
    server / # lsmod | grep bond
    bond111 80208 0
    server / # ls -l /proc/net/bonding/
    total 0
    -r--r--r-- 1 root root 0 Aug 25 14:32 bond0

    server / #

    server / # uname -r

    2.6.17-gentoo-r4

    dmesg-output for these two commands:
    ...
    Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006)
    bonding: MII link monitoring set to 100 ms
    Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006)
    bonding: MII link monitoring set to 123 ms

     
  • Logged In: NO

    The problem still not resolved in 2.6.19

    I was able to load multiple bonding driver instances with modprobe -o and assign different parameters in 2.6.10.

    Currently, only the first time modprobe bonding -o bondingX is done, the driver is fully loaded, proc structure created, etc. However printk output looks correct each time.

    Not sure whether it's kernel or bonding issue. It would be nice to be able to configure two different devices with different parameters, whether it's accomplished with one or two driver instances.

     
  • Logged In: NO

    This was from the file bond_main.c, before it was removed from the source file to clean the code (see git commit http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=2e06cb5859fdaeba0529806eb1bf161ffd0db201\):
    * 2001/8/05 - Janice Girouard <girouard at us.ibm.com>
    * - correct problem where refcnt of slave is not incremented in bond_ioctl
    * so the system hangs when halting.
    * - correct locking problem when unable to malloc in bond_enslave.
    * - adding bond_xmit_xor logic.
    * - adding multiple bond device support.

    This comment hit the kernel with patch 2.4.15, dated 2001-11-23, so I suppose the code to implement that functionality arrived at more or less the same time to the mainline linux kernel.

    Fast forward to 2.6.19, and this doesn't work. Although you get a message in the logs saying is ok, second and later bonding module loads neither they create the files under /proc, nor give a usable device (bond1 and so on).

     
  • Logged In: NO

    from bonding_init():

    for (i = 0; i < max_bonds; i++) {
    sprintf(new_bond_name, "bond%d",i);
    res = bond_create(new_bond_name,&bonding_defaults, NULL);
    if (res)
    goto err;
    }

    so, each time you try to initialize a new bonding module, it tries to get bond0 interface name and if you already have bonding loaded, fail and remove the module.

    i casually tried to change the code to keep trying with other device names but then had trouble with module unloading and concluded that propably a more thorough change is needed. i can't remember if the second module actually worked or not.. :)

     
  • Logged In: NO

    This is a patch for 2.6.19.2 (i recall it was exactly the same for 2.6.16.20). I tried it and this time there were no problems with module unloading and it even seemed to work (I could use the new bonding devices to ping other machines).

    The bonding device started to respond to pinging rather slowly (from the time it was brought up), but that could be a problem with the switches or arp or something similar.

    Fishier is the fact that i needed to do

    modprobe bonding -o bond1 min_bond=1 miimon=100

    TWICE before the module was loaded and network interface appeared. So I guess (re)enabling the multiple load support could require more changes elsewhere in the code.

    --- linux-2.6.19.2_vanilla/drivers/net/bonding/bond_main.c 2007-01-10 21:10:37.000000000 +0200
    +++ linux-2.6.19.2/drivers/net/bonding/bond_main.c 2007-02-07 16:29:08.980473696 +0200
    @@ -86,6 +86,7 @@
    #define BOND_LINK_ARP_INTERV 0

    static int max_bonds = BOND_DEFAULT_MAX_BONDS;
    +static int min_bond = 0;
    static int miimon = BOND_LINK_MON_INTERV;
    static int updelay = 0;
    static int downdelay = 0;
    @@ -101,6 +102,8 @@

    module_param(max_bonds, int, 0);
    MODULE_PARM_DESC(max_bonds, "Max number of bonded devices");
    +module_param(min_bond, int, 0);
    +MODULE_PARM_DESC(min_bond, "Starting interface number for created device(s)");
    module_param(miimon, int, 0);
    MODULE_PARM_DESC(miimon, "Link check interval in milliseconds");
    module_param(updelay, int, 0);
    @@ -4460,6 +4463,14 @@
    max_bonds = BOND_DEFAULT_MAX_BONDS;
    }

    + if (min_bond < 0 || min_bond + max_bonds > INT_MAX) {
    + printk(KERN_WARNING DRV_NAME
    + ": Warning: min_bond (%d) not in range %d-%d, so it "
    + "was reset to 0\n",
    + min_bond, 0, INT_MAX - max_bonds + 1);
    + min_bond = 0;
    + }
    +
    if (miimon < 0) {
    printk(KERN_WARNING DRV_NAME
    ": Warning: miimon module parameter (%d), "
    @@ -4766,7 +4777,7 @@
    #ifdef CONFIG_PROC_FS
    bond_create_proc_dir();
    #endif
    - for (i = 0; i < max_bonds; i++) {
    + for (i = min_bond; i < min_bond + max_bonds; i++) {
    sprintf(new_bond_name, "bond%d",i);
    res = bond_create(new_bond_name,&bonding_defaults, NULL);
    if (res)

     
  • Jay Vosburgh
    Jay Vosburgh
    2007-02-07

    Logged In: YES
    user_id=579170
    Originator: NO

    This was apparently a problem with the sysfs support in bonding. This problem has been fixed in the mainline as of bonding version 3.1.2 (January 20, 2007).