Skip to content

Commit fab0583

Browse files
lkayal-01kuba-moo
authored andcommitted
net/mlx5e: SHAMPO, Make reserved size independent of page size
When hw-gro is enabled, the maximum number of header entries that are needed per wqe (hd_per_wqe) is calculated based on the size of the reservations among other parameters. Miscalculation of the size of reservations leads to incorrect calculation of hd_per_wqe as 0, particularly in the case of large page size like in aarch64, this prevents the SHAMPO header from being correctly initialized in the device, ultimately causing the following cqe err that indicates a violation of PD. mlx5_core 0000:00:08.0 eth2: ERR CQE on RQ: 0x1180 mlx5_core 0000:00:08.0 eth2: Error cqe on cqn 0x510, ci 0x0, qn 0x1180, opcode 0xe, syndrome 0x4, vendor syndrome 0x32 00000000: 00 00 00 00 04 4a 00 00 00 00 00 00 20 00 93 32 00000010: 55 00 00 00 fb cc 00 00 00 00 00 00 07 18 00 00 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4a 00000030: 00 00 00 9a 93 00 32 04 00 00 00 00 00 00 da e1 Use the correct formula for calculating the size of reservations, precisely it shouldn't be dependent on page size, instead use the correct multiply of MLX5E_SHAMPO_WQ_BASE_RESRV_SIZE. Fixes: e5ca8fb ("net/mlx5e: Add control path for SHAMPO feature") Signed-off-by: Lama Kayal <[email protected]> Reviewed-by: Dragos Tatulea <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent fa37a88 commit fab0583

File tree

1 file changed

+5
-3
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en

1 file changed

+5
-3
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/params.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ u8 mlx5e_shampo_get_log_pkt_per_rsrv(struct mlx5_core_dev *mdev,
430430
struct mlx5e_params *params)
431431
{
432432
u32 resrv_size = BIT(mlx5e_shampo_get_log_rsrv_size(mdev, params)) *
433-
PAGE_SIZE;
433+
MLX5E_SHAMPO_WQ_BASE_RESRV_SIZE;
434434

435435
return order_base_2(DIV_ROUND_UP(resrv_size, params->sw_mtu));
436436
}
@@ -834,7 +834,8 @@ static u32 mlx5e_shampo_get_log_cq_size(struct mlx5_core_dev *mdev,
834834
struct mlx5e_params *params,
835835
struct mlx5e_xsk_param *xsk)
836836
{
837-
int rsrv_size = BIT(mlx5e_shampo_get_log_rsrv_size(mdev, params)) * PAGE_SIZE;
837+
int rsrv_size = BIT(mlx5e_shampo_get_log_rsrv_size(mdev, params)) *
838+
MLX5E_SHAMPO_WQ_BASE_RESRV_SIZE;
838839
u16 num_strides = BIT(mlx5e_mpwqe_get_log_num_strides(mdev, params, xsk));
839840
int pkt_per_rsrv = BIT(mlx5e_shampo_get_log_pkt_per_rsrv(mdev, params));
840841
u8 log_stride_sz = mlx5e_mpwqe_get_log_stride_size(mdev, params, xsk);
@@ -1043,7 +1044,8 @@ u32 mlx5e_shampo_hd_per_wqe(struct mlx5_core_dev *mdev,
10431044
struct mlx5e_params *params,
10441045
struct mlx5e_rq_param *rq_param)
10451046
{
1046-
int resv_size = BIT(mlx5e_shampo_get_log_rsrv_size(mdev, params)) * PAGE_SIZE;
1047+
int resv_size = BIT(mlx5e_shampo_get_log_rsrv_size(mdev, params)) *
1048+
MLX5E_SHAMPO_WQ_BASE_RESRV_SIZE;
10471049
u16 num_strides = BIT(mlx5e_mpwqe_get_log_num_strides(mdev, params, NULL));
10481050
int pkt_per_resv = BIT(mlx5e_shampo_get_log_pkt_per_rsrv(mdev, params));
10491051
u8 log_stride_sz = mlx5e_mpwqe_get_log_stride_size(mdev, params, NULL);

0 commit comments

Comments
 (0)