2005-03-15 21:52:26

by John W. Linville

[permalink] [raw]
Subject: [patch 2.6.11] bonding: avoid tx balance for IGMP (alb/tlb mode)

Add special case to bond_alb_xmit() to avoid tx balance for IGMP.

Signed-off-by: John W. Linville <[email protected]>
---
Some switches (e.g. the Cisco Catalyst 3750) use IGMP snooping to
determine which hosts belong to which multicast groups. Typically
such switches use a timeout to determine when hosts have quietly left
a group.

In ALB or TLB mode, only one interface is configured to receive
packets at a time. (Receive load balancing doesn't seem to be
effective for IGMP traffic.) If both Ethernet interfaces are up,
the load balancing capability can move the sending of IGMP packets
to the non-receiving interface. If the switch ends up timing out the
interface configured to receive packets, the multicast packets are then
only sent to the non-receiving interface and are subsequently dropped.
This behaviour is undesirable.

The fix is to add a new special case (alongside some existing special
cases) in bond_alb_xmit() in order to ensure that IGMP traffic is
always sent out the port which is configured to receive frames.

Of course, this patch has the downside of not load balancing IGMP
traffic from the host. But, I'm inclined to believe that is "no big
deal"... :-) Also, I'm sure other solutions might exist. But, they
are likely no where near as simple as this one. And, this is probably
the most in keeping with the ALB/TLB philosophy of not requiring any
special switch support.

drivers/net/bonding/bond_alb.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)

--- linux-2.6.11/drivers/net/bonding/bond_alb.c.orig 2005-03-15 16:25:09.648034108 -0500
+++ linux-2.6.11/drivers/net/bonding/bond_alb.c 2005-03-15 16:25:09.649033971 -0500
@@ -54,6 +54,7 @@
#include <linux/if_ether.h>
#include <linux/if_bonding.h>
#include <linux/if_vlan.h>
+#include <linux/in.h>
#include <net/ipx.h>
#include <net/arp.h>
#include <asm/byteorder.h>
@@ -1300,7 +1301,8 @@ int bond_alb_xmit(struct sk_buff *skb, s
switch (ntohs(skb->protocol)) {
case ETH_P_IP:
if ((memcmp(eth_data->h_dest, mac_bcast, ETH_ALEN) == 0) ||
- (skb->nh.iph->daddr == ip_bcast)) {
+ (skb->nh.iph->daddr == ip_bcast) ||
+ (skb->nh.iph->protocol == IPPROTO_IGMP)) {
do_tx_balance = 0;
break;
}
--
John W. Linville
[email protected]


2005-03-16 00:52:19

by Rick Jones

[permalink] [raw]
Subject: Re: [patch 2.6.11] bonding: avoid tx balance for IGMP (alb/tlb mode)

Is that switch behaviour "normal" or "correct?" I know next to nothing about
what stuff like LACP should do, but asked some internal folks and they had this
to say:

<excerpt>


<blank> treats IGMP packets the same as all other non-broadcast traffic (i.e. it
will attempt to load balance). This switch behavior seems rather odd in an
aggregated case, given the fact that most traffic (except broadcast packets)
will be load balanced by the partner device. In addition, the switch (in
theory) is suppose to treat the aggregated switch ports as 1 logical port
and therefore it should allow IGMP packets to be received back on any port
in the logical aggregation.

IMO, the switch behavior in this case seems questionable.

</excerpt>

FWIW,

rick jones

2005-03-16 01:03:35

by Jay Vosburgh

[permalink] [raw]
Subject: Re: [patch 2.6.11] bonding: avoid tx balance for IGMP (alb/tlb mode)

Rick Jones <[email protected]> wrote:

><blank> treats IGMP packets the same as all other non-broadcast traffic (i.e. it
>will attempt to load balance). This switch behavior seems rather odd in an
>aggregated case, given the fact that most traffic (except broadcast packets)
>will be load balanced by the partner device. In addition, the switch (in
>theory) is suppose to treat the aggregated switch ports as 1 logical port
>and therefore it should allow IGMP packets to be received back on any port
>in the logical aggregation.
>
>IMO, the switch behavior in this case seems questionable.

This patch only applies to the bonding balance-alb/tlb modes,
which do not require the switch to be configured for aggregation. Since
the switch has no explicit knowledge that the links are being
aggregated, it seems reasonable for it to be confused by what it gets in
the described case.

I haven't tested the patch, but conceptually the problem John
described in his original mail sounds plausible, as does the fix for it.

-J

---
-Jay Vosburgh, IBM Linux Technology Center, [email protected]

2005-03-16 14:42:12

by John W. Linville

[permalink] [raw]
Subject: Re: [patch 2.6.11] bonding: avoid tx balance for IGMP (alb/tlb mode)

On Tue, Mar 15, 2005 at 04:52:14PM -0800, Rick Jones wrote:
> Is that switch behaviour "normal" or "correct?" I know next to nothing

As Jay Vosburgh points-out, this patch only effects ALB and TLB modes.
These are modes where the link partner is unaware of the bonded
configuration. In effect, we are tricking the switch into behaving
the way we desire.

Since the switch is unaware of our bonded behaviour, I think it makes
sense to accomodate this quirk related to IGMP snooping.

John
--
John W. Linville
[email protected]