From: netdev-bot+sashiko@kernel.org
To: acassen@corp.free.fr
Cc: saeedm@nvidia.com, leon@kernel.org, tariqt@nvidia.com,
mbloch@nvidia.com, jhs@mojatatu.com, jiri@resnulli.us,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
michael.chan@broadcom.com, pavan.chebbi@broadcom.com,
bharat@chelsio.com, donald.hunter@gmail.com, corbet@lwn.net,
skhan@linuxfoundation.org, rdunlap@infradead.org,
dsahern@kernel.org, idosch@nvidia.com, shuah@kernel.org,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org,
oss-drivers@corigine.com
Subject: Re: [PATCH net-next v2 10/10] docs: networking: describe tunnel key partitioning in TC queue filtering
Date: Fri, 20 Nov 2026 03:30:46 +0000 [thread overview]
Message-ID: <179514544619.3136.11935885435056519543@kernel.org> (raw)
In-Reply-To: <20261117092915.255194-11-acassen@corp.free.fr>
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 new 'Tunnel key partitioning' text in
Documentation/networking/tc-queue-filters.rst (lines 39-56) uses a…
- [Low] The mlx5 paragraph in Documentation/networking/tc-queue-
filters.rst (lines 51-56) says a masked enc_key_id filter "runs on a…
- [Low] Documentation/networking/tc-queue-filters.rst (lines 39-47)
describes splitting "the key space of a tunnel" into blocks, and its…
--
docs: networking: describe tunnel key partitioning in TC queue filtering
This commit documents tunnel key partitioning, where a filter with a mask
on enc_key_id steers a block of tunnel flows to an RX queue. It gives a
GTP-U example, describes what enc_key_id means on an mlx5 physical port,
and explains what happens to the filter's traffic when its channel goes
away.
> diff --git a/Documentation/networking/tc-queue-filters.rst b/Documentation/networking/tc-queue-filters.rst
> index 6b417092276f6..14032375d6308 100644
> --- a/Documentation/networking/tc-queue-filters.rst
> +++ b/Documentation/networking/tc-queue-filters.rst
> @@ -35,3 +35,25 @@ queues and/or a single queue are supported as below:
> devices, TC filter directing traffic to a queue have higher
> priority over flow director filter assigning a queue. The hash
> filter has lowest priority.
> +
> +Tunnel key partitioning splits the key space of a tunnel into blocks. One
> +filter with a mask on enc_key_id steers a block to its own queue. This
> +helps with traffic that RSS cannot spread because its hashed fields barely
> +vary, such as GTP-U tunnels between a few endpoints::
> +
> + # GTP-U TEIDs whose two top bits are 01 go to queue 1
> + tc filter add dev eth0 ingress protocol ip flower skip_sw \
> + ip_proto udp dst_port 2152 enc_key_id 0x40000000/0xc0000000 \
> + action skbedit queue_mapping 1 skip_sw
[Severity: Low]
Does this example work on mlx5 with the default firmware configuration?
mlx5e_tc_tun_parse_outer_key_gtp() refuses the filter unless the firmware
reports the GTP-U TEID flex parser:
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_gtp.c:mlx5e_tc_tun_parse_outer_key_gtp() {
...
if (!(MLX5_CAP_GEN(priv->mdev, flex_parser_protocols) &
MLX5_FLEX_PARSER_GTPU_TEID_ENABLED)) {
NL_SET_ERR_MSG_MOD(extack,
"Matching on GTP-U TEID is not supported");
return -EOPNOTSUPP;
}
...
}
The GENEVE selector also needs a flex parser bit (MLX5_FLEX_PROTO_GENEVE,
checked through mlx5e_tc_tun_can_offload_geneve()). The preceding commit
"net/mlx5e: TC, match the tunnel key without a tunnel device" says "GTP-U
needs flex parser profile 3 and GENEVE profile 0". That means the 2152 and
6081 selectors listed further down cannot both be available at once.
If the firmware default is profile 0, the firmware will refuse this
example, and the extack message does not mention the flex parser profile.
Could the text mention this firmware dependency?
Also, the example passes skip_sw on the filter, but the text only implies
that it is required ("Only the hardware can match the key").
mlx5e_tc_tun_parse_outer_key() refuses the offload without it:
if (!f->common.skip_sw) {
NL_SET_ERR_MSG_MOD(extack,
"enc_key_id without a tunnel device requires skip_sw");
return -EOPNOTSUPP;
}
Would it help to state that requirement explicitly?
> +
> +Not all drivers can program a partial mask.
> +
> +On mlx5 devices such a filter runs on a physical port where nothing
> +decapsulates the packet. All the keys describe the packet on the wire.
[Severity: Low]
Is "physical port" the full scope here? __parse_cls_flower() calls
mlx5e_tc_tun_parse_outer_key() for any filter_dev that is not a tunnel
device. That includes FDB flows on VF representors:
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c:mlx5e_tc_tun_parse_outer_key() {
...
if (fs_type == FS_FT_FDB && !mlx5e_is_uplink_rep(priv) &&
esw->offloads.inline_mode != MLX5_INLINE_MODE_NONE) {
NL_SET_ERR_MSG_MOD(extack,
"Flow is not offloaded due to min inline setting");
return -EOPNOTSUPP;
}
...
}
On a VF representor the keys describe what the VF sent, not the packet on
the physical wire. The text also does not mention the min inline
requirement.
Separately, the example's action is only registered for NIC flows:
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.c:tc_acts_nic[] {
...
[FLOW_ACTION_RX_QUEUE_MAPPING] = &mlx5e_tc_act_rx_queue,
...
}
tc_acts_fdb[] has no such entry, and mlx5e_tc_act_get() uses tc_acts_fdb
for MLX5_FLOW_NAMESPACE_FDB. Wouldn't the documented command then be
refused on the uplink representor in switchdev mode, even though that is
the physical port?
Could the paragraph say that queue_mapping steering only applies to NIC
(legacy mode) flows?
> +enc_key_id is the only tunnel key such a filter matches.
> +ip_proto 0x2f, or udp with dst_port 2152, 4789 or 6081, tells the hardware
> +which tunnel header holds the key. The software datapath has no tunnel
[Severity: Low]
Should this mention that VXLAN (4789) and GENEVE (6081) carry a 24 bit
VNI? The example above partitions on the top two bits of a 32 bit key,
but both parsers refuse keys that do not fit in 24 bits:
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c:mlx5e_tc_tun_parse_outer_key_vxlan() {
...
if (key >= MLX5E_TC_TUN_N_VNI) {
NL_SET_ERR_MSG_MOD(extack,
"Tunnel key does not fit the 24 bit VNI");
return -EOPNOTSUPP;
}
...
}
mlx5e_tc_tun_parse_outer_key_geneve() has the same check. So a filter that
copies the example with dst_port 4789 and enc_key_id
0x40000000/0xc0000000 would be refused. For those tunnels the top of the
key space is bits 23:22, not 31:30.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117092915.255194-1-acassen%40corp.free.fr
prev parent reply other threads:[~2026-11-20 3:30 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 9:29 [PATCH net-next v2 00/10] tc flower: tunnel key partitioning for RX queue steering Alexandre Cassen
2026-11-17 9:29 ` [PATCH net-next v2 01/10] bnxt_en: require an exact tunnel id in TC flows Alexandre Cassen
2026-11-18 9:29 ` sashiko-bot
2026-11-17 9:29 ` [PATCH net-next v2 02/10] cxgb4: flower: refuse a tunnel key wider than the VNI Alexandre Cassen
2026-11-17 14:05 ` Potnuri Bharat Teja
2026-11-18 9:29 ` sashiko-bot
2026-11-17 9:29 ` [PATCH net-next v2 03/10] nfp: " Alexandre Cassen
2026-11-18 9:29 ` sashiko-bot
2026-11-17 9:29 ` [PATCH net-next v2 04/10] net/mlx5e: TC, " Alexandre Cassen
2026-11-18 9:29 ` sashiko-bot
2026-11-17 9:29 ` [PATCH net-next v2 05/10] net/mlx5e: TC, reject a partial tunnel key with tunnel mapping Alexandre Cassen
2026-11-18 9:29 ` sashiko-bot
2026-11-20 3:30 ` netdev-bot+sashiko
2026-11-17 9:29 ` [PATCH net-next v2 06/10] net/sched: cls_flower: add enc_key_id mask Alexandre Cassen
2026-11-18 9:29 ` sashiko-bot
2026-11-17 9:29 ` [PATCH net-next v2 07/10] selftests: forwarding: tc_flower: test the " Alexandre Cassen
2026-11-18 9:29 ` sashiko-bot
2026-11-20 3:30 ` netdev-bot+sashiko
2026-11-17 9:29 ` [PATCH net-next v2 08/10] net/mlx5e: TC, offload RX queue mapping in NIC flows Alexandre Cassen
2026-11-18 9:29 ` sashiko-bot
2026-11-20 3:30 ` netdev-bot+sashiko
2026-11-17 9:29 ` [PATCH net-next v2 09/10] net/mlx5e: TC, match the tunnel key without a tunnel device Alexandre Cassen
2026-11-18 9:29 ` sashiko-bot
2026-11-20 3:30 ` netdev-bot+sashiko
2026-11-17 9:29 ` [PATCH net-next v2 10/10] docs: networking: describe tunnel key partitioning in TC queue filtering Alexandre Cassen
2026-11-18 9:29 ` sashiko-bot
2026-11-20 3:30 ` netdev-bot+sashiko [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=179514544619.3136.11935885435056519543@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=acassen@corp.free.fr \
--cc=andrew+netdev@lunn.ch \
--cc=bharat@chelsio.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@corigine.com \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=rdunlap@infradead.org \
--cc=saeedm@nvidia.com \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--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