DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bing Zhao <bingz@nvidia.com>
To: Dariusz Sosnowski <dsosnowski@nvidia.com>,
	Slava Ovsiienko <viacheslavo@nvidia.com>,
	Ori Kam <orika@nvidia.com>, Suanming Mou <suanmingm@nvidia.com>,
	Matan Azrad <matan@nvidia.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Gregory Etelson <getelson@nvidia.com>
Subject: RE: [PATCH] net/mlx5: improve error on completing table resize
Date: Tue, 18 Nov 2025 07:39:08 +0000	[thread overview]
Message-ID: <IA4PR12MB9763EC1A5333663F77DAE953D0D6A@IA4PR12MB9763.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20251114192712.1637369-1-dsosnowski@nvidia.com>

Hi,

> -----Original Message-----
> From: Dariusz Sosnowski <dsosnowski@nvidia.com>
> Sent: Saturday, November 15, 2025 3:27 AM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Bing Zhao
> <bingz@nvidia.com>; Ori Kam <orika@nvidia.com>; Suanming Mou
> <suanmingm@nvidia.com>; Matan Azrad <matan@nvidia.com>
> Cc: dev@dpdk.org; Gregory Etelson <getelson@nvidia.com>
> Subject: [PATCH] net/mlx5: improve error on completing table resize
> 
> If flow template table was created with resizable attribute, then
> completing table resize could fail for 2 user-related reasons:
> 
> - not all flow rules were yet updated to use the resized table,
> - resize was not started.
> 
> Both of these were reported with the same error message i.e., "cannot
> complete table resize".
> 
> Since PMD can distinguish these 2 cases, this patch improves the error
> reporting to report these 2 errors separately.
> 
> Also, this patch removes redundant __rte_unused on device parameter.
> 
> Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
> Acked-by: Gregory Etelson <getelson@nvidia.com>
> ---
>  drivers/net/mlx5/mlx5_flow_hw.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_hw.c
> b/drivers/net/mlx5/mlx5_flow_hw.c index 208f50fbfd..8f3c84dec5 100644
> --- a/drivers/net/mlx5/mlx5_flow_hw.c
> +++ b/drivers/net/mlx5/mlx5_flow_hw.c
> @@ -15384,7 +15384,7 @@ flow_hw_table_resize(struct rte_eth_dev *dev,  }
> 
>  static int
> -flow_hw_table_resize_complete(__rte_unused struct rte_eth_dev *dev,
> +flow_hw_table_resize_complete(struct rte_eth_dev *dev,
>  			      struct rte_flow_template_table *table,
>  			      struct rte_flow_error *error)
>  {
> @@ -15398,12 +15398,16 @@ flow_hw_table_resize_complete(__rte_unused
> struct rte_eth_dev *dev,
>  		return rte_flow_error_set(error, EINVAL,
>  					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
>  					  table, "no resizable attribute");
> +	if (matcher_info->matcher == NULL)
> +		return rte_flow_error_set(error, EINVAL,
> +					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
> +					  table, "table resize was not started");
>  	matcher_refcnt = rte_atomic_load_explicit(&matcher_info->refcnt,
>  						  rte_memory_order_relaxed);
> -	if (!matcher_info->matcher || matcher_refcnt)
> +	if (matcher_refcnt > 0)
>  		return rte_flow_error_set(error, EBUSY,
>  					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
> -					  table, "cannot complete table resize");
> +					  table, "all rules not yet updated");
>  	if (matcher_info->jump)
>  		mlx5dr_action_destroy(matcher_info->jump);
>  	ret = mlx5dr_matcher_destroy(matcher_info->matcher);
> --
> 2.39.5

Acked-by: Bing Zhao <bingz@nvidia.com>


      reply	other threads:[~2025-11-18  7:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-14 19:27 Dariusz Sosnowski
2025-11-18  7:39 ` Bing Zhao [this message]

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=IA4PR12MB9763EC1A5333663F77DAE953D0D6A@IA4PR12MB9763.namprd12.prod.outlook.com \
    --to=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=getelson@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=suanmingm@nvidia.com \
    --cc=viacheslavo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).