Linux Documentation
 help / color / mirror / Atom feed
* [PATCH net-next v2 00/10] tc flower: tunnel key partitioning for RX queue steering
@ 2026-11-17  9:29 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
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Alexandre Cassen @ 2026-11-17  9:29 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, Mark Bloch,
	Jamal Hadi Salim, Jiri Pirko
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, Michael Chan, Pavan Chebbi,
	Potnuri Bharat Teja, Donald Hunter, Jonathan Corbet, Shuah Khan,
	Randy Dunlap, David Ahern, Ido Schimmel, Shuah Khan, netdev,
	linux-rdma, linux-doc, linux-kselftest, oss-drivers,
	Asbjørn Sloth Tønnesen

RSS cant spread GTP-U traffic between a few endpoints. The outer headers
barely vary and mlx5 does not hash the TEID. One flower rule per TEID does
not scale.

Add a mask to the flower enc_key_id key and offload it on mlx5e NIC flows
with skbedit queue_mapping. One rule then steers a block of tunnel keys to
an RX queue. This "tunnel key partitioning" supports fine-grained session
placement. In a 5G mobile network, the UPF can place a session on a CPU by
allocating its TEID from the right block [1]. Any scheduling algorithm can
then pick that block.

  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

This series generalize an earlier GTP-U work [2] to other tunnels that the
ConnectX family can steer: GRE, VXLAN and GENEVE.

Patches 1 to 5 refuse a partial mask or a key wider than the VNI where a
driver cant honor them. Patches 6 and 7 add the flower mask and its test.
Patch 8 adds queue mapping to mlx5e NIC flows. Patch 9 adds the tunnel key
match to mlx5e NIC and eswitch flows without a tunnel device. Patch 10
documents the result.

Without a tunnel device nothing decapsulates. enc_key_id reads the tunnel
header on the wire like on cxgb4 and hns3. On mlx5 the plain ip_proto and
dst_port keys select the match register. A rule without a tunnel device
used to ignore enc_key_id and now matches it or gets refused. I can rework
patch 9 on a dedicated key if that looks cleaner.

Tested on ConnectX-7 with firmware 28.48.1000 in NIC mode. Also tested on
the uplink and VF representors in dmfs, smfs and hmfs. This includes
redirect to a VF. GTP-U needs flex parser profile 3 and GENEVE profile 0.
The bnxt, cxgb4 and nfp patches are build tested only. So is the min
inline check of patch 9, because ConnectX-7 needs no inlining. The selftest
passes under User-Mode Linux and fails on a kernel without the mask.

Multiple AI tools were used to test this feature. They found the problems
fixed by patches 1 to 5.

The iproute2 support is posted separately.

v2:
- cxgb4: also refuse a mask that leaves no VNI bit.
- cxgb4, nfp and mlx5: add Fixes tags.
- selftest: run the enc_key_id mask test in software only.
- mlx5 queue mapping: refuse it after any terminating action.
- mlx5 outer key: refuse other tunnel keys and representors that need
  inlining.
- docs: drop a wrong sentence about skip_sw and name the tunnel ports.
- nfp and selftest: wrap two lines over 80 columns.
The first six follow the Sashiko review of v1 [3].

v1: https://lore.kernel.org/netdev/20261109131039.959438-1-acassen@corp.free.fr/
[1] https://gtp-guard.org/articles/5g-upf-pump-up-the-volume/#benefits-of-range-partitioning
[2] https://github.com/acassen/research/tree/main/UPF-flow-steering
[3] https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261109131039.959438-1-acassen%40corp.free.fr

Alexandre Cassen (10):
  bnxt_en: require an exact tunnel id in TC flows
  cxgb4: flower: refuse a tunnel key wider than the VNI
  nfp: flower: refuse a tunnel key wider than the VNI
  net/mlx5e: TC, refuse a tunnel key wider than the VNI
  net/mlx5e: TC, reject a partial tunnel key with tunnel mapping
  net/sched: cls_flower: add enc_key_id mask
  selftests: forwarding: tc_flower: test the enc_key_id mask
  net/mlx5e: TC, offload RX queue mapping in NIC flows
  net/mlx5e: TC, match the tunnel key without a tunnel device
  docs: networking: describe tunnel key partitioning in TC queue
    filtering

 Documentation/netlink/specs/tc.yaml           |   4 +
 Documentation/networking/tc-queue-filters.rst |  22 ++++
 drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c  |   7 ++
 .../ethernet/chelsio/cxgb4/cxgb4_tc_flower.c  |  15 +++
 .../net/ethernet/mellanox/mlx5/core/Makefile  |   6 +-
 .../mellanox/mlx5/core/en/tc/act/act.c        |   1 +
 .../mellanox/mlx5/core/en/tc/act/act.h        |   1 +
 .../mellanox/mlx5/core/en/tc/act/rx_queue.c   |  67 +++++++++++
 .../ethernet/mellanox/mlx5/core/en/tc_tun.c   | 110 ++++++++++++++++++
 .../ethernet/mellanox/mlx5/core/en/tc_tun.h   |  14 +++
 .../mellanox/mlx5/core/en/tc_tun_geneve.c     |  46 ++++++++
 .../mellanox/mlx5/core/en/tc_tun_gre.c        |  31 +++++
 .../mellanox/mlx5/core/en/tc_tun_gtp.c        |  36 ++++++
 .../mellanox/mlx5/core/en/tc_tun_vxlan.c      |  45 +++++++
 .../net/ethernet/mellanox/mlx5/core/en_tc.c   |  19 +++
 .../net/ethernet/mellanox/mlx5/core/en_tc.h   |   1 +
 .../ethernet/netronome/nfp/flower/offload.c   |  22 ++++
 include/uapi/linux/pkt_cls.h                  |   2 +
 net/sched/cls_flower.c                        |   5 +-
 .../selftests/net/forwarding/tc_flower.sh     |  54 +++++++++
 20 files changed, 504 insertions(+), 4 deletions(-)
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/rx_queue.c
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_gtp.c

-- 
2.43.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-11-17 14:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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-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-17  9:29 ` [PATCH net-next v2 03/10] nfp: " Alexandre Cassen
2026-11-17  9:29 ` [PATCH net-next v2 04/10] net/mlx5e: TC, " Alexandre Cassen
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-17  9:29 ` [PATCH net-next v2 06/10] net/sched: cls_flower: add enc_key_id mask Alexandre Cassen
2026-11-17  9:29 ` [PATCH net-next v2 07/10] selftests: forwarding: tc_flower: test the " Alexandre Cassen
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-17  9:29 ` [PATCH net-next v2 09/10] net/mlx5e: TC, match the tunnel key without a tunnel device Alexandre Cassen
2026-11-17  9:29 ` [PATCH net-next v2 10/10] docs: networking: describe tunnel key partitioning in TC queue filtering Alexandre Cassen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox