The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Carolina Jubran <cjubran@nvidia.com>
To: Jakub Kicinski <kuba@kernel.org>, Tariq Toukan <tariqt@nvidia.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
	Boris Pismenny <borisp@nvidia.com>,
	Cosmin Ratiu <cratiu@nvidia.com>,
	Daniel Zahka <daniel.zahka@gmail.com>,
	Dragos Tatulea <dtatulea@nvidia.com>,
	Gal Pressman <gal@nvidia.com>, Kees Cook <kees@kernel.org>,
	Leon Romanovsky <leon@kernel.org>,
	linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
	Mark Bloch <mbloch@nvidia.com>, Raed Salem <raeds@nvidia.com>,
	Rahul Rameshbabu <rrameshbabu@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>
Subject: Re: [PATCH net] net/mlx5e: Add mutual exclusion between PSP and PTP TX port timestamping
Date: Mon, 10 Aug 2026 08:50:58 +0300	[thread overview]
Message-ID: <ab0fc9d0-0aca-49d7-a67d-b240286edb1b@nvidia.com> (raw)
In-Reply-To: <20260803180631.5813f758@kernel.org>


On 04/08/2026 4:06, Jakub Kicinski wrote:
> On Wed, 29 Jul 2026 09:51:37 +0300 Tariq Toukan wrote:
>> The WQE flow_table_metadata field is shared by multiple TX offloads:
>> IPsec, MACsec, PTP timestamping and PSP each write to it.
>>
>> Commit [1] resolved the conflicts between IPsec/MACsec and PTP
>> by shifting their markers to bits [8+], leaving PTP's 8-bit metadata
>> index in bits [7:0] without overlap.
>> But then PSP support was added in commit [2], which writes a 32-bit
>> keyid across all bits of flow_table_metadata. Unlike IPsec and MACsec,
>> PTP timestamping applies independently of encryption -- a PSP-encrypted
>> packet can also require a HW timestamp. When both write to the same
>> WQE, the values corrupt each other, leading to wrong PTP timestamp
>> tracking and potentially wrong PSP encryption keys.
> Is the concern about Tx? (please clarify)
> If so, Tx HW timestamps are never guaranteed, why can't we just
> skip timestamping for PSP packets? Only TCP supports PSP, and
> upstream TCP and HW timestamps are pretty much mutually exclusive.


Yes, this is about Tx

You are right. I missed that PSP is TCP only, so it never
selects ptpsq. Thanks for the clarification.

I'll drop this patch and I will revisit how to avoid a metadata
collision without adding overhead on the datapath.


Thanks!


>
>> Prevent the conflict at configuration time by blocking:
>> - Enabling TX-port-TS when PSP has active TX keys.
>> - Adding PSP TX keys when TX-port-TS is already enabled.
> Why catch PSP at the Tx key programming? PSP docs very explicitly
> require drivers to _not_ enable the feature by default. And tx
> keys can't be added if it's disabled. So it would make much more
> sense to catch the enable / config callback of PSP?

      reply	other threads:[~2026-08-10  5:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29  6:51 [PATCH net] net/mlx5e: Add mutual exclusion between PSP and PTP TX port timestamping Tariq Toukan
2026-08-04  1:06 ` Jakub Kicinski
2026-08-10  5:50   ` Carolina Jubran [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=ab0fc9d0-0aca-49d7-a67d-b240286edb1b@nvidia.com \
    --to=cjubran@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=borisp@nvidia.com \
    --cc=cratiu@nvidia.com \
    --cc=daniel.zahka@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=kees@kernel.org \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=raeds@nvidia.com \
    --cc=rrameshbabu@nvidia.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