Commit 0bbcc0a8 authored by Gil Rockah's avatar Gil Rockah Committed by David S. Miller

net/mlx5e: Remove WARN_ONCE from adaptive moderation code

When trying to do interface down or changing interface configuration
under heavy traffic, some of the adaptive moderation corner cases can
occur and leave a WARN_ONCE call trace in the kernel log.

Those WARN_ONCE are meant for debug only, and should have been inserted
only under debug. We avoid such call traces by removing those WARN_ONCE.

Fixes: cb3c7fd4 ("net/mlx5e: Support adaptive RX coalescing")
Signed-off-by: default avatarGil Rockah <gilr@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3deef8ce
...@@ -109,7 +109,6 @@ static bool mlx5e_am_on_top(struct mlx5e_rx_am *am) ...@@ -109,7 +109,6 @@ static bool mlx5e_am_on_top(struct mlx5e_rx_am *am)
switch (am->tune_state) { switch (am->tune_state) {
case MLX5E_AM_PARKING_ON_TOP: case MLX5E_AM_PARKING_ON_TOP:
case MLX5E_AM_PARKING_TIRED: case MLX5E_AM_PARKING_TIRED:
WARN_ONCE(true, "mlx5e_am_on_top: PARKING\n");
return true; return true;
case MLX5E_AM_GOING_RIGHT: case MLX5E_AM_GOING_RIGHT:
return (am->steps_left > 1) && (am->steps_right == 1); return (am->steps_left > 1) && (am->steps_right == 1);
...@@ -123,7 +122,6 @@ static void mlx5e_am_turn(struct mlx5e_rx_am *am) ...@@ -123,7 +122,6 @@ static void mlx5e_am_turn(struct mlx5e_rx_am *am)
switch (am->tune_state) { switch (am->tune_state) {
case MLX5E_AM_PARKING_ON_TOP: case MLX5E_AM_PARKING_ON_TOP:
case MLX5E_AM_PARKING_TIRED: case MLX5E_AM_PARKING_TIRED:
WARN_ONCE(true, "mlx5e_am_turn: PARKING\n");
break; break;
case MLX5E_AM_GOING_RIGHT: case MLX5E_AM_GOING_RIGHT:
am->tune_state = MLX5E_AM_GOING_LEFT; am->tune_state = MLX5E_AM_GOING_LEFT;
...@@ -144,7 +142,6 @@ static int mlx5e_am_step(struct mlx5e_rx_am *am) ...@@ -144,7 +142,6 @@ static int mlx5e_am_step(struct mlx5e_rx_am *am)
switch (am->tune_state) { switch (am->tune_state) {
case MLX5E_AM_PARKING_ON_TOP: case MLX5E_AM_PARKING_ON_TOP:
case MLX5E_AM_PARKING_TIRED: case MLX5E_AM_PARKING_TIRED:
WARN_ONCE(true, "mlx5e_am_step: PARKING\n");
break; break;
case MLX5E_AM_GOING_RIGHT: case MLX5E_AM_GOING_RIGHT:
if (am->profile_ix == (MLX5E_PARAMS_AM_NUM_PROFILES - 1)) if (am->profile_ix == (MLX5E_PARAMS_AM_NUM_PROFILES - 1))
...@@ -282,10 +279,8 @@ static void mlx5e_am_calc_stats(struct mlx5e_rx_am_sample *start, ...@@ -282,10 +279,8 @@ static void mlx5e_am_calc_stats(struct mlx5e_rx_am_sample *start,
u32 delta_us = ktime_us_delta(end->time, start->time); u32 delta_us = ktime_us_delta(end->time, start->time);
unsigned int npkts = end->pkt_ctr - start->pkt_ctr; unsigned int npkts = end->pkt_ctr - start->pkt_ctr;
if (!delta_us) { if (!delta_us)
WARN_ONCE(true, "mlx5e_am_calc_stats: delta_us=0\n");
return; return;
}
curr_stats->ppms = (npkts * USEC_PER_MSEC) / delta_us; curr_stats->ppms = (npkts * USEC_PER_MSEC) / delta_us;
curr_stats->epms = (MLX5E_AM_NEVENTS * USEC_PER_MSEC) / delta_us; curr_stats->epms = (MLX5E_AM_NEVENTS * USEC_PER_MSEC) / delta_us;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment