mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
net/mlx5e: RX, Verify MPWQE stride size is in range
[ Upstream commite1c15b62b7] Add check of MPWQE stride size is within range supported by HW. In case calculated MPWQE stride size exceed range, linear SKB can't be used and we should use non linear MPWQE instead. Fixes:619a8f2a42("net/mlx5e: Use linear SKB in Striding RQ") Signed-off-by: Moshe Shemesh <moshe@mellanox.com> Reviewed-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
78512e3468
commit
fe65dfcca1
@@ -128,6 +128,8 @@ static bool mlx5e_rx_is_linear_skb(struct mlx5_core_dev *mdev,
|
||||
return !params->lro_en && frag_sz <= PAGE_SIZE;
|
||||
}
|
||||
|
||||
#define MLX5_MAX_MPWQE_LOG_WQE_STRIDE_SZ ((BIT(__mlx5_bit_sz(wq, log_wqe_stride_size)) - 1) + \
|
||||
MLX5_MPWQE_LOG_STRIDE_SZ_BASE)
|
||||
static bool mlx5e_rx_mpwqe_is_linear_skb(struct mlx5_core_dev *mdev,
|
||||
struct mlx5e_params *params)
|
||||
{
|
||||
@@ -138,6 +140,9 @@ static bool mlx5e_rx_mpwqe_is_linear_skb(struct mlx5_core_dev *mdev,
|
||||
if (!mlx5e_rx_is_linear_skb(mdev, params))
|
||||
return false;
|
||||
|
||||
if (order_base_2(frag_sz) > MLX5_MAX_MPWQE_LOG_WQE_STRIDE_SZ)
|
||||
return false;
|
||||
|
||||
if (MLX5_CAP_GEN(mdev, ext_stride_num_range))
|
||||
return true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user