* [PATCH] vmxnet3: Fix inconsistent LRO state after initialization
@ 2011-05-16 16:28 Thomas Jarosch
2011-05-16 17:14 ` Stephen Hemminger
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Jarosch @ 2011-05-16 16:28 UTC (permalink / raw)
To: netdev; +Cc: Shreyas Bhatewara
During initialization of vmxnet3, the state of LRO
gets out of sync with netdev->features.
This leads to very poor TCP performance in a IP forwarding
setup and is hitting many VMware users.
Simplified call sequence:
1. vmxnet3_declare_features() initializes "adapter->lro" to true.
2. The kernel automatically disables LRO if IP forwarding is enabled,
so vmxnet3_set_flags() gets called. This also updates netdev->features.
3. Now vmxnet3_setup_driver_shared() is called. "adapter->lro" is still
set to true and LRO gets enabled again, even though
netdev->features shows it's disabled.
Fix it by updating "adapter->lro", too.
The private vmxnet3 adapter flags are scheduled for removal
in net-next, see commit a0d2730c9571aeba793cb5d3009094ee1d8fda35
"net: vmxnet3: convert to hw_features".
Patch applies to 2.6.37 / 2.6.38 and 2.6.39-rc6.
Please CC: comments.
Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
diff -u -r -p linux-2.6.37.i686/drivers/net/vmxnet3/vmxnet3_ethtool.c linux-2.6.37.lro/drivers/net/vmxnet3/vmxnet3_ethtool.c
--- linux-2.6.37.i686/drivers/net/vmxnet3/vmxnet3_ethtool.c 2011-05-16 17:43:26.652081801 +0200
+++ linux-2.6.37.lro/drivers/net/vmxnet3/vmxnet3_ethtool.c 2011-05-16 17:47:52.784081802 +0200
@@ -287,6 +287,9 @@ vmxnet3_set_flags(struct net_device *net
/* toggle the LRO feature*/
netdev->features ^= NETIF_F_LRO;
+ /* Update private LRO flag */
+ adapter->lro = lro_requested;
+
/* update harware LRO capability accordingly */
if (lro_requested)
adapter->shared->devRead.misc.uptFeatures |=
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] vmxnet3: Fix inconsistent LRO state after initialization
2011-05-16 16:28 [PATCH] vmxnet3: Fix inconsistent LRO state after initialization Thomas Jarosch
@ 2011-05-16 17:14 ` Stephen Hemminger
2011-05-16 19:05 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2011-05-16 17:14 UTC (permalink / raw)
To: Thomas Jarosch; +Cc: netdev, Shreyas Bhatewara
On Mon, 16 May 2011 18:28:15 +0200
Thomas Jarosch <thomas.jarosch@intra2net.com> wrote:
> During initialization of vmxnet3, the state of LRO
> gets out of sync with netdev->features.
>
> This leads to very poor TCP performance in a IP forwarding
> setup and is hitting many VMware users.
>
> Simplified call sequence:
> 1. vmxnet3_declare_features() initializes "adapter->lro" to true.
>
> 2. The kernel automatically disables LRO if IP forwarding is enabled,
> so vmxnet3_set_flags() gets called. This also updates netdev->features.
>
> 3. Now vmxnet3_setup_driver_shared() is called. "adapter->lro" is still
> set to true and LRO gets enabled again, even though
> netdev->features shows it's disabled.
>
> Fix it by updating "adapter->lro", too.
>
>
> The private vmxnet3 adapter flags are scheduled for removal
> in net-next, see commit a0d2730c9571aeba793cb5d3009094ee1d8fda35
> "net: vmxnet3: convert to hw_features".
>
> Patch applies to 2.6.37 / 2.6.38 and 2.6.39-rc6.
>
> Please CC: comments.
>
> Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
>
> diff -u -r -p linux-2.6.37.i686/drivers/net/vmxnet3/vmxnet3_ethtool.c linux-2.6.37.lro/drivers/net/vmxnet3/vmxnet3_ethtool.c
> --- linux-2.6.37.i686/drivers/net/vmxnet3/vmxnet3_ethtool.c 2011-05-16 17:43:26.652081801 +0200
> +++ linux-2.6.37.lro/drivers/net/vmxnet3/vmxnet3_ethtool.c 2011-05-16 17:47:52.784081802 +0200
> @@ -287,6 +287,9 @@ vmxnet3_set_flags(struct net_device *net
> /* toggle the LRO feature*/
> netdev->features ^= NETIF_F_LRO;
>
> + /* Update private LRO flag */
> + adapter->lro = lro_requested;
> +
> /* update harware LRO capability accordingly */
> if (lro_requested)
> adapter->shared->devRead.misc.uptFeatures |=
Thanks for finding this. Vyatta ended up changing the default of adapter->lro
to workaround just this problem
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] vmxnet3: Fix inconsistent LRO state after initialization
2011-05-16 17:14 ` Stephen Hemminger
@ 2011-05-16 19:05 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2011-05-16 19:05 UTC (permalink / raw)
To: shemminger; +Cc: thomas.jarosch, netdev, sbhatewara
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 16 May 2011 10:14:44 -0700
> On Mon, 16 May 2011 18:28:15 +0200
> Thomas Jarosch <thomas.jarosch@intra2net.com> wrote:
>
>> During initialization of vmxnet3, the state of LRO
>> gets out of sync with netdev->features.
...
>> Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
>
> Thanks for finding this. Vyatta ended up changing the default of adapter->lro
> to workaround just this problem
>
> Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-05-16 19:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-16 16:28 [PATCH] vmxnet3: Fix inconsistent LRO state after initialization Thomas Jarosch
2011-05-16 17:14 ` Stephen Hemminger
2011-05-16 19:05 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.