Re: PATCH: v2.3.50, bonding documentation update.. [CORRECTED PATCH!]

From: Thomas Davis (tadavis@lbl.gov)
Date: Thu Mar 09 2000 - 17:57:38 EST


Thomas Davis wrote:
>
> The attached file contains a patch to update the bonding documentation,
> and to place an entry in maintainer/credits files.
>
> I have also tested the driver, and verify it does work correctly in the
> test bed I have.
>
> Thanks!
>

I mucked it up.. I've corrected the patch, and attached it.

-- 
------------------------+--------------------------------------------------
Thomas Davis		| PDSF Project Leader
tadavis@lbl.gov		| 
(510) 486-4524		| "Only a petabyte of data this year?"

diff -ruN linux/CREDITS linux-2.3/CREDITS --- linux/CREDITS Thu Mar 2 11:17:32 2000 +++ linux-2.3/CREDITS Wed Mar 8 13:08:13 2000 @@ -513,6 +513,14 @@ S: Littleton, Massachusetts 01460 S: USA +N: Thomas Davis +E: tadavis@lbl.gov +D: Channel bonding driver +D: IrDA work (smc, dongles, /proc, and core protocol debugging) +S: NERSC/Lawrence Berkeley National Laboratory +S: 1 Cyclotron Rd, MS 50D +S: Berkeley, CA 94720 + N: Wayne Davison E: davison@borland.com D: Second extended file system co-designer diff -ruN linux/Documentation/Configure.help linux-2.3/Documentation/Configure.help --- linux/Documentation/Configure.help Thu Mar 9 13:29:57 2000 +++ linux-2.3/Documentation/Configure.help Wed Mar 8 11:22:50 2000 @@ -5760,6 +5760,18 @@ time, you need to compile this driver as a module. Instead of 'dummy', the devices will then be called 'dummy0', 'dummy1' etc. +Bonding driver support +CONFIG_BONDING + Say 'Y' or 'M' if you wish to be able to 'bond' multiple Ethernet + Channels together. This is called 'Etherchannel' by Cisco, 'Trunking' + by Sun, and 'Bonding' in Linux. More information on how bonding + works is in the Documentation/networking/bonding.txt file. + + If you want to compile this as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read Documentation/modules.txt. The module will be + called bonding.o. + SLIP (serial line) support CONFIG_SLIP Say Y if you intend to use SLIP or CSLIP (compressed SLIP) to diff -ruN linux/Documentation/networking/bonding.txt linux-2.3/Documentation/networking/bonding.txt --- linux/Documentation/networking/bonding.txt Wed Dec 31 16:00:00 1969 +++ linux-2.3/Documentation/networking/bonding.txt Thu Mar 9 13:39:42 2000 @@ -0,0 +1,127 @@ +Installation: + +Run make menuconfig/xconfig/config, and select 'bonding device' in +network devices. + +Build the new kernel/modules. + +Get update ifenslave.c. Current location is: + http://pdsf.nersc.gov/linux + +Install ifenslave.c; do: + gcc -O2 -o ifenslave ifenslave.c + cp ifenslave /sbin/ifenslave + +Modify /etc/conf.modules by adding the line: + alias bond0 bonding + +If you running a RH5.0 or newer distribution, you can do: + +cd /etc/sysconfig/network-scripts +cp ifcfg-eth0 ifcfg-bond0 +edit ifcfg-bond0, and make it look the following: + +DEVICE=bond0 +USERCTL=no +ONBOOT=yes +BOOTPROTO=none +BROADCAST=XXX.XXX.XXX.255 +NETWORK=XXX.XXX.XXX.0 +NETMASK=255.255.255.0 +IPADDR=XXX.XXX.XXX.XXX + +(put the approiate values for you network in where the XXX's are at.) + +Then, edit ifcfg-eth0/ifcfg-eth1 (and all the other slave devices), and make +them look like this: + +DEVICE=eth0 # <-- this is the slave device +USERCTL=no +ONBOOT=yes +MASTER=bond0 +SLAVE=yes +BOOTPROTO=none + +Reboot, and the network should come up bonded together. + +For other distributions, you need to do something like: + +/sbin/ifconfig bond0 addresss netmask xxx.xxx.xxx.xxx broadcast xxx.xxx.xxx.xxx up +/sbin/ifenslave bond0 eth0 +/sbin/ifenslave bond0 eth1 + +When properly configured, it will look this: + +[root]# /sbin/ifconfig +bond0 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4 + inet addr:XXX.XXX.XXX.YYY Bcast:XXX.XXX.XXX.255 Mask:255.255.252.0 + UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 + RX packets:7224794 errors:0 dropped:0 overruns:0 frame:0 + TX packets:3286647 errors:1 dropped:0 overruns:1 carrier:0 + collisions:0 txqueuelen:0 + +eth0 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4 + inet addr:XXX.XXX.XXX.YYY Bcast:XXX.XXX.XXX.255 Mask:255.255.252.0 + UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 + RX packets:3573025 errors:0 dropped:0 overruns:0 frame:0 + TX packets:1643167 errors:1 dropped:0 overruns:1 carrier:0 + collisions:0 txqueuelen:100 + Interrupt:10 Base address:0x1080 + +eth1 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4 + inet addr:XXX.XXX.XXX.YYY Bcast:XXX.XXX.XXX.255 Mask:255.255.252.0 + UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 + RX packets:3651769 errors:0 dropped:0 overruns:0 frame:0 + TX packets:1643480 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:100 + Interrupt:9 Base address:0x1400 + +Questions: + +1. Is it SMP safe? + + Yes. The old 2.0.xx channel bonding patch wasn't SMP safe. +This one was designed from the start to be SMP safe. + +2. What type of cards can it work with it? + + Any Ethernet type cards (ie, you can even mix cards - a tulip +and a 3com 3c905, for example). You can even bond together Gigabit +Ethernet cards! + +3. How many bond devices can I have? + + Just one at this time. + +4. How many slaves can a bond device have? + + Limited by the number of cards/ports you can place in your system. + +5. What happens when a slave dies? + + Currently, the ethernet drivers don't really handle this +situation very well. The tulip driver never stalls; it just starts to +throw packets away! In 2.4, if the ethernet driver has been updated, it +will try to detect unplug/dead cards, and ignore that interface. + +6. If this was fixed, can bonding be used for High Availability? + + Yes! + +7. Which switches/systems does it work with? + + Cisco 5500 series (look for EtherChannel support). + SunTrunking software. + +8. Where does the bond0 device get it's mac address from? + + It's taken from the first slave device. If you remove that +first slave device, the MAC address continues to be associated with +it. If you wish to remove that MAC address, you have to ifconfig +bond0 down, and then modprobe -r bonding. If you wish, you can also +assign a MAC address when you ifconfig the bond0 device. + +9. Which transmit policy is used? + + Round robin, based on order of enslaving. + XOR (what Cisco Etherchannel uses) is not used. diff -ruN linux/MAINTAINERS linux-2.3/MAINTAINERS --- linux/MAINTAINERS Thu Mar 2 10:10:24 2000 +++ linux-2.3/MAINTAINERS Thu Mar 9 13:36:44 2000 @@ -336,6 +336,12 @@ L: linux-net@vger.rutgers.edu S: Maintained +ETHERNET BONDING DRIVER +P: Thomas Davis +M: tadavis@lbl.gov +W: http://pdsf.nersc.gov/linux/ +S: Maintained + ETHERNET BRIDGE P: Lennert Buytenhek M: buytenh@openrock.net diff -ruN linux/drivers/net/Config.in linux-2.3/drivers/net/Config.in --- linux/drivers/net/Config.in Thu Mar 9 13:29:58 2000 +++ linux-2.3/drivers/net/Config.in Wed Mar 8 11:35:36 2000 @@ -6,7 +6,7 @@ source drivers/net/appletalk/Config.in tristate 'Dummy net driver support' CONFIG_DUMMY -tristate 'Bonding driver support' CONFIG_BONDING +dep_tristate 'Bonding driver support' CONFIG_BONDING m tristate 'EQL (serial line load balancing) support' CONFIG_EQUALIZER if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then if [ "$CONFIG_NETLINK" = "y" ]; then diff -ruN linux/drivers/net/bonding.c linux-2.3/drivers/net/bonding.c --- linux/drivers/net/bonding.c Mon Feb 28 07:18:20 2000 +++ linux-2.3/drivers/net/bonding.c Wed Mar 8 11:30:16 2000 @@ -6,7 +6,8 @@ * * bond.c: a bonding/etherchannel/sun trunking net driver * - * This is useful to talk to a Cisco 5500, running Etherchannel, aka: + * This is useful to talk to a Cisco 5500, running Etherchannel, also + * known as: * Linux Channel Bonding * Sun Trunking (Solaris) * @@ -21,7 +22,7 @@ * will release all slaves, marking them as down. * * ifenslave bond0 eth0 - * will attache eth0 to bond0 as a slave. eth0 hw mac address will either + * will attach eth0 to bond0 as a slave. eth0 hw mac address will either * a: be used as initial mac address * b: if a hw mac address already is there, eth0's hw mac address * will then be set from bond0. @@ -184,6 +185,11 @@ /* It is pretty silly, SIOCSIFHWADDR exists to make this. */ +/* no, it's not. IFHWADDR has to take the master down to set the hwaddr - + which mucks up the routing tables. This allows us to set the hwaddr + without ifconfig up/down the master. + */ + static int bond_sethwaddr(struct net_device *master, struct net_device *slave) { memcpy(master->dev_addr, slave->dev_addr, slave->addr_len); @@ -268,6 +274,22 @@ return 0; } + +/* + * According the Cisco/Sun doc's, there are two types of methods to + * to pick with channel to transmit down. + * Method A, is to XOR the low order bits of the hwaddr, and it with + * the # of channels, and that picks which channel to use. + * Method B, is to simply round robin through the channels. + * Method B is simpler and faster. So we implement B, and ignore A. + * (Cisco Etherchannel still uses Method 'A' to talk to you, but + * will accept packets using Method 'B'.) + * + * This xmit will also attempt to send the packet down the first up and + * running channel; if the channel is down, it will skip it. It will also + * only try all of the slave channels once. + * + */ static int bond_xmit(struct sk_buff *skb, struct net_device *dev) {

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Mar 15 2000 - 21:00:16 EST