Skip to content

Commit 586face

Browse files
mark-blochkuba-moo
authored andcommitted
net/mlx5: fs, retry insertion to hash table on EBUSY
When inserting into an rhashtable faster than it can grow, an -EBUSY error may be encountered. Modify the insertion logic to retry on -EBUSY until either a successful insertion or a genuine error is returned. Signed-off-by: Mark Bloch <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Reviewed-by: Przemek Kitszel <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 31d1356 commit 586face

File tree

1 file changed

+7
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+7
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,11 +821,17 @@ static int insert_fte(struct mlx5_flow_group *fg, struct fs_fte *fte)
821821
return index;
822822

823823
fte->index = index + fg->start_index;
824+
retry_insert:
824825
ret = rhashtable_insert_fast(&fg->ftes_hash,
825826
&fte->hash,
826827
rhash_fte);
827-
if (ret)
828+
if (ret) {
829+
if (ret == -EBUSY) {
830+
cond_resched();
831+
goto retry_insert;
832+
}
828833
goto err_ida_remove;
834+
}
829835

830836
tree_add_node(&fte->node, &fg->node);
831837
list_add_tail(&fte->node.list, &fg->node.children);

0 commit comments

Comments
 (0)