Skip to content

Commit f615da5

Browse files
Ronak DoshiUlrich Hecht
authored andcommitted
vmxnet3: update MTU after device quiesce
[ Upstream commit 43f0999af011fba646e015f0bb08b6c3002a0170 ] 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: stable@vger.kernel.org Fixes: d1a890f ("net: VMware virtual Ethernet NIC driver: vmxnet3") Signed-off-by: Ronak Doshi <ronak.doshi@broadcom.com> Acked-by: Guolin Yang <guolin.yang@broadcom.com> Changes v1-> v2: Moved MTU write after destroy of rx rings Link: https://patch.msgid.link/20250515190457.8597-1-ronak.doshi@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> [ no WRITE_ONCE() in older trees ] Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ulrich Hecht <uli@kernel.org>
1 parent f028748 commit f615da5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/net/vmxnet3/vmxnet3_drv.c

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

3001-
netdev->mtu = new_mtu;
3002-
30033001
/*
30043002
* Reset_work may be in the middle of resetting the device, wait for its
30053003
* completion.
@@ -3013,6 +3011,7 @@ vmxnet3_change_mtu(struct net_device *netdev, int new_mtu)
30133011

30143012
/* we need to re-create the rx queue based on the new mtu */
30153013
vmxnet3_rq_destroy_all(adapter);
3014+
netdev->mtu = new_mtu;
30163015
vmxnet3_adjust_rx_ring_size(adapter);
30173016
err = vmxnet3_rq_create_all(adapter);
30183017
if (err) {
@@ -3029,6 +3028,8 @@ vmxnet3_change_mtu(struct net_device *netdev, int new_mtu)
30293028
"Closing it\n", err);
30303029
goto out;
30313030
}
3031+
} else {
3032+
netdev->mtu = new_mtu;
30323033
}
30333034

30343035
out:

0 commit comments

Comments
 (0)