]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit4b54abef80ddc987f8128d7996c0255127fba89e
tree88ee3d0bdc99c9033c62356721a4635631f49838
parent7dca151125a70212d2e1e99e3179f5aa9916e758
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: 5d6f6b78b8cf7 ("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