]> Gentwo Git Trees - linux/.git/commit
selftest: netcons: create a torture test
authorBreno Leitao <leitao@debian.org>
Fri, 7 Nov 2025 14:03:39 +0000 (06:03 -0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 11 Nov 2025 02:34:44 +0000 (18:34 -0800)
commit6701896eb90998ff16338f199144bd9deefb79ba
tree631260723c916942e377d55708b26d812e399ee5
parent39acc6a95eefcf814efa226d8813f89e7e03496e
selftest: netcons: create a torture test

Create a netconsole test that puts a lot of pressure on the netconsole
list manipulation. Do it by creating dynamic targets and deleting
targets while messages are being sent. Also put interface down while the
messages are being sent, as creating parallel targets.

The code launches three background jobs on distinct schedules:

 * Toggle netcons target every 30 iterations
 * create and delete random_target every 50 iterations
 * toggle iface every 70 iterations

This creates multiple concurrency sources that interact with netconsole
states. This is good practice to simulate stress, and exercise netpoll
and netconsole locks.

This test already found an issue as reported in [1]

Link: https://lore.kernel.org/all/20250901-netpoll_memleak-v1-1-34a181977dfc@debian.org/
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Andre Carvalho <asantostc@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20251107-netconsole_torture-v10-3-749227b55f63@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/Makefile
tools/testing/selftests/drivers/net/netcons_torture.sh [new file with mode: 0755]