Skip to content

Commit b301934

Browse files
leitaokuba-moo
authored andcommitted
selftests: net: add netpoll basic functionality test
Add a basic selftest for the netpoll polling mechanism, specifically targeting the netpoll poll() side. The test creates a scenario where network transmission is running at maximum speed, and netpoll needs to poll the NIC. This is achieved by: 1. Configuring a single RX/TX queue to create contention 2. Generating background traffic to saturate the interface 3. Sending netconsole messages to trigger netpoll polling 4. Using dynamic netconsole targets via configfs 5. Delete and create new netconsole targets after some messages 6. Start a bpftrace in parallel to make sure netpoll_poll_dev() is called 7. If bpftrace exists and netpoll_poll_dev() was called, stop. The test validates a critical netpoll code path by monitoring traffic flow and ensuring netpoll_poll_dev() is called when the normal TX path is blocked. This addresses a gap in netpoll test coverage for a path that is tricky for the network stack. Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent fd2aadc commit b301934

File tree

2 files changed

+397
-0
lines changed

2 files changed

+397
-0
lines changed

tools/testing/selftests/drivers/net/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ TEST_PROGS := \
1616
netcons_fragmented_msg.sh \
1717
netcons_overflow.sh \
1818
netcons_sysdata.sh \
19+
netpoll_basic.py \
1920
ping.py \
2021
queues.py \
2122
stats.py \

0 commit comments

Comments
 (0)