net/mlx5e: XDP, Consider large muti-buffer packets in Striding RQ params calculations
authorTariq Toukan <tariqt@nvidia.com>
Mon, 17 Apr 2023 12:18:57 +0000 (15:18 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Apr 2023 07:59:26 +0000 (08:59 +0100)
commit20409abe52b1de8cfdc0565d89b7bc6d159dba35
tree0789a81287cf106bf6e56e2a3696e2f0eb69b6b8
parentabd3f84ecab3ab90161c9ba49052ac4ca33a0ed3
net/mlx5e: XDP, Consider large muti-buffer packets in Striding RQ params calculations

Function mlx5e_rx_get_linear_stride_sz() returns PAGE_SIZE immediately
in case an XDP program is attached. The more accurate formula is
ALIGN(sz, PAGE_SIZE), to prevent two packets from residing on the same
page.

The assumption behind the current code is that sz <= PAGE_SIZE holds for
all cases with XDP program set.

This is true because it is being called from:
- 3 times from Striding RQ flows, in which XDP is not supported for such
  large packets.
- 1 time from Legacy RQ flow, under the condition
  mlx5e_rx_is_linear_skb().

No functional change here, just removing the implied assumption in
preparation for supporting XDP multi-buffer in Striding RQ.

Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en/params.c