Skip to content

Commit 7c60952

Browse files
kliteynkuba-moo
authored andcommitted
net/mlx5: HWS, don't rehash on every kind of insertion failure
If rule creation failed due to a full queue, due to timeout in polling for completion, or due to matcher being in resize, don't try to initiate rehash sequence - rehash would have failed anyway. Fixes: 2111bb9 ("net/mlx5: HWS, added backward-compatible API handling") Signed-off-by: Yevgeny Kliteynik <[email protected]> Reviewed-by: Vlad Dogaru <[email protected]> Signed-off-by: Mark Bloch <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 1a72298 commit 7c60952

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core/steering/hws

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,21 @@ int mlx5hws_bwc_rule_create_simple(struct mlx5hws_bwc_rule *bwc_rule,
10631063
return 0; /* rule inserted successfully */
10641064
}
10651065

1066+
/* Rule insertion could fail due to queue being full, timeout, or
1067+
* matcher in resize. In such cases, no point in trying to rehash.
1068+
*/
1069+
if (ret == -EBUSY || ret == -ETIMEDOUT || ret == -EAGAIN) {
1070+
mutex_unlock(queue_lock);
1071+
mlx5hws_err(ctx,
1072+
"BWC rule insertion failed - %s (%d)\n",
1073+
ret == -EBUSY ? "queue is full" :
1074+
ret == -ETIMEDOUT ? "timeout" :
1075+
ret == -EAGAIN ? "matcher in resize" : "N/A",
1076+
ret);
1077+
hws_bwc_rule_cnt_dec(bwc_rule);
1078+
return ret;
1079+
}
1080+
10661081
/* At this point the rule wasn't added.
10671082
* It could be because there was collision, or some other problem.
10681083
* Try rehash by size and insert rule again - last chance.

0 commit comments

Comments
 (0)