Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v3] selftests: drv-net: devmem: fix 5-tuple flow steering
@ 2026-08-14 20:27 Mina Almasry
  0 siblings, 0 replies; only message in thread
From: Mina Almasry @ 2026-08-14 20:27 UTC (permalink / raw)
  To: netdev, linux-kselftest, linux-kernel
  Cc: Mina Almasry, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Shuah Khan, Bobby Eshleman,
	Stanislav Fomichev, Nikolay Aleksandrov, Breno Leitao

`check_rx` sets the `flow_steer=not hasattr(cfg, 'netns')` kwarg,
which signals `ncdevmem` to attach the client IP as a param (enabling
5-tuple flow steering) when running on the host. However,
`check_rx_hds` currently omits this kwarg, forcing `ncdevmem` to only
support 3-tuple flow steering.

If tests are run on a real NIC that requires 5-tuple steering (e.g.
`gve`), `check_rx_hds` unconditionally fails because `ethtool` rejects
the 3-tuple rule.

Testing on `gve` with `devmem` enabled shows the failure is rectified
when parity is restored to `check_rx_hds`.

Test results before this change:
 # ./devmem.py
 ok 1 devmem.check_rx
 ok 2 devmem.check_tx
 ok 3 devmem.check_tx_chunks
 # Exception| CMD: /usr/src/kernel/tools/testing/selftests/drivers/net/hw/ncdevmem -l -f eth1 -s 192.168.1.89 -p 39105 -L
 # Exception|           Running: ethtool -N eth1 flow-type tcp4 dst-ip 192.168.1.89 dst-port 39105 queue 15
 # Exception|           rmgr: Cannot insert RX class rule: Invalid argument
 # Exception|           ncdevmem: Failed to configure flow steering
 not ok 4 devmem.check_rx_hds

Test results after this change:
 # ./devmem.py
 ok 1 devmem.check_rx
 ok 2 devmem.check_tx
 ok 3 devmem.check_tx_chunks
 ok 4 devmem.check_rx_hds

Signed-off-by: Mina Almasry <almasrymina@google.com>
---
v3:
- Sent as a standalone patch. Dropped Patch 2 (gracefully retry bind)
  from the series as it is no longer needed.
- Dropped the 'extras = [f"-c {cfg.addr}"]' addition to ncdevmem_tx
  as it was unnecessary.
v2: https://lore.kernel.org/all/20260803181852.491437-1-almasrymina@google.com/
---
 tools/testing/selftests/drivers/net/hw/devmem_lib.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/drivers/net/hw/devmem_lib.py b/tools/testing/selftests/drivers/net/hw/devmem_lib.py
index 3554954a6691b..5a519713b2769 100644
--- a/tools/testing/selftests/drivers/net/hw/devmem_lib.py
+++ b/tools/testing/selftests/drivers/net/hw/devmem_lib.py
@@ -306,7 +306,7 @@ def run_rx_hds(cfg):
         port = rand_port()
 
         listen_cmd = ncdevmem_rx(cfg, port, verify=False,
-                                 fail_on_linear=True)
+                                 fail_on_linear=True, flow_steer=not hasattr(cfg, 'netns'))
         socat = socat_send(cfg, port, buf_size=size)
 
         with bkg(listen_cmd, exit_wait=True, ns=netns) as ncdevmem:

base-commit: 9958e69b98930834a576e156f6458166d1db1c02
-- 
2.55.0.691.gc56d675ccc-goog


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-14 20:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-14 20:27 [PATCH net-next v3] selftests: drv-net: devmem: fix 5-tuple flow steering Mina Almasry

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