From: Eric Dumazet <eric.dumazet@gmail.com>
To: sarveshwar.bandi@emulex.com
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-2.6] bonding: Bonding driver does not consider the gso_max_size setting of slaves.
Date: Wed, 21 Nov 2012 06:43:45 -0800 [thread overview]
Message-ID: <1353509025.2590.31.camel@edumazet-glaptop> (raw)
In-Reply-To: <8814d83f-7213-4a32-91ec-39088a1a60a6@CMEXHTCAS1.ad.emulex.com>
On Wed, 2012-11-21 at 16:48 +0530, sarveshwar.bandi@emulex.com wrote:
> From: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
>
> Patch sets the lowest non-zero gso_max_size value of the slaves during enslave
> and detach.
>
> Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
> ---
> drivers/net/bonding/bond_main.c | 27 +++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index b2530b0..5f19d16 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -1198,6 +1198,31 @@ static void bond_attach_slave(struct bonding *bond, struct slave *new_slave)
> bond->slave_cnt++;
> }
>
> +static void bond_set_gso_max_size(struct bonding *bond)
> +{
> + struct slave *slave;
> + struct net_device *bond_dev = bond->dev;
> + unsigned int gso_max_size = 0;
> + bool reset_gso_size = true;
> + int i;
> +
> + bond_for_each_slave(bond, slave, i) {
> + if (!slave->dev->gso_max_size)
> + continue;
> +
> + reset_gso_size = false;
> +
> + if (!gso_max_size ||
> + slave->dev->gso_max_size < gso_max_size)
> + gso_max_size = slave->dev->gso_max_size;
> + }
> +
> + if (gso_max_size && gso_max_size < bond_dev->gso_max_size)
> + netif_set_gso_max_size(bond_dev, gso_max_size);
> + else if (reset_gso_size)
> + netif_set_gso_max_size(bond_dev, 0);
> +}
> +
This seems a bit complex, and I have no idea why you call
netif_set_gso_max_size(bond_dev, 0);
Default gso_max_size is GSO_MAX_SIZE, not 0
next prev parent reply other threads:[~2012-11-21 14:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-21 11:18 [PATCH net-2.6] bonding: Bonding driver does not consider the gso_max_size setting of slaves sarveshwar.bandi
2012-11-21 11:56 ` Neil Horman
2012-11-21 12:03 ` Bandi,Sarveshwar
2012-11-21 14:44 ` Eric Dumazet
2012-11-21 14:43 ` Eric Dumazet [this message]
2012-11-21 14:44 ` Bandi,Sarveshwar
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=1353509025.2590.31.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sarveshwar.bandi@emulex.com \
/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