Commit 99af4820 authored by Doron Tsur's avatar Doron Tsur Committed by Kamal Mostafa

net/mlx5e: Max mtu comparison fix

commit 50a9eea6 upstream.

On change mtu the driver compares between hardware queried mtu and
software requested mtu. We need to compare between software
representation of the queried mtu and the requested mtu.

Fixes: facc9699 ('net/mlx5e: Fix HW MTU settings')
Signed-off-by: default avatarDoron Tsur <doront@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 7587fa44
...@@ -1625,6 +1625,8 @@ static int mlx5e_change_mtu(struct net_device *netdev, int new_mtu) ...@@ -1625,6 +1625,8 @@ static int mlx5e_change_mtu(struct net_device *netdev, int new_mtu)
mlx5_query_port_max_mtu(mdev, &max_mtu, 1); mlx5_query_port_max_mtu(mdev, &max_mtu, 1);
max_mtu = MLX5E_HW2SW_MTU(max_mtu);
if (new_mtu > max_mtu) { if (new_mtu > max_mtu) {
netdev_err(netdev, netdev_err(netdev,
"%s: Bad MTU (%d) > (%d) Max\n", "%s: Bad MTU (%d) > (%d) Max\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment