Skip to content

Commit 43f0999

Browse files
Ronak Doshikuba-moo
Ronak Doshi
authored andcommitted
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. Cc: [email protected] Fixes: d1a890f ("net: VMware virtual Ethernet NIC driver: vmxnet3") Signed-off-by: Ronak Doshi <[email protected]> Acked-by: Guolin Yang <[email protected]> Changes v1-> v2: Moved MTU write after destroy of rx rings Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 91b6dbc commit 43f0999

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/vmxnet3/vmxnet3_drv.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3607,8 +3607,6 @@ vmxnet3_change_mtu(struct net_device *netdev, int new_mtu)
36073607
struct vmxnet3_adapter *adapter = netdev_priv(netdev);
36083608
int err = 0;
36093609

3610-
WRITE_ONCE(netdev->mtu, new_mtu);
3611-
36123610
/*
36133611
* Reset_work may be in the middle of resetting the device, wait for its
36143612
* completion.
@@ -3622,6 +3620,7 @@ vmxnet3_change_mtu(struct net_device *netdev, int new_mtu)
36223620

36233621
/* we need to re-create the rx queue based on the new mtu */
36243622
vmxnet3_rq_destroy_all(adapter);
3623+
WRITE_ONCE(netdev->mtu, new_mtu);
36253624
vmxnet3_adjust_rx_ring_size(adapter);
36263625
err = vmxnet3_rq_create_all(adapter);
36273626
if (err) {
@@ -3638,6 +3637,8 @@ vmxnet3_change_mtu(struct net_device *netdev, int new_mtu)
36383637
"Closing it\n", err);
36393638
goto out;
36403639
}
3640+
} else {
3641+
WRITE_ONCE(netdev->mtu, new_mtu);
36413642
}
36423643

36433644
out:

0 commit comments

Comments
 (0)