On Wed, Jul 22, 2026 at 03:38:44PM +0300, Gal Pressman wrote:
> 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 <[email protected]>
> Signed-off-by: Gal Pressman <[email protected]>
> ---
> 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
> 

Makes sense to me.

Reviewed-by: Bobby Eshleman <[email protected]>

Reply via email to