net/mlx5e: Add param helper to calculate max page size

This function will be necessary to determine the upper limit of
rx-page-size.

Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260223204155.1783580-15-tariqt@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Dragos Tatulea 2026-02-23 22:41:54 +02:00 committed by Paolo Abeni
parent 585cfa99d3
commit 5b6e0ddb36
2 changed files with 13 additions and 0 deletions

View File

@ -501,6 +501,18 @@ u16 mlx5e_get_rq_headroom(struct mlx5_core_dev *mdev,
return 0;
}
u32 mlx5e_mpwrq_max_page_size(struct mlx5_core_dev *mdev)
{
if (mlx5_core_is_ecpf(mdev))
return PAGE_SIZE;
/* Two MTTs are needed to form an octword. Driver is using a
* single page per MTT for simplicity. Hence the limit of having
* at least 2 pages per WQE.
*/
return BIT(MLX5_MPWRQ_MAX_LOG_WQE_SZ - 1);
}
u16 mlx5e_calc_sq_stop_room(struct mlx5_core_dev *mdev, struct mlx5e_params *params)
{
bool is_mpwqe = MLX5E_GET_PFLAG(params, MLX5E_PFLAG_SKB_TX_MPWQE);

View File

@ -121,6 +121,7 @@ u8 mlx5e_mpwqe_get_min_wqe_bulk(unsigned int wq_sz);
u16 mlx5e_get_rq_headroom(struct mlx5_core_dev *mdev,
struct mlx5e_params *params,
struct mlx5e_rq_opt_param *rqo);
u32 mlx5e_mpwrq_max_page_size(struct mlx5_core_dev *mdev);
/* Build queue parameters */