From: Sven Anders <anders@anduras.de>
To: Jay Vosburgh <fubar@us.ibm.com>, netdev@vger.kernel.org
Subject: Re: Possible bug in bonding driver (with VLAN in ALB mode)
Date: Wed, 22 Oct 2008 16:34:45 +0200 [thread overview]
Message-ID: <48FF3A05.1010408@anduras.de> (raw)
In-Reply-To: <4231.1224629540@death.nxdomain.ibm.com>
[-- Attachment #1.1: Type: text/plain, Size: 3252 bytes --]
Jay Vosburgh schrieb:
> Sven Anders <anders@anduras.de> wrote:
>
>> Any other ideas?
>
> Try this; I actually tested this one and it seems to not crash
> my system. This is against the current mainline, so you might have to
> apply it by hand on your older kernel.
Ok, it did not crash, but... (see comments below)
> diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
> index 3d39278..4fb78b0 100644
> --- a/drivers/net/bonding/bond_alb.c
> +++ b/drivers/net/bonding/bond_alb.c
> @@ -341,14 +341,15 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
>
> static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct packet_type *ptype, struct net_device *orig_dev)
> {
> - struct bonding *bond = bond_dev->priv;
> + struct bonding *bond;
> struct arp_pkt *arp = (struct arp_pkt *)skb->data;
> int res = NET_RX_DROP;
>
> if (dev_net(bond_dev) != &init_net)
> goto out;
>
> - if (!(bond_dev->flags & IFF_MASTER))
> + if (!(bond_dev->priv_flags & IFF_BONDING) ||
> + !(bond_dev->flags & IFF_MASTER))
> goto out;
> if (!arp) {
This did not work, because the VLAN interface did not have the
BONDING flag set.
> @@ -363,6 +364,7 @@ static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct
>
> if (arp->op_code == htons(ARPOP_REPLY)) {
> /* update rx hash table for this ARP */
> + bond = bond_dev->priv;
> rlb_update_entry_from_arp(bond, arp);
> dprintk("Server received an ARP Reply from client\n");
> }
To make this work, even for the VLAN interfaces, I had to get the
stored "bond" from the "packet_type"'s private data.
Instead I used here:
bond = ptype->af_packet_priv;
if (!bond) goto out;
> @@ -813,7 +815,7 @@ static int rlb_initialize(struct bonding *bond)
>
> /*initialize packet type*/
> pk_type->type = __constant_htons(ETH_P_ARP);
> - pk_type->dev = bond->dev;
> + pk_type->dev = NULL;
> pk_type->func = rlb_arp_recv;
>
> /* register to receive ARPs */
Additionally, here I store the "bond" to the private data:
pk_type->dev = NULL;
pk_type->func = rlb_arp_recv;
pk_type->af_packet_priv = bond;
With these fixes, it worked!
That means: Receive load balancing with VLANs works.
Certainly, this is only a test bugfix only, because it does not
work with more than one active bond. Any ideas how to implement
this correctly? Do we have to use an "dev_add_pack()" for each
VLAN we are adding?
What troubles me is, that nobody since the addition of VLAN support
to bonding in 2004 had this problem before. Did this (ever) work in
one older version of the bonding driver?
Regards
Sven
--
Sven Anders <anders@anduras.de> () Ascii Ribbon Campaign
/\ Support plain text e-mail
ANDURAS service solutions AG
Innstraße 71 - 94036 Passau - Germany
Web: www.anduras.de - Tel: +49 (0)851-4 90 50-0 - Fax: +49 (0)851-4 90 50-55
Rechtsform: Aktiengesellschaft - Sitz: Passau - Amtsgericht Passau HRB 6032
Mitglieder des Vorstands: Sven Anders, Marcus Junker
Vorsitzender des Aufsichtsrats: Mark Peters
[-- Attachment #1.2: anders.vcf --]
[-- Type: text/x-vcard, Size: 352 bytes --]
begin:vcard
fn:Sven Anders
n:Anders;Sven
org:ANDURAS AG;Research and Development
adr;quoted-printable:;;Innstra=C3=9Fe 71;Passau;Bavaria;94036;Germany
email;internet:anders@anduras.de
title:Dipl. Inf.
tel;work:++49 (0)851 / 490 50 -0
tel;fax:++49 (0)851 / 590 50 - 55
x-mozilla-html:FALSE
url:http://www.anduras.de
version:2.1
end:vcard
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
next prev parent reply other threads:[~2008-10-22 14:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-21 17:18 Possible bug in bonding driver (with VLAN in ALB mode) Sven Anders
2008-10-21 18:12 ` Jay Vosburgh
2008-10-21 20:34 ` Sven Anders
[not found] ` <48FE51C5.2010800@anduras.de>
[not found] ` <4231.1224629540@death.nxdomain.ibm.com>
2008-10-22 14:34 ` Sven Anders [this message]
2008-10-22 19:13 ` Jay Vosburgh
2008-10-27 13:38 ` Sven Anders
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48FF3A05.1010408@anduras.de \
--to=anders@anduras.de \
--cc=fubar@us.ibm.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).