Re: [PATCH net V2 3/3] net/mlx5e: SHAMPO, Fix header formulas for higher MTUs and 64K pages

From: Simon Horman

Date: Wed Nov 05 2025 - 05:04:22 EST


On Tue, Nov 04, 2025 at 08:48:35AM +0200, Tariq Toukan wrote:
> From: Dragos Tatulea <dtatulea@xxxxxxxxxx>
>
> The MLX5E_SHAMPO_WQ_HEADER_PER_PAGE and
> MLX5E_SHAMPO_LOG_MAX_HEADER_ENTRY_SIZE macros are used directly in
> several places under the assumption that there will always be more
> headers per WQE than headers per page. However, this assumption doesn't
> hold for 64K page sizes and higher MTUs (> 4K). This can be first
> observed during header page allocation: ksm_entries will become 0 during
> alignment to MLX5E_SHAMPO_WQ_HEADER_PER_PAGE.
>
> This patch introduces 2 additional members to the mlx5e_shampo_hd struct
> which are meant to be used instead of the macrose mentioned above.
> When the number of headers per WQE goes below
> MLX5E_SHAMPO_WQ_HEADER_PER_PAGE, clamp the number of headers per
> page and expand the header size accordingly so that the headers
> for one WQE cover a full page.
>
> All the formulas are adapted to use these two new members.
>
> Fixes: 945ca432bfd0 ("net/mlx5e: SHAMPO, Drop info array")
> Signed-off-by: Dragos Tatulea <dtatulea@xxxxxxxxxx>
> Signed-off-by: Tariq Toukan <tariqt@xxxxxxxxxx>

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>