Skip to content

Commit c6f0420

Browse files
nvmmaxkuba-moo
authored andcommitted
net/mlx5e: xsk: Print a warning in slow configurations
On striding RQ, when the XSK frame size doesn't match the MKey page size, KLM is used for memory mappings, which is a slower mechanism than MTT or KSM. It may happen in two cases: 1. Frame size is not a power of two (only possible in the unaligned mode of XSK). 2. Frame size is 2048 bytes, and the firmware doesn't support MKey pages smaller than 4096 bytes. Depending on the case, print a warning and recommend to disable striding RQ or upgrade the firmware. Signed-off-by: Maxim Mikityanskiy <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 1392134 commit c6f0420

File tree

1 file changed

+9
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en/xsk

1 file changed

+9
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/xsk/pool.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ static int mlx5e_xsk_enable_locked(struct mlx5e_priv *priv,
9999

100100
mlx5e_build_xsk_param(pool, &xsk);
101101

102+
if (priv->channels.params.rq_wq_type == MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ &&
103+
mlx5e_mpwrq_umr_mode(priv->mdev, &xsk) == MLX5E_MPWRQ_UMR_MODE_OVERSIZED) {
104+
const char *recommendation = is_power_of_2(xsk.chunk_size) ?
105+
"Upgrade firmware" : "Disable striding RQ";
106+
107+
mlx5_core_warn(priv->mdev, "Expected slowdown with XSK frame size %u. %s for better performance.\n",
108+
xsk.chunk_size, recommendation);
109+
}
110+
102111
if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {
103112
/* XSK objects will be created on open. */
104113
goto validate_closed;

0 commit comments

Comments
 (0)