From: Ido Schimmel <idosch@nvidia.com>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Jakub Kicinski <kuba@kernel.org>,
Stanislav Fomichev <stfomichev@gmail.com>,
Jiri Pirko <jiri@resnulli.us>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Network Development <netdev@vger.kernel.org>,
Jiri Pirko <jiri@nvidia.com>
Subject: Re: [PATCH v2] selftests/net: team: add team unregister test
Date: Sun, 22 Feb 2026 17:32:09 +0200 [thread overview]
Message-ID: <20260222153209.GA68096@shredder> (raw)
In-Reply-To: <8ea7a69f-e5cf-4330-b911-7f49d8ff2aa8@I-love.SAKURA.ne.jp>
On Sun, Feb 22, 2026 at 10:17:42PM +0900, Tetsuo Handa wrote:
> Add selftest for "team: avoid NETDEV_CHANGEMTU event when unregistering
> slave" patch.
1. Repost the entire series (fix + selftest).
2. Tag as "[PATCH net vX]".
3. Wait 24h before reposting.
4. Post as a new thread instead of as a reply to an existing thread.
See more info here:
https://docs.kernel.org/process/maintainer-netdev.html
>
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> ---
> v2:
> - Removed unexpectedly-copied Copyright line.
>
> tools/testing/selftests/net/team/Makefile | 7 ++++++
> .../selftests/net/team/team_unregister.sh | 23 +++++++++++++++++++
> 2 files changed, 30 insertions(+)
> create mode 100644 tools/testing/selftests/net/team/Makefile
> create mode 100755 tools/testing/selftests/net/team/team_unregister.sh
The team selftests are under tools/testing/selftests/drivers/net/team/,
so this one should be added there as well
>
> diff --git a/tools/testing/selftests/net/team/Makefile b/tools/testing/selftests/net/team/Makefile
> new file mode 100644
> index 000000000000..aa8ef0590022
> --- /dev/null
> +++ b/tools/testing/selftests/net/team/Makefile
> @@ -0,0 +1,7 @@
> +# SPDX-License-Identifier: GPL-2.0
> +
> +top_srcdir = ../../../../..
> +
> +TEST_PROGS := team_unregister.sh
> +
> +include ../../lib.mk
> diff --git a/tools/testing/selftests/net/team/team_unregister.sh b/tools/testing/selftests/net/team/team_unregister.sh
> new file mode 100755
> index 000000000000..cfa710237d8b
> --- /dev/null
> +++ b/tools/testing/selftests/net/team/team_unregister.sh
> @@ -0,0 +1,23 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +
> +source ../lib.sh
> +
> +NS_NAME="ns-"$RANDOM
> +TEAM_NAME="team-"$RANDOM
> +DUMMY_NAME="dummy-"$RANDOM
No need for "$RANDOM" if you use setup_ns() to create namespaces with a
randomized name.
> +
> +cleanup() {
> + cleanup_ns $NS_NAME
Quote variables to avoid shellcheck warnings
> + ip link del $TEAM_NAME
> +}
> +
> +trap cleanup EXIT
> +ip link add name $TEAM_NAME type team
> +ip link add name $DUMMY_NAME mtu 1499 master $TEAM_NAME type dummy
> +ip netns add $NS_NAME
> +echo "Setting $DUMMY_NAME to $NS_NAME"
> +ip link set dev $DUMMY_NAME netns $NS_NAME
> +echo "Deleting $DUMMY_NAME from $NS_NAME"
> +ip -n $NS_NAME link del dev $DUMMY_NAME
> +echo "Test completed successfully."
This patch [1] works for me (hangs without the fix):
# make -C tools/testing/selftests TARGETS="drivers/net/team" TEST_PROGS=refleak.sh TEST_GEN_PROGS="" run_tests
make: Entering directory '/home/idosch/code/linux/tools/testing/selftests'
make[1]: Nothing to be done for 'all'.
TAP version 13
1..1
# timeout set to 45
# selftests: drivers/net/team: refleak.sh
ok 1 selftests: drivers/net/team: refleak.sh
[1]
diff --git a/tools/testing/selftests/drivers/net/team/Makefile b/tools/testing/selftests/drivers/net/team/Makefile
index 1340b3df9c31..45a3e7ad3dcb 100644
--- a/tools/testing/selftests/drivers/net/team/Makefile
+++ b/tools/testing/selftests/drivers/net/team/Makefile
@@ -5,6 +5,7 @@ TEST_PROGS := \
dev_addr_lists.sh \
options.sh \
propagation.sh \
+ refleak.sh \
# end of TEST_PROGS
TEST_INCLUDES := \
diff --git a/tools/testing/selftests/drivers/net/team/refleak.sh b/tools/testing/selftests/drivers/net/team/refleak.sh
new file mode 100755
index 000000000000..53675be04965
--- /dev/null
+++ b/tools/testing/selftests/drivers/net/team/refleak.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+lib_dir=$(dirname "$0")
+source "$lib_dir"/../../../net/lib.sh
+
+trap cleanup_all_ns EXIT
+
+# Test that there is no reference count leak and that dummy1 can be deleted.
+# https://lore.kernel.org/netdev/4d69abe1-ca8d-4f0b-bcf8-13899b211e57@I-love.SAKURA.ne.jp/
+setup_ns ns1 ns2
+ip -n "$ns1" link add name team1 type team
+ip -n "$ns1" link add name dummy1 mtu 1499 type dummy
+ip -n "$ns1" link set dev dummy1 master team1
+ip -n "$ns1" link set dev dummy1 netns "$ns2"
+ip -n "$ns2" link del dev dummy1
next prev parent reply other threads:[~2026-02-22 15:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-27 11:05 [PATCH net v2] team: avoid NETDEV_CHANGEMTU event when unregistering slave Tetsuo Handa
2026-01-28 3:14 ` Stanislav Fomichev
2026-01-30 3:12 ` Jakub Kicinski
2026-02-22 7:16 ` Tetsuo Handa
2026-02-22 9:34 ` Ido Schimmel
2026-02-22 11:19 ` [PATCH] selftests/net: team: add team unregister test Tetsuo Handa
2026-02-22 13:17 ` [PATCH v2] " Tetsuo Handa
2026-02-22 15:32 ` Ido Schimmel [this message]
2026-02-22 15:40 ` Tetsuo Handa
2026-02-22 17:39 ` Ido Schimmel
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=20260222153209.GA68096@shredder \
--to=idosch@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jiri@nvidia.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=stfomichev@gmail.com \
/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