From: Cosmin Ratiu <cratiu@nvidia.com>
To: Tariq Toukan <tariqt@nvidia.com>,
"netdev-bot+sashiko@kernel.org" <netdev-bot+sashiko@kernel.org>
Cc: "parri.andrea@gmail.com" <parri.andrea@gmail.com>,
"doruk@0sec.ai" <doruk@0sec.ai>,
Boris Pismenny <borisp@nvidia.com>,
"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
"daniel.zahka@gmail.com" <daniel.zahka@gmail.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"davem@davem-thinkpadp1gen8.ibmlond.csb"
<davem@davem-thinkpadp1gen8.ibmlond.csb>,
"sd@queasysnail.net" <sd@queasysnail.net>,
"edumazet@kernel.org" <edumazet@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"willemb@google.com" <willemb@google.com>,
"joasantonio108@gmail.com" <joasantonio108@gmail.com>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
Jianbo Liu <jianbol@nvidia.com>,
Carolina Jubran <cjubran@nvidia.com>,
Dragos Tatulea <dtatulea@nvidia.com>,
"lcy8047@gmail.com" <lcy8047@gmail.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"leon@kernel.org" <leon@kernel.org>,
"ralf@mandelbit.com" <ralf@mandelbit.com>,
Mark Bloch <mbloch@nvidia.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"aleksandr.loktionov@intel.com" <aleksandr.loktionov@intel.com>,
Gal Pressman <gal@nvidia.com>, Saeed Mahameed <saeedm@nvidia.com>,
"horms@kernel.org" <horms@kernel.org>,
Patrisious Haddad <phaddad@nvidia.com>
Subject: Re: [PATCH net-next V5 5/7] net/mlx5e: psp: Move RX marker from ft_metadata to flow_tag
Date: Tue, 1 Dec 2026 15:20:27 +0000 [thread overview]
Message-ID: <65df1d245bdd9c58013032de351ababf9671b6b8.camel@nvidia.com> (raw)
In-Reply-To: <179604045701.3146.674579475787317900@kernel.org>
On Mon, 2026-11-30 at 12:07 +0000, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found more severe
> issue(s) in other patches of this series. This mail is only an FYI,
> in case
> you want to address the nit picks below when you respin.
>
> Low priority / nit picks for your consideration:
>
> - [Low] The layout comment in the new
> drivers/net/ethernet/mellanox/mlx5/core/en_accel/flow_tag.h splits
> the…
>
> --
>
> net/mlx5e: psp: Move RX marker from ft_metadata to flow_tag
>
> This patch moves the PSP RX marker out of ft_metadata, where a
> modify_hdr
> action wrote it, and into the flow_tag set in the flow_context of the
> PSP
> decrypt rule. It adds a new en_accel/flow_tag.h header that defines a
> shared accel flow_tag bit layout and helpers. mlx5e_psp_is_rx_flow()
> now
> reads the protocol ID from the CQE flow_tag.
>
> > diff --git
> > a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/flow_tag.h
> > b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/flow_tag.h
> > new file mode 100644
> > index 0000000000000..b6fcd4b630311
> > --- /dev/null
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/flow_tag.h
>
> [ ... ]
>
> > +/* Unified accel flow_tag layout in CQE sop_drop_qpn [23:0]:
> > + *
> > + * [23:21] = protocol ID (3 bits):
> > + * 0 = none (default)
> > + * 3 = PSP (HW decrypted, PSP header present)
> > + * 1,2,4-7 = reserved
> > + * [20:16] = reserved
> > + * [15:0] = used by other subsystems (e.g. TC).
> > + */
>
> [Severity: Low]
> This isn't a bug, but could this comment be read as saying the accel
> protocol ID and a TC mark can be carried together in one packet's
> flow_tag?
>
> As far as I can tell, there is only one flow_tag per packet. Each FTE
> sets
> the whole value, and the last rule that sets it overwrites the
> earlier
> one. The "net/mlx5e: Generalize TC <-> IPsec mutual exclusion" patch
> in
> this series says the same thing.
>
> The PSP decrypt rule in accel_psp_fs_rx_decrypt_ft_create() writes
> the
> full tag, so bits [15:0] are zero:
>
> spec->flow_context.flags = FLOW_CONTEXT_HAS_TAG;
> spec->flow_context.flow_tag =
> FIELD_PREP(MLX5E_ACCEL_FLOW_TAG_PROTO_MASK,
> MLX5E_ACCEL_FLOW_TAG_PROTO_PSP);
>
> mlx5e_add_offloaded_nic_rule() in en_tc.c also always writes the
> whole
> tag:
>
> flow_context->flags |= FLOW_CONTEXT_HAS_TAG;
> flow_context->flow_tag = nic_attr->flow_tag;
>
> Both mlx5e_psp_is_rx_flow() and mlx5e_build_rx_skb() read this same
> field:
>
> skb->mark = be32_to_cpu(cqe->sop_drop_qpn) &
> MLX5E_TC_FLOW_ID_MASK;
>
> Today this works only because TC offload and accel RX offload are
> mutually
> exclusive. That comes from the earlier patches in the series, such as
> "net/mlx5e: psp: Block TC offload when PSP is enabled". This header
> does
> not mention that.
>
> The same comment stays at the end of the series, which only adds
> IPsec=1
> and MACsec=2.
>
> Would it help to say in this comment that each packet's flow_tag has
> one
> effective writer? It could also say that the [15:0] split only keeps
> the
> TC and accel value ranges from overlapping, and that TC offload and
> accel
> RX offload are mutually exclusive.
>
> > +#define MLX5E_ACCEL_FLOW_TAG_MASK GENMASK(23, 0)
> > +#define
> > MLX5E_ACCEL_FLOW_TAG_PROTO_MASK GENMASK(23, 21)
>
> [ ... ]
>
The ranges are intentionally exclusive so that in the future, when
perhaps it will be possible to write only some bits of the flow_tag,
the restriction between TC and accel protocols might be lifted without
having to rewrite all of these markers.
I guess a comment along these lines could be added, but unless there
are other suggestions to the series I'd prefer to avoid another
submission just for this extra comment.
Cosmin.
next prev parent reply other threads:[~2026-12-01 15:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-29 12:03 [PATCH net-next V5 0/7] net/mlx5e: Prepare for PSP decapsulation Tariq Toukan
2026-11-29 12:03 ` [PATCH net-next V5 1/7] net/mlx5e: Generalize TC <-> IPsec mutual exclusion Tariq Toukan
2026-11-30 12:07 ` netdev-bot+sashiko
2026-12-01 14:57 ` Cosmin Ratiu
2026-11-29 12:03 ` [PATCH net-next V5 2/7] net/mlx5e: ipsec: Block TC offload when IPsec is enabled Tariq Toukan
2026-11-29 12:03 ` [PATCH net-next V5 3/7] net/mlx5e: psp: Block TC offload when PSP " Tariq Toukan
2026-11-29 12:03 ` [PATCH net-next V5 4/7] net/mlx5e: macsec: Block TC offload when MACsec " Tariq Toukan
2026-11-30 12:07 ` netdev-bot+sashiko
2026-12-01 15:05 ` Cosmin Ratiu
2026-11-29 12:03 ` [PATCH net-next V5 5/7] net/mlx5e: psp: Move RX marker from ft_metadata to flow_tag Tariq Toukan
2026-11-30 12:07 ` netdev-bot+sashiko
2026-12-01 15:20 ` Cosmin Ratiu [this message]
2026-11-29 12:03 ` [PATCH net-next V5 6/7] net/mlx5e: ipsec: " Tariq Toukan
2026-11-29 12:03 ` [PATCH net-next V5 7/7] net/mlx5e: macsec: " Tariq Toukan
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=65df1d245bdd9c58013032de351ababf9671b6b8.camel@nvidia.com \
--to=cratiu@nvidia.com \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=borisp@nvidia.com \
--cc=cjubran@nvidia.com \
--cc=daniel.zahka@gmail.com \
--cc=davem@davem-thinkpadp1gen8.ibmlond.csb \
--cc=davem@davemloft.net \
--cc=doruk@0sec.ai \
--cc=dtatulea@nvidia.com \
--cc=edumazet@kernel.org \
--cc=gal@nvidia.com \
--cc=horms@kernel.org \
--cc=jianbol@nvidia.com \
--cc=joasantonio108@gmail.com \
--cc=kuba@kernel.org \
--cc=lcy8047@gmail.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=netdev-bot+sashiko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=parri.andrea@gmail.com \
--cc=phaddad@nvidia.com \
--cc=ralf@mandelbit.com \
--cc=saeedm@nvidia.com \
--cc=sd@queasysnail.net \
--cc=tariqt@nvidia.com \
--cc=willemb@google.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
all inboxes | Powered by JetHome®