mirror of
https://github.com/torvalds/linux.git
synced 2026-04-19 23:34:00 -04:00
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 <idosch@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Acked-by: Stanislav Fomichev <sdf@fomichev.me> Link: https://patch.msgid.link/20260224125709.317574-3-idosch@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
18 lines
572 B
Bash
Executable File
18 lines
572 B
Bash
Executable File
#!/bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# shellcheck disable=SC2154
|
|
|
|
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
|