mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-02 15:43:35 -04:00
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 <mbloch@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Link: https://patch.msgid.link/20241219175841.1094544-6-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
31d1356b8f
commit
586face881
@@ -821,11 +821,17 @@ static int insert_fte(struct mlx5_flow_group *fg, struct fs_fte *fte)
|
||||
return index;
|
||||
|
||||
fte->index = index + fg->start_index;
|
||||
retry_insert:
|
||||
ret = rhashtable_insert_fast(&fg->ftes_hash,
|
||||
&fte->hash,
|
||||
rhash_fte);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
if (ret == -EBUSY) {
|
||||
cond_resched();
|
||||
goto retry_insert;
|
||||
}
|
||||
goto err_ida_remove;
|
||||
}
|
||||
|
||||
tree_add_node(&fte->node, &fg->node);
|
||||
list_add_tail(&fte->node.list, &fg->node.children);
|
||||
|
||||
Reference in New Issue
Block a user