]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Use fragments of the same size in non-linear legacy RQ with XDP
authorMaxim Mikityanskiy <maximmi@nvidia.com>
Thu, 27 Jan 2022 12:14:53 +0000 (14:14 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 18 Mar 2022 20:51:12 +0000 (13:51 -0700)
commit97b5b3f9741049b9496e76bbb6f867c5aa89203b
treecf2428e2ef1532523a1b69914c84778f6c814d5e
parent1848f61a16c75c4a970a56dd4d9c5da007315738
net/mlx5e: Use fragments of the same size in non-linear legacy RQ with XDP

XDP multi buffer implementation in the kernel assumes that all fragments
have the same size. bpf_xdp_frags_increase_tail uses this assumption to
get the size of the last fragment, and __xdp_build_skb_from_frame uses
it to calculate truesize as nr_frags * xdpf->frame_sz.

The current implementation of mlx5e uses fragments of different size in
non-linear legacy RQ. Specifically, the last fragment can be larger than
the others. It's an optimization for packets smaller than MTU.

This commit adapts mlx5e to the kernel limitations and makes it use
fragments of the same size, in order to add support for XDP multi
buffer. The change is applied only if XDP is active, otherwise the old
optimization still applies.

Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/params.c