]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net/mlx5e: Update features on MTU change
authorDragos Tatulea <dtatulea@nvidia.com>
Thu, 24 Oct 2024 16:41:32 +0000 (19:41 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 29 Oct 2024 18:48:26 +0000 (11:48 -0700)
When the MTU changes successfully, trigger netdev_update_features() to
enable features in wanted state if applicable.

An example of such scenario:
$ ip link set dev eth1 up
$ ethtool --set-ring eth1 rx 8192
$ ip link set dev eth1 mtu 9000
$ ethtool --features eth1 rx-gro-hw on --> fails
$ ip link set dev eth1 mtu 7000

With this patch, HW GRO will be turned on automatically because
it is set in the device's wanted_features.

Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20241024164134.299646-2-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index ce94859014f8786642fe4ed2ff66bef245defb1f..235d0030062617adbc85cda7155cb1007881a2ed 100644 (file)
@@ -4557,6 +4557,10 @@ int mlx5e_change_mtu(struct net_device *netdev, int new_mtu,
 out:
        WRITE_ONCE(netdev->mtu, params->sw_mtu);
        mutex_unlock(&priv->state_lock);
+
+       if (!err)
+               netdev_update_features(netdev);
+
        return err;
 }