Skip to content

Commit 1a72298

Browse files
kliteynkuba-moo
authored andcommitted
net/mlx5: HWS, prevent rehash from filling up the queues
While moving the rules during rehash, CQ is not drained. The flush and drain happens only when all the rules of a certain queue have been moved. This behaviour can lead to accumulating large quantity of rules that haven't got their completion yet, and eventually will fill up the queue and will cause the rehash to fail. Fix this problem by requiring drain once the number of outstanding completions reaches a certain threshold. Fixes: ef94799 ("net/mlx5: HWS, rework rehash loop") 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 4a842b1 commit 1a72298

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ hws_bwc_matcher_move_all_simple(struct mlx5hws_bwc_matcher *bwc_matcher)
8484
struct list_head *rules_list;
8585
u32 pending_rules;
8686
int i, ret = 0;
87+
bool drain;
8788

8889
mlx5hws_bwc_rule_fill_attr(bwc_matcher, 0, 0, &rule_attr);
8990

@@ -111,10 +112,12 @@ hws_bwc_matcher_move_all_simple(struct mlx5hws_bwc_matcher *bwc_matcher)
111112
}
112113

113114
pending_rules++;
115+
drain = pending_rules >=
116+
hws_bwc_get_burst_th(ctx, rule_attr.queue_id);
114117
ret = mlx5hws_bwc_queue_poll(ctx,
115118
rule_attr.queue_id,
116119
&pending_rules,
117-
false);
120+
drain);
118121
if (unlikely(ret)) {
119122
if (ret == -ETIMEDOUT) {
120123
mlx5hws_err(ctx,

0 commit comments

Comments
 (0)