All of lore.kernel.org
 help / color / mirror / Atom feed
From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Tariq Toukan <tariqt@nvidia.com>, Mark Bloch <mbloch@nvidia.com>
Cc: <netdev@vger.kernel.org>, Saeed Mahameed <saeedm@nvidia.com>,
	Gal Pressman <gal@nvidia.com>,
	Leon Romanovsky <leonro@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>
Subject: Re: [PATCH net-next V3 05/11] net/mlx5: fs, retry insertion to hash table on EBUSY
Date: Thu, 19 Dec 2024 11:03:30 +0100	[thread overview]
Message-ID: <5c2e8b25-3987-4d8b-a7ac-e756cc60e2d8@intel.com> (raw)
In-Reply-To: <20241218150949.1037752-6-tariqt@nvidia.com>

On 12/18/24 16:09, Tariq Toukan wrote:
> From: Mark Bloch <mbloch@nvidia.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@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.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@intel.com>

  reply	other threads:[~2024-12-19 10:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-18 15:09 [PATCH net-next V3 00/11] mlx5 misc changes 2024-12-18 Tariq Toukan
2024-12-18 15:09 ` [PATCH net-next V3 01/11] net/mlx5: LAG, Refactor lag logic Tariq Toukan
2024-12-18 15:09 ` [PATCH net-next V3 02/11] net/mlx5: LAG, Support LAG over Multi-Host NICs Tariq Toukan
2024-12-18 15:09 ` [PATCH net-next V3 03/11] net/mlx5: fs, add counter object to flow destination Tariq Toukan
2024-12-19  9:00   ` Przemek Kitszel
2024-12-19 12:06     ` Moshe Shemesh
2024-12-18 15:09 ` [PATCH net-next V3 04/11] net/mlx5: fs, add mlx5_fs_pool API Tariq Toukan
2024-12-19  9:17   ` Przemek Kitszel
2024-12-19 12:30     ` Moshe Shemesh
2024-12-19 15:12       ` Jakub Kicinski
2024-12-19 15:36       ` Przemek Kitszel
2024-12-18 15:09 ` [PATCH net-next V3 05/11] net/mlx5: fs, retry insertion to hash table on EBUSY Tariq Toukan
2024-12-19 10:03   ` Przemek Kitszel [this message]
2024-12-18 15:09 ` [PATCH net-next V3 06/11] net/mlx5: HWS, no need to expose mlx5hws_send_queues_open/close Tariq Toukan
2024-12-19 10:11   ` Przemek Kitszel
2024-12-18 15:09 ` [PATCH net-next V3 07/11] net/mlx5: HWS, do not initialize native API queues Tariq Toukan
2024-12-18 15:09 ` [PATCH net-next V3 08/11] net/mlx5: DR, expand SWS STE callbacks and consolidate common structs Tariq Toukan
2024-12-18 15:09 ` [PATCH net-next V3 09/11] net/mlx5: DR, add support for ConnectX-8 steering Tariq Toukan
2024-12-18 15:09 ` [PATCH net-next V3 10/11] net/mlx5: Remove PTM support log message Tariq Toukan
2024-12-18 15:09 ` [PATCH net-next V3 11/11] net/mlx5: fs, Add support for RDMA RX steering over IB link layer Tariq Toukan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5c2e8b25-3987-4d8b-a7ac-e756cc60e2d8@intel.com \
    --to=przemyslaw.kitszel@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.