netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yevgeny Kliteynik <kliteyn@nvidia.com>
To: Wanhui Fu <fuwh1120@163.com>,
	saeedm@nvidia.com, leon@kernel.org, tariqt@nvidia.com,
	mbloch@nvidia.com, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	muhammads@nvidia.com
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org
Subject: Re: [PATCH] net/mlx5: Free the table after storing failure in mlx5dr_domain_get_recalc_cs_ft_addr()
Date: Thu, 26 Nov 2026 22:24:42 +0200	[thread overview]
Message-ID: <ec5bb13d-7ef5-4150-97c6-bed18c7333c1@nvidia.com> (raw)
In-Reply-To: <20261126132229.4028110-1-fuwh1120@163.com>

On 26-Nov-26 15:22, Wanhui Fu wrote:
> If xa_store() fails, the entry recalc_cs_ft has not been stored in
> XArray. Therefore dr_domain_uninit_csum_recalc_fts() would not destroy
> this entry. Just call mlx5dr_fw_destroy_recalc_cs_ft if xa_store() fails.
> 
> Found it by a self-developed static analysis tool and compile-test passed.
> 
> Fixes: c0e90fc2ccaa ("net/mlx5: DR, Support csum recalculation flow table on SFs")
> Signed-off-by: Wanhui Fu <fuwh1120@163.com>
> ---
>   .../net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c  | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c
> index fedefb565a21..3747c217b61c 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c
> @@ -87,8 +87,10 @@ int mlx5dr_domain_get_recalc_cs_ft_addr(struct mlx5dr_domain *dmn,
>   
>   		ret = xa_err(xa_store(&dmn->csum_fts_xa, vport_num,
>   				      recalc_cs_ft, GFP_KERNEL));
> -		if (ret)
> +		if (ret) {
> +			mlx5dr_fw_destroy_recalc_cs_ft(dmn, recalc_cs_ft);
>   			return ret;
> +		}
>   	}
>   
>   	*rx_icm_addr = recalc_cs_ft->rx_icm_addr;

Reviewed-by: Yevgeny Kliteynik <kliteyn@nvidia.com>

Thanks

      parent reply	other threads:[~2026-11-26 20:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 13:22 [PATCH] net/mlx5: Free the table after storing failure in mlx5dr_domain_get_recalc_cs_ft_addr() Wanhui Fu
2026-11-26 18:35 ` Mark Bloch
2026-11-26 20:24 ` Yevgeny Kliteynik [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=ec5bb13d-7ef5-4150-97c6-bed18c7333c1@nvidia.com \
    --to=kliteyn@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=fuwh1120@163.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=muhammads@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 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).