From: Maxim Mikityanskiy Date: Wed, 9 Feb 2022 13:32:35 +0000 (+0200) Subject: net/mlx5e: Use page-sized fragments with XDP multi buffer X-Git-Tag: v6.1-rc5~1746^2~31^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d51f4a4cca6f629927b1871af0c6f5ce7a9022e9;p=platform%2Fkernel%2Flinux-starfive.git net/mlx5e: Use page-sized fragments with XDP multi buffer The implementation of XDP in mlx5e assumes that the frame size is equal to the page size. Force this limitation in the non-linear mode for XDP multi buffer. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c index 822fbb9..9646867 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c @@ -444,7 +444,7 @@ static int mlx5e_build_rq_frags_info(struct mlx5_core_dev *mdev, max_mtu = mlx5e_max_nonlinear_mtu(first_frag_size_max, frag_size_max, params->xdp_prog); - if (byte_count > max_mtu) { + if (byte_count > max_mtu || params->xdp_prog) { frag_size_max = PAGE_SIZE; first_frag_size_max = SKB_WITH_OVERHEAD(frag_size_max - headroom);