Netdev List
 help / color / mirror / Atom feed
From: "Pielech, Adrian" <adrian.pielech@intel.com>
To: Sheena Mohan <sheenamo@google.com>, Jakub Kicinski <kuba@kernel.org>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>,
	<edumazet@google.com>, <pabeni@redhat.com>,
	<andrew+netdev@lunn.ch>, <horms@kernel.org>,
	<przemyslaw.kitszel@intel.com>, <shuah@kernel.org>,
	<linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH net-next] selftests: drv-net: warn if LOCAL_V6 has DAD or not kept on link down
Date: Fri, 11 Sep 2026 15:25:35 +0200	[thread overview]
Message-ID: <87ce93dc-ece4-431d-a01d-3476a364fe0a@intel.com> (raw)
In-Reply-To: <CADWJPTtu1bjng_1LWAbT7QtnkODw2A36Xd5koaiiESK_2ifHhw@mail.gmail.com>

On 9/9/2026 5:16 AM, Sheena Mohan wrote:
> On Tue, Sep 8, 2026 at 11:19 AM Jakub Kicinski <kuba@kernel.org> wrote:
>>
>> napi_id.py intermittently fails to start its helper on Intel and Google
>> HW runners:
>>
>>    CMD: /srv/netdev/drivers/net/napi_id_helper 3001::1 37569
>>      EXIT: 1
>>      STDERR: bind failed: Cannot assign requested address
>>
>> Either keep_addr_on_down is not set or more likely the address is
>> configured without nodad. Having to make sure that all tests
>> always wait for DAD after impacting the link would be a whack-a-mole
>> so we expect the env to have nodad and keep_addr_on_down set.
>>
>> Warn about both while validating the environment, and document this.
>> We could fail completely but most tests don't impact the link so for
>> quick local testing it'd be annoying to have to apply the settings.
>> I hope the warninging stikes the right balance.
>>
>> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
>> ---
>> Adrian, Sheena, please update the setups scripts for your
>> systems. Looks like nodad is missing.
>>
>> CC: adrian.pielech@intel.com
>> CC: sheenamo@google.com
>> CC: przemyslaw.kitszel@intel.com
>> CCL hramamurthy@google.com
>> CC: shuah@kernel.org
>> CC: linux-kselftest@vger.kernel.org
>> ---
>>   .../testing/selftests/drivers/net/README.rst  |  9 +++++++++
>>   .../selftests/drivers/net/lib/py/env.py       | 19 +++++++++++++++++++
>>   2 files changed, 28 insertions(+)
>>
>> diff --git a/tools/testing/selftests/drivers/net/README.rst b/tools/testing/selftests/drivers/net/README.rst
>> index c6bed9a985bc..3fe49bce4f3a 100644
>> --- a/tools/testing/selftests/drivers/net/README.rst
>> +++ b/tools/testing/selftests/drivers/net/README.rst
>> @@ -70,6 +70,15 @@ LOCAL_V4, LOCAL_V6, REMOTE_V4, REMOTE_V6
>>
>>   Local and remote endpoint IP addresses.
>>
>> +Tests reconfigure the device freely, including taking the link down, and
>> +expect the addresses to work immediately afterwards. IPv6 needs help::
>> +
>> +  ip -6 address add 2001:db8:1::1/64 dev eth0 nodad
>> +  sysctl -w net.ipv6.conf.eth0.keep_addr_on_down=1
>> +
>> +Without those the address is flushed when the link goes down, or spends
>> +a second unusable while waiting for DAD to finish.
>> +
>>   LOCAL_PREFIX_V6
>>   ~~~~~~~~~~~~~~~
>>
>> diff --git a/tools/testing/selftests/drivers/net/lib/py/env.py b/tools/testing/selftests/drivers/net/lib/py/env.py
>> index 25903f580b40..6262080a8bf4 100644
>> --- a/tools/testing/selftests/drivers/net/lib/py/env.py
>> +++ b/tools/testing/selftests/drivers/net/lib/py/env.py
>> @@ -239,6 +239,25 @@ from . import bpftool, RtnlFamily, Netlink
>>           if missing:
>>               raise Exception("Invalid environment, missing configuration:", missing,
>>                               "Please see tools/testing/selftests/drivers/net/README.rst")
>> +        if "LOCAL_V6" in self.env:
>> +            self._check_v6_env()
>> +
>> +    def _check_v6_env(self):
>> +        """Tests bind() to LOCAL_V6 and bounce the link, it must survive both."""
>> +        ifname, addr = self.env["NETIF"], self.env["LOCAL_V6"]
>> +
>> +        def _keep_addr(scope):
>> +            with open(f"/proc/sys/net/ipv6/conf/{scope}/keep_addr_on_down",
>> +                      encoding="utf-8") as fp:
>> +                return int(fp.read())
>> +
>> +        # 'all' wins when non-zero, see addrconf_ifdown()
>> +        if (_keep_addr("all") or _keep_addr(ifname)) <= 0:
>> +            ksft_pr(f"WARN: net.ipv6.conf.{ifname}.keep_addr_on_down not set")
>> +
>> +        dev = ip(f"-6 address show dev {ifname} to {addr}", json=True)
>> +        if not (dev and dev[0]["addr_info"][0].get("nodad")):
>> +            ksft_pr(f"WARN: LOCAL_V6 {addr} not configured with nodad")
>>
>>       def resolve_remote_ifc(self):
>>           v4 = v6 = None
>> --
>> 2.55.0
>>
> Thanks Jakub. We will update the setup scripts on our end to reflect
> this configuration.

Applied to the setups, thanks for noticing about that requirement!

  reply	other threads:[~2026-09-11 13:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 18:19 [PATCH net-next] selftests: drv-net: warn if LOCAL_V6 has DAD or not kept on link down Jakub Kicinski
2026-09-09  3:16 ` Sheena Mohan
2026-09-11 13:25   ` Pielech, Adrian [this message]
2026-09-09 20:17 ` netdev-bot+sashiko
2026-09-09 20:30   ` Jakub Kicinski
2026-09-09 20:40 ` patchwork-bot+netdevbpf

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=87ce93dc-ece4-431d-a01d-3476a364fe0a@intel.com \
    --to=adrian.pielech@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=sheenamo@google.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