net/mlx5e: Max mtu comparison fix
authorDoron Tsur <doront@mellanox.com>
Thu, 12 Nov 2015 17:35:27 +0000 (19:35 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 15 Nov 2015 23:43:40 +0000 (18:43 -0500)
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: facc9699f0fe ('net/mlx5e: Fix HW MTU settings')
Signed-off-by: Doron Tsur <doront@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index df001754bcd1563ba73ada56bcfcd045fb4934c6..1e52db32c73d28bdc5e76f4857522a7b2ecff90b 100644 (file)
@@ -1901,6 +1901,8 @@ static int mlx5e_change_mtu(struct net_device *netdev, int new_mtu)
 
        mlx5_query_port_max_mtu(mdev, &max_mtu, 1);
 
+       max_mtu = MLX5E_HW2SW_MTU(max_mtu);
+
        if (new_mtu > max_mtu) {
                netdev_err(netdev,
                           "%s: Bad MTU (%d) > (%d) Max\n",