Netdev List
 help / color / mirror / Atom feed
From: Mina Almasry <almasrymina@google.com>
To: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Cc: Mina Almasry <almasrymina@google.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>,
	 Bobby Eshleman <bobbyeshleman@meta.com>,
	Stanislav Fomichev <sdf@fomichev.me>,
	 Nikolay Aleksandrov <razor@blackwall.org>,
	Breno Leitao <leitao@debian.org>
Subject: [PATCH net-next v3] selftests: drv-net: devmem: fix 5-tuple flow steering
Date: Fri, 14 Aug 2026 20:27:32 +0000	[thread overview]
Message-ID: <20260814202754.433725-1-almasrymina@google.com> (raw)

`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


                 reply	other threads:[~2026-08-14 20:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260814202754.433725-1-almasrymina@google.com \
    --to=almasrymina@google.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bobbyeshleman@meta.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    /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