Skip to content

Commit 6146b1a

Browse files
Jay VosburghJeff Garzik
Jay Vosburgh
authored and
Jeff Garzik
committed
bonding: Fix ALB mode to balance traffic on VLANs
The current ALB function that processes incoming ARPs does not handle traffic for VLANs configured above bonding. This causes traffic on those VLANs to all be assigned the same slave. This patch corrects that misbehavior by locating the bonding interface nested below the VLAN interface. Bug reported by Sven Anders <[email protected]>, who also tested an earlier version of this patch and confirmed that it resolved the problem. Signed-off-by: Jay Vosburgh <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
1 parent 305d552 commit 6146b1a

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

drivers/net/bonding/bond_alb.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,14 +346,18 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
346346

347347
static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct packet_type *ptype, struct net_device *orig_dev)
348348
{
349-
struct bonding *bond = bond_dev->priv;
349+
struct bonding *bond;
350350
struct arp_pkt *arp = (struct arp_pkt *)skb->data;
351351
int res = NET_RX_DROP;
352352

353353
if (dev_net(bond_dev) != &init_net)
354354
goto out;
355355

356-
if (!(bond_dev->flags & IFF_MASTER))
356+
while (bond_dev->priv_flags & IFF_802_1Q_VLAN)
357+
bond_dev = vlan_dev_real_dev(bond_dev);
358+
359+
if (!(bond_dev->priv_flags & IFF_BONDING) ||
360+
!(bond_dev->flags & IFF_MASTER))
357361
goto out;
358362

359363
if (!arp) {
@@ -368,6 +372,9 @@ static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct
368372

369373
if (arp->op_code == htons(ARPOP_REPLY)) {
370374
/* update rx hash table for this ARP */
375+
printk("rar: update orig %s bond_dev %s\n", orig_dev->name,
376+
bond_dev->name);
377+
bond = bond_dev->priv;
371378
rlb_update_entry_from_arp(bond, arp);
372379
dprintk("Server received an ARP Reply from client\n");
373380
}
@@ -818,7 +825,7 @@ static int rlb_initialize(struct bonding *bond)
818825

819826
/*initialize packet type*/
820827
pk_type->type = __constant_htons(ETH_P_ARP);
821-
pk_type->dev = bond->dev;
828+
pk_type->dev = NULL;
822829
pk_type->func = rlb_arp_recv;
823830

824831
/* register to receive ARPs */

0 commit comments

Comments
 (0)