Skip to contentSkip to conversation

vmxnet3: update MTU after device quiesce

PATCH Superseded Ronak Doshi 2 participants 2 messages May 13, 2025 – May 15, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Ronak Doshi

author maintainer
#0 lore raw

PATCH 1/1 vmxnet3: update MTU after device quiesce

Currently, when device mtu is updated, vmxnet3 updates netdev mtu, quiesces the device and then reactivates it for the ESXi to know about the new mtu. So, technically the OS stack can start using the new mtu before ESXi knows about the new mtu.

This can lead to issues for TSO packets which use mss as per the new mtu configured. This patch fixes this issue by moving the mtu write after device quiesce.

Fixes d1a890fa37f2 ("net: VMware virtual Ethernet NIC driver: vmxnet3")
---
 drivers/net/vmxnet3/vmxnet3_drv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/vmxnet3/vmxnet3_drv.c +3 -2
index 3df6aabc7e33..58027e82de88 100644
@@ -3607,8 +3607,6 @@ vmxnet3_change_mtu(struct net_device *netdev, int new_mtu)
 	struct vmxnet3_adapter *adapter = netdev_priv(netdev);
 	int err = 0;
 
-	WRITE_ONCE(netdev->mtu, new_mtu);
-
 	/*
 	 * Reset_work may be in the middle of resetting the device, wait for its
 	 * completion.
@@ -3619,6 +3617,7 @@ vmxnet3_change_mtu(struct net_device *netdev, int new_mtu)
 	if (netif_running(netdev)) {
 		vmxnet3_quiesce_dev(adapter);
 		vmxnet3_reset_dev(adapter);
+		WRITE_ONCE(netdev->mtu, new_mtu);
 
 		/* we need to re-create the rx queue based on the new mtu */
 		vmxnet3_rq_destroy_all(adapter);
@@ -3638,6 +3637,8 @@ vmxnet3_change_mtu(struct net_device *netdev, int new_mtu)
 				   "Closing it\n", err);
 			goto out;
 		}
+	} else {
+		WRITE_ONCE(netdev->mtu, new_mtu);
 	}
 
 out:
Signature · 1 line
2.45.2
maintainer
#1 lore raw

drivers/net/vmxnet3/vmxnet3_drv.c vmxnet3_change_mtu(struct net_device *netdev, int new_mtu) · line 3623

Quoted 8 lines · On Tue, 13 May 2025 21:02:40 +0000 Ronak Doshi wrote:
drivers/net/vmxnet3/vmxnet3_drv.c +1 -0
@@ -3619,6 +3617,7 @@ vmxnet3_change_mtu(struct net_device *netdev, int new_mtu)
 	if (netif_running(netdev)) {
 		vmxnet3_quiesce_dev(adapter);
 		vmxnet3_reset_dev(adapter);
+		WRITE_ONCE(netdev->mtu, new_mtu);
 
 		/* we need to re-create the rx queue based on the new mtu */
 		vmxnet3_rq_destroy_all(adapter);

Maybe a nit pick but wouldn't it make the most sense to place the write after all teardown related code? So after vmxnet3_rq_destroy_all() ?