mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: tariqt@nvidia.com
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com,
	sd@queasysnail.net, willemb@google.com,
	aleksandr.loktionov@intel.com, parri.andrea@gmail.com,
	borisp@nvidia.com, cjubran@nvidia.com, lcy8047@gmail.com,
	cratiu@nvidia.com, daniel.zahka@gmail.com,
	davem@davem-thinkpadp1gen8.ibmlond.csb, doruk@0sec.ai,
	dtatulea@nvidia.com, gal@nvidia.com, jianbol@nvidia.com,
	joasantonio108@gmail.com, leon@kernel.org,
	linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
	mbloch@nvidia.com, phaddad@nvidia.com, ralf@mandelbit.com,
	saeedm@nvidia.com, horms@kernel.org
Subject: Re: [PATCH net-next V5 5/7] net/mlx5e: psp: Move RX marker from ft_metadata to flow_tag
Date: Mon, 30 Nov 2026 12:07:37 +0000	[thread overview]
Message-ID: <179604045701.3146.674579475787317900@kernel.org> (raw)
In-Reply-To: <20261129120331.1910180-6-tariqt@nvidia.com>

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)

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261129120331.1910180-1-tariqt%40nvidia.com

  reply	other threads:[~2026-11-30 12:07 UTC|newest]

Thread overview: 11+ 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-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-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 [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=179604045701.3146.674579475787317900@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=borisp@nvidia.com \
    --cc=cjubran@nvidia.com \
    --cc=cratiu@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@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®