linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/4] selftest: net: Add selftest for netpoll
@ 2025-06-25 11:39 Breno Leitao
  2025-06-25 11:39 ` [PATCH net-next v2 1/4] selftests: drv-net: add helper/wrapper for bpftrace Breno Leitao
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Breno Leitao @ 2025-06-25 11:39 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Shuah Khan, Simon Horman
  Cc: linux-kernel, netdev, linux-kselftest, Willem de Bruijn, bpf,
	gustavold, Breno Leitao

I am submitting a new selftest for the netpoll subsystem specifically
targeting the case where the RX is polling in the TX path, which is
a case that we don't have any test in the tree today. This is done when
netpoll_poll_dev() called, and this test creates a scenario when that is
probably.

The test does the following:

1) Configuring a single RX/TX queue to increase contention on the
   interface.
2) Generating background traffic to saturate the network, mimicking
   real-world congestion.
3) Sending netconsole messages to trigger netpoll polling and monitor
   its behavior.
4) Using dynamic netconsole targets via configfs, with the ability to
   delete and recreate targets during the test.
5) Running bpftrace in parallel to verify that netpoll_poll_dev() is
   called when expected. If it is called, then the test passes,
   otherwise the test is marked as skipped.

In order to achieve it, I stole Jakub's bpftrace helper from [1], and
did some small changes that I found useful to use the helper.

So, this patchset basically contains:

1) The code stolen from Jakub
2) Improvements on bpftrace() helper
3) The selftest itself

Link: https://lore.kernel.org/all/20250421222827.283737-22-kuba@kernel.org/ [1]

---
Changes in v1 (from RFC):
- Toggle the netconsole interfaces up and down after 5 iterations.
- Moved the traffic check under DEBUG (Willem de Bruijn).
- Bumped the iterations to 20 given it runs faster now.
- Link to the RFC: https://lore.kernel.org/r/20250612-netpoll_test-v1-1-4774fd95933f@debian.org

---
Changes in v2:
- Stole Jakub's helper to run bpftrace
- Removed the DEBUG option and moved logs to logging
- Change the code to have a higher chance of calling netpoll_poll_dev().
  In my current configuration, it is hitting multiple times during the
  test.
- Save and restore TX/RX queue size (Jakub)
- Link to v1: https://lore.kernel.org/r/20250620-netpoll_test-v1-1-5068832f72fc@debian.org

---
Breno Leitao (3):
      selftests: drv-net: Improve bpftrace utility error handling
      selftests: drv-net: Strip '@' prefix from bpftrace map keys
      selftests: net: add netpoll basic functionality test

Jakub Kicinski (1):
      selftests: drv-net: add helper/wrapper for bpftrace

 tools/testing/selftests/drivers/net/Makefile       |   1 +
 .../testing/selftests/drivers/net/netpoll_basic.py | 344 +++++++++++++++++++++
 tools/testing/selftests/net/lib/py/utils.py        |  38 +++
 3 files changed, 383 insertions(+)
---
base-commit: eb4c27edb4d8dbfbdcc7bc03e0394a0fab8af7d5
change-id: 20250612-netpoll_test-a1324d2057c8

Best regards,
--  
Breno Leitao <leitao@debian.org>


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2025-06-27 15:18 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-25 11:39 [PATCH net-next v2 0/4] selftest: net: Add selftest for netpoll Breno Leitao
2025-06-25 11:39 ` [PATCH net-next v2 1/4] selftests: drv-net: add helper/wrapper for bpftrace Breno Leitao
2025-06-25 22:12   ` Jakub Kicinski
2025-06-25 11:39 ` [PATCH net-next v2 2/4] selftests: drv-net: Improve bpftrace utility error handling Breno Leitao
2025-06-25 21:48   ` Jakub Kicinski
2025-06-26 13:11     ` Breno Leitao
2025-06-25 11:39 ` [PATCH net-next v2 3/4] selftests: drv-net: Strip '@' prefix from bpftrace map keys Breno Leitao
2025-06-25 22:07   ` Jakub Kicinski
2025-06-26 13:04     ` Breno Leitao
2025-06-25 11:39 ` [PATCH net-next v2 4/4] selftests: net: add netpoll basic functionality test Breno Leitao
2025-06-25 22:09   ` Jakub Kicinski
2025-06-26 10:31     ` Breno Leitao
2025-06-26  8:25   ` Simon Horman
2025-06-27 15:18     ` Breno Leitao
2025-06-26 16:31   ` Willem de Bruijn
2025-06-26 17:10     ` Breno Leitao
2025-06-25 18:43 ` [PATCH net-next v2 0/4] selftest: net: Add selftest for netpoll Simon Horman
2025-06-25 21:46   ` Jakub Kicinski
2025-06-26  8:17     ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).