netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Saeed Mahameed <saeed@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>, <netdev@vger.kernel.org>,
	Tariq Toukan <tariqt@nvidia.com>, Gal Pressman <gal@nvidia.com>,
	Leon Romanovsky <leonro@nvidia.com>,
	Mark Bloch <mbloch@nvidia.com>
Subject: Re: [net-next 05/15] net/mlx5: fs, move hardware fte deletion function reset
Date: Thu, 12 Sep 2024 12:01:00 -0700	[thread overview]
Message-ID: <ec5bbfc5-84d3-4eda-977f-64483a7449d2@intel.com> (raw)
In-Reply-To: <20240911201757.1505453-6-saeed@kernel.org>



On 9/11/2024 1:17 PM, Saeed Mahameed wrote:
> From: Mark Bloch <mbloch@nvidia.com>
> 
> Downstream patches will need this as we might not want to reset
> it when a pending rule is connected to the FTE.
> 

At first I didn't quite understand the motivation here but...

> Signed-off-by: Mark Bloch <mbloch@nvidia.com>
> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
> index e32725487702..899d91577a54 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
> @@ -683,6 +683,8 @@ static void del_hw_fte(struct fs_node *node)
>  				       fte->index, fg->id);
>  		node->active = false;
>  	}
> +	/* Avoid double call to del_hw_fte */
> +	fte->node.del_hw_func = NULL;
>  }
>  
>  static void del_sw_fte(struct fs_node *node)
> @@ -2265,8 +2267,6 @@ void mlx5_del_flow_rules(struct mlx5_flow_handle *handle)
>  		tree_remove_node(&handle->rule[i]->node, true);
>  	if (list_empty(&fte->node.children)) {
>  		fte->node.del_hw_func(&fte->node);
> -		/* Avoid double call to del_hw_fte */
> -		fte->node.del_hw_func = NULL;

I see. You were previously clearing del_hw_func after calling the
function. Now, it gets cleared by the del_hw_func implementation?

That does feel slightly brittle to me when thinking about this as an
API. On the other hand, it also seems reasonable to ensure that the
function gets cleared whenever you call it since it should only be
called once?

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

>  		up_write_ref_node(&fte->node, false);
>  		tree_put_node(&fte->node, false);
>  	} else if (fte->dests_size) {


  reply	other threads:[~2024-09-12 19:01 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-11 20:17 [pull request][net-next 00/15] mlx5 updates 2024-09-11 Saeed Mahameed
2024-09-11 20:17 ` [net-next 01/15] net/mlx5: HWS, updated API functions comments to kernel doc Saeed Mahameed
2024-09-12 18:52   ` Jacob Keller
2024-09-13  4:00   ` patchwork-bot+netdevbpf
2024-09-11 20:17 ` [net-next 02/15] net/mlx5: HWS, fixed error flow return values of some functions Saeed Mahameed
2024-09-12 18:52   ` Jacob Keller
2024-09-11 20:17 ` [net-next 03/15] net/mlx5: fs, move steering common function to fs_cmd.h Saeed Mahameed
2024-09-12 18:53   ` Jacob Keller
2024-09-11 20:17 ` [net-next 04/15] net/mlx5: fs, make get_root_namespace API function Saeed Mahameed
2024-09-12 18:54   ` Jacob Keller
2024-09-13  3:23   ` Kalesh Anakkur Purayil
2024-09-11 20:17 ` [net-next 05/15] net/mlx5: fs, move hardware fte deletion function reset Saeed Mahameed
2024-09-12 19:01   ` Jacob Keller [this message]
2024-09-11 20:17 ` [net-next 06/15] net/mlx5: fs, remove unused member Saeed Mahameed
2024-09-12 19:06   ` Jacob Keller
2024-09-11 20:17 ` [net-next 07/15] net/mlx5: fs, separate action and destination into distinct struct Saeed Mahameed
2024-09-12 19:08   ` Jacob Keller
2024-09-11 20:17 ` [net-next 08/15] net/mlx5: fs, add support for no append at software level Saeed Mahameed
2024-09-12 19:10   ` Jacob Keller
2024-09-11 20:17 ` [net-next 09/15] net/mlx5: Add device cap for supporting hot reset in sync reset flow Saeed Mahameed
2024-09-12 19:11   ` Jacob Keller
2024-09-11 20:17 ` [net-next 10/15] net/mlx5: Add support for sync reset using hot reset Saeed Mahameed
2024-09-12 19:12   ` Jacob Keller
2024-09-11 20:17 ` [net-next 11/15] net/mlx5: Skip HotPlug check on " Saeed Mahameed
2024-09-12 19:12   ` Jacob Keller
2024-09-11 20:17 ` [net-next 12/15] net/mlx5: Allow users to configure affinity for SFs Saeed Mahameed
2024-09-12 19:13   ` Jacob Keller
2024-09-13  3:19   ` Kalesh Anakkur Purayil
2024-09-11 20:17 ` [net-next 13/15] net/mlx5: Add NOT_READY command return status Saeed Mahameed
2024-09-12 19:14   ` Jacob Keller
2024-09-13  3:20   ` Kalesh Anakkur Purayil
2024-09-11 20:17 ` [net-next 14/15] net/mlx5e: SHAMPO, Add no-split ethtool counters for header/data split Saeed Mahameed
2024-09-12 19:15   ` Jacob Keller
2024-09-11 20:17 ` [net-next 15/15] net/mlx5e: Match cleanup order in mlx5e_free_rq in reverse of mlx5e_alloc_rq Saeed Mahameed
2024-09-12 19:15   ` Jacob Keller
2024-09-13  3:53 ` [pull request][net-next 00/15] mlx5 updates 2024-09-11 Jakub Kicinski

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=ec5bbfc5-84d3-4eda-977f-64483a7449d2@intel.com \
    --to=jacob.e.keller@intel.com \
    --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=saeed@kernel.org \
    --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 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).