public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: daniel.zahka@gmail.com
Cc: Jakub Kicinski <kuba@kernel.org>,
	linux-kselftest@vger.kernel.org, tariqt@nvidia.com,
	shuah@kernel.org, borisp@nvidia.com, leon@kernel.org,
	davem@davemloft.net, horms@kernel.org, andrew+netdev@lunn.ch,
	netdev@vger.kernel.org, saeedm@nvidia.com, edumazet@google.com,
	willemdebruijn.kernel@gmail.com, donald.hunter@gmail.com,
	pabeni@redhat.com, mbloch@nvidia.com
Subject: Re: [net-next,7/9] mlx5: psp: implement deferred tx key deletion
Date: Fri,  6 Feb 2026 20:32:12 -0800	[thread overview]
Message-ID: <20260207043212.4129693-1-kuba@kernel.org> (raw)
In-Reply-To: <20260204-psp-v1-7-5f034e2dfa36@gmail.com>

This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.

For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
mlx5: psp: implement deferred tx key deletion

This patch implements the deferred tx key deletion API for mlx5. The
mlx5e_psp_tx_grace_begin() function records WQE counts on each tx queue,
and mlx5e_psp_tx_grace_end() returns success only after all tx queues
have advanced a full ring cycle past the snapshot point.

> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.h b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.h
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.h
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.h
> @@ -22,10 +22,17 @@ struct mlx5e_psp_stats {
>  	u64 psp_tx_bytes_drop;
>  };
>
> +struct mlx5e_psp_tx_snapshot {
> +	int num_channels;
> +	int num_tc;
> +	u64 wqes[];
> +};
> +
>  struct mlx5e_psp {
>  	struct psp_dev *psp;
>  	struct psp_dev_caps caps;
>  	struct mlx5e_psp_fs *fs;
> +	struct mlx5e_psp_tx_snapshot *tx_snapshot;
>  	atomic_t tx_key_cnt;
>  	atomic_t tx_drop;
>  };

Can the tx_snapshot allocation be leaked during device teardown?

If mlx5e_psp_tx_grace_begin() is called and allocates tx_snapshot, but
mlx5e_psp_cleanup() runs before mlx5e_psp_tx_grace_end() frees it:

    mlx5e_psp_cleanup()
        kfree(psp);   // psp->tx_snapshot not freed

The tx_snapshot memory would be leaked. Should mlx5e_psp_cleanup() free
psp->tx_snapshot before freeing psp?

  parent reply	other threads:[~2026-02-07  4:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04 15:20 [PATCH net-next 0/9] psp: support rekeying psp protected tcp connections Daniel Zahka
2026-02-04 15:20 ` [PATCH net-next 1/9] psp: support rx rekey operation Daniel Zahka
2026-02-07  4:24   ` Jakub Kicinski
2026-02-07  4:32   ` [net-next,1/9] " Jakub Kicinski
2026-02-04 15:20 ` [PATCH net-next 2/9] psp: move code from psp_sock_assoc_set_tx() into helper functions Daniel Zahka
2026-02-04 20:46   ` Willem de Bruijn
2026-02-04 15:20 ` [PATCH net-next 3/9] psp: support tx rekey operation Daniel Zahka
2026-02-04 15:20 ` [PATCH net-next 4/9] psp: refactor psp_dev_tx_key_del() Daniel Zahka
2026-02-04 20:46   ` Willem de Bruijn
2026-02-04 15:20 ` [PATCH net-next 5/9] psp: add driver api for deferred tx key deletion Daniel Zahka
2026-02-04 15:20 ` [PATCH net-next 6/9] psp: add core tracked stats for deferred " Daniel Zahka
2026-02-04 15:20 ` [PATCH net-next 7/9] mlx5: psp: implement deferred tx " Daniel Zahka
2026-02-07  4:30   ` Jakub Kicinski
2026-02-07  4:32   ` Jakub Kicinski [this message]
2026-02-04 15:20 ` [PATCH net-next 8/9] selftests: drv-net: psp: lift psp connection setup out of _data_basic_send() testcase Daniel Zahka
2026-02-04 20:49   ` Willem de Bruijn
2026-02-04 15:20 ` [PATCH net-next 9/9] selftests: drv-net: psp: add tests for rekeying connections Daniel Zahka
2026-02-04 20:45 ` [PATCH net-next 0/9] psp: support rekeying psp protected tcp connections Willem de Bruijn
2026-02-04 21:43   ` Daniel Zahka
2026-02-07  4:18     ` Jakub Kicinski
2026-02-07  4:21 ` 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=20260207043212.4129693-1-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=borisp@nvidia.com \
    --cc=daniel.zahka@gmail.com \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=shuah@kernel.org \
    --cc=tariqt@nvidia.com \
    --cc=willemdebruijn.kernel@gmail.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