[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5c2e8b25-3987-4d8b-a7ac-e756cc60e2d8@intel.com>
Date: Thu, 19 Dec 2024 11:03:30 +0100
From: Przemek Kitszel <przemyslaw.kitszel@...el.com>
To: Tariq Toukan <tariqt@...dia.com>, Mark Bloch <mbloch@...dia.com>
CC: <netdev@...r.kernel.org>, Saeed Mahameed <saeedm@...dia.com>, Gal Pressman
<gal@...dia.com>, Leon Romanovsky <leonro@...dia.com>, "David S. Miller"
<davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>, Eric Dumazet <edumazet@...gle.com>, Andrew Lunn
<andrew+netdev@...n.ch>
Subject: Re: [PATCH net-next V3 05/11] net/mlx5: fs, retry insertion to hash
table on EBUSY
On 12/18/24 16:09, Tariq Toukan wrote:
> From: Mark Bloch <mbloch@...dia.com>
>
> 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@...dia.com>
> Signed-off-by: Tariq Toukan <tariqt@...dia.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
> index f781f8f169b9..ae1a5705b26d 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
> @@ -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);
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@...el.com>
Powered by blists - more mailing lists