net/mlx5e: XDP, Exclude headroom and tailroom from memory calculations
authorCarolina Jubran <cjubran@nvidia.com>
Tue, 19 Dec 2023 14:23:07 +0000 (16:23 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 6 Feb 2024 00:45:53 +0000 (16:45 -0800)
commita90f55916f150ced7b2635bedd43676f922ee075
tree57a1602185e9ea04293d1459cf2dc0d9f2e8ae23
parentfb3bfdfcd10609c90911307a545864d2996d951f
net/mlx5e: XDP, Exclude headroom and tailroom from memory calculations

In the case of XDP Multi-Buffer with Striding RQ, an extra
page is allocated for the linear part of non-linear SKBs.

Including headroom and tailroom in the calculation may
result in an unnecessary increase in the amount of memory
allocated. This could be critical, particularly for large
MTUs (e.g. 7975B) and large RQ sizes (e.g. 8192).

In this case, the requested page pool size is 64K, but
32K would be sufficient. This causes a failure due to
exceeding the page pool size limit of 32K.

Exclude headroom and tailroom from SKB size calculations
to reduce page pool size.

Signed-off-by: Carolina Jubran <cjubran@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