Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Gal Pressman <gal@nvidia.com>
To: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>, <netdev@vger.kernel.org>
Cc: Shuah Khan <shuah@kernel.org>,
	Andy Gospodarek <andrew.gospodarek@broadcom.com>,
	Pavan Chebbi <pavan.chebbi@broadcom.com>,
	Michael Chan <michael.chan@broadcom.com>,
	<linux-kselftest@vger.kernel.org>, Gal Pressman <gal@nvidia.com>,
	Nimrod Oren <noren@nvidia.com>
Subject: [PATCH net] selftests: drv-net: rss_ctx: fix persist tests skip on IPv6 setups
Date: Wed, 22 Jul 2026 15:38:44 +0300	[thread overview]
Message-ID: <20260722123844.1673299-1-gal@nvidia.com> (raw)

test_rss_context_persist_ifupdown() cycles the interface down/up and
pings the remote host before verifying the contexts survived.

When using IPv6, the down operation deletes the configured IPv6 address
(default keep_addr_on_down=0) and nothing restores it after the up, so
all ping attempts fail and both tests skip with "Cannot reach remote
host after interface up".

Set the interface's keep_addr_on_down sysctl around the flap to retain
the address.

Fixes: ce5a0f4612db ("selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up")
Reviewed-by: Nimrod Oren <noren@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
---
Disclaimer: I'm not sure if this should go to net or net-next.
---
 tools/testing/selftests/drivers/net/hw/rss_ctx.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/testing/selftests/drivers/net/hw/rss_ctx.py b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
index f36f76d6ca59..eeea2fb292ac 100755
--- a/tools/testing/selftests/drivers/net/hw/rss_ctx.py
+++ b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
@@ -938,6 +938,13 @@ def test_rss_context_persist_ifupdown(cfg, pre_down=False):
     ethtool(f"-X {cfg.ifname} equal 2")
     defer(ethtool, f"-X {cfg.ifname} default")
 
+    # IPv6 addresses are deleted on admin down and not restored on up
+    knob = f"net/ipv6/conf/{cfg.ifname}/keep_addr_on_down"
+    probe = cmd(f"sysctl -n {knob}", fail=False)
+    if probe.ret == 0:
+        cmd(f"sysctl -qw {knob}=1")
+        defer(cmd, f"sysctl -qw {knob}={probe.stdout.strip()}")
+
     ifup = defer(ip, f"link set dev {cfg.ifname} up")
     if pre_down:
         ip(f"link set dev {cfg.ifname} down")
-- 
2.54.0


             reply	other threads:[~2026-07-22 12:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 12:38 Gal Pressman [this message]
2026-07-22 17:20 ` [PATCH net] selftests: drv-net: rss_ctx: fix persist tests skip on IPv6 setups Bobby Eshleman
2026-07-22 20:26 ` Jakub Kicinski

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=20260722123844.1673299-1-gal@nvidia.com \
    --to=gal@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew.gospodarek@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=noren@nvidia.com \
    --cc=pabeni@redhat.com \
    --cc=pavan.chebbi@broadcom.com \
    --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