Skip to content

Commit 58f8ef6

Browse files
idoschkuba-moo
authored andcommitted
selftests: team: Add a reference count leak test
Add a test for the issue that was fixed in "team: avoid NETDEV_CHANGEMTU event when unregistering slave". The test hangs due to a reference count leak without the fix: # make -C tools/testing/selftests TARGETS="drivers/net/team" TEST_PROGS=refleak.sh TEST_GEN_PROGS="" run_tests [...] TAP version 13 1..1 # timeout set to 45 # selftests: drivers/net/team: refleak.sh [ 50.681299][ T496] unregister_netdevice: waiting for dummy1 to become free. Usage count = 3 [ 71.185325][ T496] unregister_netdevice: waiting for dummy1 to become free. Usage count = 3 And passes with the fix: # make -C tools/testing/selftests TARGETS="drivers/net/team" TEST_PROGS=refleak.sh TEST_GEN_PROGS="" run_tests [...] TAP version 13 1..1 # timeout set to 45 # selftests: drivers/net/team: refleak.sh ok 1 selftests: drivers/net/team: refleak.sh Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Acked-by: Stanislav Fomichev <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent bb4c698 commit 58f8ef6

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

tools/testing/selftests/drivers/net/team/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ TEST_PROGS := \
55
dev_addr_lists.sh \
66
options.sh \
77
propagation.sh \
8+
refleak.sh \
89
# end of TEST_PROGS
910

1011
TEST_INCLUDES := \
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: GPL-2.0
3+
# shellcheck disable=SC2154
4+
5+
lib_dir=$(dirname "$0")
6+
source "$lib_dir"/../../../net/lib.sh
7+
8+
trap cleanup_all_ns EXIT
9+
10+
# Test that there is no reference count leak and that dummy1 can be deleted.
11+
# https://lore.kernel.org/netdev/[email protected]/
12+
setup_ns ns1 ns2
13+
ip -n "$ns1" link add name team1 type team
14+
ip -n "$ns1" link add name dummy1 mtu 1499 type dummy
15+
ip -n "$ns1" link set dev dummy1 master team1
16+
ip -n "$ns1" link set dev dummy1 netns "$ns2"
17+
ip -n "$ns2" link del dev dummy1

0 commit comments

Comments
 (0)