[SRU][Wily][PATCH 1/1] net/mlx5e: Max mtu comparison fix

Joseph Salisbury joseph.salisbury at canonical.com
Tue Jan 5 20:50:56 UTC 2016


From: Doron Tsur <doront at mellanox.com>

BugLink: http://bugs.launchpad.net/bugs/1528466

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 at mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm at mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz at mellanox.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
(cherry picked from commit 50a9eea694ab8e0779069e0a4e0b12e145521468)
Signed-off-by: Joseph Salisbury <joseph.salisbury at canonical.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 355a10a..ec2ae7c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -1692,6 +1692,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",
-- 
2.5.0





More information about the kernel-team mailing list