OSDN Git Service

net/mlx5e: Fix the max MTU check in case of XDP
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Mon, 8 Apr 2019 12:12:45 +0000 (15:12 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 19 Apr 2019 20:55:36 +0000 (13:55 -0700)
commitd460c2718906252a2a69bc6f89b537071f792e6e
tree88ee3d0bdc99c9033c62356721a4635631f49838
parent12fc512f5741443a03adde2ead20724da8ad550a
net/mlx5e: Fix the max MTU check in case of XDP

MLX5E_XDP_MAX_MTU was calculated incorrectly. It didn't account for
NET_IP_ALIGN and MLX5E_HW2SW_MTU, and it also misused MLX5_SKB_FRAG_SZ.
This commit fixes the calculations and adds a brief explanation for the
formula used.

Fixes: a26a5bdf3ee2d ("net/mlx5e: Restrict the combination of large MTU and XDP")
Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c