Skip to contentSkip to conversation

vmxnet3: Fix inconsistent LRO state after initialization

PATCH Applied Thomas Jarosch 3 participants 3 messages May 16, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vmxnet3: Fix inconsistent LRO state after initialization

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.

drivers/net/vmxnet3/vmxnet3_ethtool.c +3 -0
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
@@ -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 |=
Acked-by on v1 1/1
#1 lore raw
Quoted 33 lines · On Mon, 16 May 2011 18:28:15 +0200 Thomas Jarosch…

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.

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

drivers/net/vmxnet3/vmxnet3_ethtool.c vmxnet3_set_flags(struct net_device *net · line 295

Quoted 9 lines
drivers/net/vmxnet3/vmxnet3_ethtool.c +3 -0
@@ -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

maintainer Applied
#2 lore raw

From: Stephen Hemminger <[email protected]>
Date: Mon, 16 May 2011 10:14:44 -0700

Quoted 5 lines
Quoted 2 lines · On Mon, 16 May 2011 18:28:15 +0200 Thomas Jarosch…

During initialization of vmxnet3, the state of LRO gets out of sync with netdev->features.

...

Quoted 6 lines
Quoted 1 line

Thanks for finding this. Vyatta ended up changing the default of adapter->lro to workaround just this problem

Applied.