Skip to contentSkip to conversation

selftest: net: Add selftest for netpoll

PATCH Superseded Breno Leitao 4 participants 19 messages Jun 25, 2025 – Jun 27, 2025

Subsystems (4)

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v2 cover selftest: net: Add selftest for netpoll

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

---
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/[email protected]

---
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/[email protected]

---
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,

Signature · 1 line
Breno Leitao <[email protected]>
#1 lore raw

PATCH v2 1/4 selftests: drv-net: add helper/wrapper for bpftrace

From: Jakub Kicinski <[email protected]>

bpftrace is very useful for low level driver testing. perf or trace-cmd would also do for collecting data from tracepoints, but they require much more post-processing.

Add a wrapper for running bpftrace and sanitizing its output. bpftrace has JSON output, which is great, but it prints loose objects and in a slightly inconvenient format. We have to read the objects line by line, and while at it return them indexed by the map name.

---
 tools/testing/selftests/net/lib/py/utils.py | 33 +++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
tools/testing/selftests/net/lib/py/utils.py +33 -0
index 34470d65d871a..760ccf6fccccc 100644
@@ -185,6 +185,39 @@ def ethtool(args, json=None, ns=None, host=None):
     return tool('ethtool', args, json=json, ns=ns, host=host)
 
 
+def bpftrace(expr, json=None, ns=None, host=None, timeout=None):
+    """
+    Run bpftrace and return map data (if json=True).
+    The output of bpftrace is inconvenient, so the helper converts
+    to a dict indexed by map name, e.g.:
+     {
+       "@":     { ... },
+       "@map2": { ... },
+     }
+    """
+    cmd_arr = ['bpftrace']
+    # Throw in --quiet if json, otherwise the output has two objects
+    if json:
+        cmd_arr += ['-f', 'json', '-q']
+    if timeout:
+        expr += ' interval:s:' + str(timeout) + ' { exit(); }'
+    cmd_arr += ['-e', expr]
+    cmd_obj = cmd(cmd_arr, ns=ns, host=host, shell=False)
+    if json:
+        # bpftrace prints objects as lines
+        ret = {}
+        for l in cmd_obj.stdout.split('\n'):
+            if not l.strip():
+                continue
+            one = _json.loads(l)
+            if one.get('type') != 'map':
+                continue
+            for k, v in one["data"].items():
+                ret[k] = v
+        return ret
+    return cmd_obj
+
+
 def rand_port(type=socket.SOCK_STREAM):
     """
     Get a random unprivileged port.
Signature · 1 line
2.47.1
maintainer
#2 lore raw

Re: [PATCH net-next v2 1/4] selftests: drv-net: add helper/wrapper for bpftrace

Quoted 10 lines · On Wed, 25 Jun 2025 04:39:46 -0700 Breno Leitao wrote:

From: Jakub Kicinski <[email protected]>

bpftrace is very useful for low level driver testing. perf or trace-cmd would also do for collecting data from tracepoints, but they require much more post-processing.

Add a wrapper for running bpftrace and sanitizing its output. bpftrace has JSON output, which is great, but it prints loose objects and in a slightly inconvenient format. We have to read the objects line by line, and while at it return them indexed by the map name.

Could you squash this in? Otherwise pylint can't find it

tools/testing/selftests/drivers/net/lib/py/__init__.py +2 -1
index 9ed1d8f70524..98829a0f7a02 100644
@@ -14,7 +14,8 @@ KSFT_DIR = (Path(__file__).parent / "../../../..").resolve()
     from net.lib.py import EthtoolFamily, NetdevFamily, NetshaperFamily, \
         NlError, RtnlFamily
     from net.lib.py import CmdExitFailure
-    from net.lib.py import bkg, cmd, defer, ethtool, fd_read_timeout, ip, \
+    from net.lib.py import bkg, cmd, bpftrace, defer, ethtool, \
+        fd_read_timeout, ip, \
         rand_port, tool, wait_port_listen
     from net.lib.py import fd_read_timeout
     from net.lib.py import KsftSkipEx, KsftFailEx, KsftXfailEx

and with that I think it should be possible to make pylint clean on the past patch?

#3 lore raw

PATCH v2 2/4 selftests: drv-net: Improve bpftrace utility error handling

In reply to Breno Leitao

Enhance the bpftrace function to raise an exception if the underlying bpftrace command returns a non-zero exit code. This helps detect and surface errors from bpftrace execution in test scripts, improving robustness and debugging capabilities.

---
 tools/testing/selftests/net/lib/py/utils.py | 3 +++
 1 file changed, 3 insertions(+)
tools/testing/selftests/net/lib/py/utils.py +3 -0
index 760ccf6fccccc..c4e26567ee6fb 100644
@@ -203,6 +203,9 @@ def bpftrace(expr, json=None, ns=None, host=None, timeout=None):
         expr += ' interval:s:' + str(timeout) + ' { exit(); }'
     cmd_arr += ['-e', expr]
     cmd_obj = cmd(cmd_arr, ns=ns, host=host, shell=False)
+    if cmd_obj.ret != 0:
+        raise Exception("Warning: bpftrace command returned a non-zero exit code.")
+
     if json:
         # bpftrace prints objects as lines
         ret = {}
Signature · 1 line
2.47.1
maintainer
#4 lore raw

Re: [PATCH net-next v2 2/4] selftests: drv-net: Improve bpftrace utility error handling

tools/testing/selftests/net/lib/py/utils.py def bpftrace(expr, json=None, ns=None, host=None, timeout=None): · line 207

Quoted 3 lines · On Wed, 25 Jun 2025 04:39:47 -0700 Breno Leitao wrote:

cmd_obj = cmd(cmd_arr, ns=ns, host=host, shell=False)

tools/testing/selftests/net/lib/py/utils.py +2 -0
+    if cmd_obj.ret != 0:
+        raise Exception("Warning: bpftrace command returned a non-zero exit code.")

cmd should already raise CmdExitFailure, unless fail=False / fail=None is specified.

#5 lore raw

Re: [PATCH net-next v2 2/4] selftests: drv-net: Improve bpftrace utility error handling

Quoted 7 lines · Jakub Kicinski

tools/testing/selftests/net/lib/py/utils.py def bpftrace(expr, json=None, ns=None, host=None, timeout=None): · line 207

Quoted 3 lines · On Wed, 25 Jun 2025 04:39:47 -0700 Breno Leitao wrote:

cmd_obj = cmd(cmd_arr, ns=ns, host=host, shell=False)

tools/testing/selftests/net/lib/py/utils.py +2 -0
+    if cmd_obj.ret != 0:
+        raise Exception("Warning: bpftrace command returned a non-zero exit code.")

cmd should already raise CmdExitFailure, unless fail=False / fail=None is specified.

Oh yea, even easier. I found the code, and it is much easier to just set fail=True for this case. This will avoid hidden errors.

#6 lore raw

PATCH v2 3/4 selftests: drv-net: Strip '@' prefix from bpftrace map keys

In reply to Breno Leitao

The '@' prefix in bpftrace map keys is specific to bpftrace and can be safely removed when processing results. This patch modifies the bpftrace utility to strip the '@' from map keys before storing them in the result dictionary, making the keys more consistent with Python conventions.

---
 tools/testing/selftests/net/lib/py/utils.py | 2 ++
 1 file changed, 2 insertions(+)
tools/testing/selftests/net/lib/py/utils.py +2 -0
index c4e26567ee6fb..31d4d63621c5f 100644
@@ -216,6 +216,8 @@ def bpftrace(expr, json=None, ns=None, host=None, timeout=None):
             if one.get('type') != 'map':
                 continue
             for k, v in one["data"].items():
+                if k.startswith('@'):
+                    k = k.lstrip('@')
                 ret[k] = v
         return ret
     return cmd_obj
Signature · 1 line
2.47.1
maintainer
#7 lore raw

Re: [PATCH net-next v2 3/4] selftests: drv-net: Strip '@' prefix from bpftrace map keys

Quoted 4 lines · On Wed, 25 Jun 2025 04:39:48 -0700 Breno Leitao wrote:

The '@' prefix in bpftrace map keys is specific to bpftrace and can be safely removed when processing results. This patch modifies the bpftrace utility to strip the '@' from map keys before storing them in the result dictionary, making the keys more consistent with Python conventions.

Make sense, tho, could you double check or ask Alastair if all outputs are prefixed with @? Maybe there's some map type or other thingamajig that doesn't have the prefix?

#8 lore raw

Re: [PATCH net-next v2 3/4] selftests: drv-net: Strip '@' prefix from bpftrace map keys

Quoted 9 lines · Jakub Kicinski
Quoted 4 lines · On Wed, 25 Jun 2025 04:39:48 -0700 Breno Leitao wrote:

The '@' prefix in bpftrace map keys is specific to bpftrace and can be safely removed when processing results. This patch modifies the bpftrace utility to strip the '@' from map keys before storing them in the result dictionary, making the keys more consistent with Python conventions.

Make sense, tho, could you double check or ask Alastair if all outputs are prefixed with @? Maybe there's some map type or other thingamajig that doesn't have the prefix?

I have a quick chat with Alastair earlier today, and I understood that all map symbols start with @.

CCing him.

#9 lore raw

PATCH v2 4/4 selftests: net: add netpoll basic functionality test

In reply to Breno Leitao

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.

---
 tools/testing/selftests/drivers/net/Makefile       |   1 +
 .../testing/selftests/drivers/net/netpoll_basic.py | 344 +++++++++++++++++++++
 2 files changed, 345 insertions(+)
tools/testing/selftests/drivers/net/Makefile +1 -0
index bd309b2d39095..9bd84d6b542e5 100644
@@ -16,6 +16,7 @@ TEST_PROGS := \
 	netcons_fragmented_msg.sh \
 	netcons_overflow.sh \
 	netcons_sysdata.sh \
+	netpoll_basic.py \
 	ping.py \
 	queues.py \
 	stats.py \
tools/testing/selftests/drivers/net/netpoll_basic.py new file +344 -0

344 lines not on this page · raw message

Signature · 1 line
2.47.1
maintainer
#10 lore raw

Re: [PATCH net-next v2 4/4] selftests: net: add netpoll basic functionality test

Quoted 1 line · On Wed, 25 Jun 2025 04:39:49 -0700 Breno Leitao wrote:

+ raise KsftSkipEx("netpoll_poll_dev() was not called. Skipping test")

Let's make this an Xfail. Looks like the condition doesn't trigger in VM testing :(

#11 lore raw

Re: [PATCH net-next v2 4/4] selftests: net: add netpoll basic functionality test

Quoted 5 lines · Jakub Kicinski
Quoted 1 line · On Wed, 25 Jun 2025 04:39:49 -0700 Breno Leitao wrote:

+ raise KsftSkipEx("netpoll_poll_dev() was not called. Skipping test")

Let's make this an Xfail. Looks like the condition doesn't trigger in VM testing :(

Exactly, there is a chance this will not trigger it, and you do not want this bothering you. Having it as Xfail will be a false positive.

I have a plan to make this consitent by writing some configfs hook for debug, then maybe we can make it a debug?!

reviewer
#12 lore raw

Re: [PATCH net-next v2 4/4] selftests: net: add netpoll basic functionality test

In reply to Breno Leitao
Quoted 15 lines · Breno Leitao

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.

Quoted 8 lines

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.

Hi Breno,

As it looks like there will be another version, could you run pylint over this. The NIPA invocation says:

************* Module netpoll_basic
.../netpoll_basic.py:323:0: C0301: Line too long (111/100) (line-too-long)
.../netpoll_basic.py:27:0: E0611: No name 'bpftrace' in module 'lib.py' (no-name-in-module) .../netpoll_basic.py:79:11: E0606: Possibly using variable 'rx_queue' before assignment (possibly-used-before-assignment) .../netpoll_basic.py:79:21: E0606: Possibly using variable 'tx_queue' before assignment (possibly-used-before-assignment) .../netpoll_basic.py:253:22: W0613: Unused argument 'netdevnl' (unused-argument)

#13 lore raw

Re: [PATCH net-next v2 4/4] selftests: net: add netpoll basic functionality test

Quoted 31 lines · Simon Horman
Quoted 15 lines · Breno Leitao

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.

Quoted 8 lines

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.

Hi Breno,

As it looks like there will be another version, could you run pylint over this. The NIPA invocation says:

Quoted 6 lines

************* Module netpoll_basic
.../netpoll_basic.py:323:0: C0301: Line too long (111/100) (line-too-long)
.../netpoll_basic.py:27:0: E0611: No name 'bpftrace' in module 'lib.py' (no-name-in-module) .../netpoll_basic.py:79:11: E0606: Possibly using variable 'rx_queue' before assignment (possibly-used-before-assignment) .../netpoll_basic.py:79:21: E0606: Possibly using variable 'tx_queue' before assignment (possibly-used-before-assignment) .../netpoll_basic.py:253:22: W0613: Unused argument 'netdevnl' (unused-argument)

Thanks for the report. I was able to reproduce them here. The next version should be warning free. I hope. :-)

Thanks for the review,
--breno

#14 lore raw

Re: [PATCH net-next v2 4/4] selftests: net: add netpoll basic functionality test

In reply to Breno Leitao
Quoted 24 lines · Breno Leitao

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.

tools/testing/selftests/drivers/net/netpoll_basic.py line 196

Quoted 10 lines
tools/testing/selftests/drivers/net/netpoll_basic.py new file +10 -0
+def bpftrace_call() -> None:
+    """Call bpftrace to find how many times netpoll_poll_dev() is called.
+    Output is saved in the global variable `maps`"""
+
+    # This is going to update the global variable, that will be seen by the
+    # main function
+    global MAPS  # pylint: disable=W0603
+
+    # This will be passed to bpftrace as in bpftrace -e "expr"
+    expr = "BEGIN{ @hits = 0;} kprobe:netpoll_poll_dev { @hits += 1; }"

Is that BEGIN statement needed? I generally just use count().

tools/testing/selftests/drivers/net/netpoll_basic.py line 203

Quoted 7 lines
tools/testing/selftests/drivers/net/netpoll_basic.py new file +7 -0
+
+    MAPS = bpftrace(expr, timeout=BPFTRACE_TIMEOUT, json=True)
+    logging.debug("BPFtrace output: %s", MAPS)
+
+
+def bpftrace_start():
+    """Start a thread to call `call_bpf` in parallel for 2 seconds."""

Stale comment? BPFTRACE_TIMEOUT is set to 15.

Quoted 8 lines
tools/testing/selftests/drivers/net/netpoll_basic.py new file +8 -0
+    global BPF_THREAD  # pylint: disable=W0603
+
+    BPF_THREAD = threading.Thread(target=bpftrace_call)
+    BPF_THREAD.start()
+    if not BPF_THREAD.is_alive():
+        raise KsftSkipEx("BPFtrace thread is not alive. Skipping test")
+
+
#15 lore raw

Re: [PATCH net-next v2 4/4] selftests: net: add netpoll basic functionality test

Quoted 25 lines · Willem de Bruijn
Quoted 23 lines · Breno Leitao

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.

Quoted 12 lines

tools/testing/selftests/drivers/net/netpoll_basic.py line 196

Quoted 10 lines
tools/testing/selftests/drivers/net/netpoll_basic.py new file +10 -0
+def bpftrace_call() -> None:
+    """Call bpftrace to find how many times netpoll_poll_dev() is called.
+    Output is saved in the global variable `maps`"""
+
+    # This is going to update the global variable, that will be seen by the
+    # main function
+    global MAPS  # pylint: disable=W0603
+
+    # This will be passed to bpftrace as in bpftrace -e "expr"
+    expr = "BEGIN{ @hits = 0;} kprobe:netpoll_poll_dev { @hits += 1; }"

Is that BEGIN statement needed? I generally just use count().

If I use hits += 1 then yes, but, I've learned that I don't need it if I use count(). So, I will see something like:

kprobe:netpoll_poll_dev { @hits = count(); }

Quoted 9 lines

tools/testing/selftests/drivers/net/netpoll_basic.py line 203

Quoted 7 lines
tools/testing/selftests/drivers/net/netpoll_basic.py new file +7 -0
+
+    MAPS = bpftrace(expr, timeout=BPFTRACE_TIMEOUT, json=True)
+    logging.debug("BPFtrace output: %s", MAPS)
+
+
+def bpftrace_start():
+    """Start a thread to call `call_bpf` in parallel for 2 seconds."""

Stale comment? BPFTRACE_TIMEOUT is set to 15.

Yes. I will remove it.

Thanks for the review,
--breno

reviewer
#16 lore raw
In reply to Breno Leitao

+ Stan

Quoted 23 lines · 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.

Quoted 7 lines

So, this patchset basically contains:

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

Jakub, Stan, all,

It looks like bpftrace needs to be installed on the CI workers. Currently they report something a lot like this:

# timeout set to 180
# selftests: drivers/net: netpoll_basic.py
# Exception in thread Thread-1:
# Traceback (most recent call last):
#   File "/usr/lib64/python3.9/threading.py", line 980, in _bootstrap_inner
#     self.run()
#   File "/usr/lib64/python3.9/threading.py", line 917, in run
#     self._target(*self._args, **self._kwargs)
#   File "/home/virtme/testing-17/tools/testing/selftests/drivers/net/./netpoll_basic.py", line 198, in bpftrace_call
#     MAPS = bpftrace(expr, timeout=BPFTRACE_TIMEOUT, json=True)
#   File "/home/virtme/testing-17/tools/testing/selftests/net/lib/py/utils.py", line 205, in bpftrace
#     cmd_obj = cmd(cmd_arr, ns=ns, host=host, shell=False)
#   File "/home/virtme/testing-17/tools/testing/selftests/net/lib/py/utils.py", line 60, in __init__
#     self.proc = subprocess.Popen(comm, shell=shell, stdout=subprocess.PIPE,
#   File "/usr/lib64/python3.9/subprocess.py", line 951, in __init__
#     self._execute_child(args, executable, preexec_fn, close_fds,
#   File "/usr/lib64/python3.9/subprocess.py", line 1837, in _execute_child
#     raise child_exception_type(errno_num, err_msg, err_filename)
# FileNotFoundError: [Errno 2] No such file or directory: 'bpftrace'
# TAP version 13
# 1..1
# # Exception| Traceback (most recent call last):
# # Exception|   File "/home/virtme/testing-17/tools/testing/selftests/net/lib/py/ksft.py", line 243, in ksft_run
# # Exception|     case(*args)
# # Exception|   File "/home/virtme/testing-17/tools/testing/selftests/drivers/net/./netpoll_basic.py", line 308, in test_netpoll
# # Exception|     do_netpoll_flush_monitored(cfg, netdevnl, ifname, target_name)
# # Exception|   File "/home/virtme/testing-17/tools/testing/selftests/drivers/net/./netpoll_basic.py", line 243, in do_netpoll_flush_monitored
# # Exception|     do_netpoll_flush(cfg, netdevnl, ifname, target_name)
# # Exception|   File "/home/virtme/testing-17/tools/testing/selftests/drivers/net/./netpoll_basic.py", line 278, in do_netpoll_flush
# # Exception|     if bpftrace_any_hit(join=False):
# # Exception|   File "/home/virtme/testing-17/tools/testing/selftests/drivers/net/./netpoll_basic.py", line 230, in bpftrace_any_hit
# # Exception|     raise KsftFailEx(f"bpftrace failed to run!?: {MAPS}")
# # Exception| net.lib.py.ksft.KsftFailEx: bpftrace failed to run!?: {}
# not ok 1 netpoll_basic.test_netpoll
# # Totals: pass:0 fail:1 xfail:0 xpass:0 skip:0 error:0
maintainer
#17 lore raw
Quoted 4 lines · On Wed, 25 Jun 2025 19:43:46 +0100 Simon Horman wrote:
# # Exception| Traceback (most recent call last):
# # Exception|   File "/home/virtme/testing-17/tools/testing/selftests/net/lib/py/ksft.py", line 243, in ksft_run
# # Exception|     case(*args)
# # Exception|   File "/home/virtme/testing-17/tools/testing/selftests/drivers/net/./netpoll_basic.py", line 308, in test_netpoll
Quoted 8 lines
# # Exception|     do_netpoll_flush_monitored(cfg, netdevnl, ifname, target_name)
# # Exception|   File "/home/virtme/testing-17/tools/testing/selftests/drivers/net/./netpoll_basic.py", line 243, in do_netpoll_flush_monitored
# # Exception|     do_netpoll_flush(cfg, netdevnl, ifname, target_name)
# # Exception|   File "/home/virtme/testing-17/tools/testing/selftests/drivers/net/./netpoll_basic.py", line 278, in do_netpoll_flush
# # Exception|     if bpftrace_any_hit(join=False):
# # Exception|   File "/home/virtme/testing-17/tools/testing/selftests/drivers/net/./netpoll_basic.py", line 230, in bpftrace_any_hit
# # Exception|     raise KsftFailEx(f"bpftrace failed to run!?: {MAPS}")
# # Exception| net.lib.py.ksft.KsftFailEx: bpftrace failed to run!?: {}

Looks like I haven't added bpftrace to the image before. Fixed now.

reviewer
#18 lore raw
Quoted 14 lines · Jakub Kicinski
Quoted 4 lines · On Wed, 25 Jun 2025 19:43:46 +0100 Simon Horman wrote:
# # Exception| Traceback (most recent call last):
# # Exception|   File "/home/virtme/testing-17/tools/testing/selftests/net/lib/py/ksft.py", line 243, in ksft_run
# # Exception|     case(*args)
# # Exception|   File "/home/virtme/testing-17/tools/testing/selftests/drivers/net/./netpoll_basic.py", line 308, in test_netpoll
Quoted 8 lines
# # Exception|     do_netpoll_flush_monitored(cfg, netdevnl, ifname, target_name)
# # Exception|   File "/home/virtme/testing-17/tools/testing/selftests/drivers/net/./netpoll_basic.py", line 243, in do_netpoll_flush_monitored
# # Exception|     do_netpoll_flush(cfg, netdevnl, ifname, target_name)
# # Exception|   File "/home/virtme/testing-17/tools/testing/selftests/drivers/net/./netpoll_basic.py", line 278, in do_netpoll_flush
# # Exception|     if bpftrace_any_hit(join=False):
# # Exception|   File "/home/virtme/testing-17/tools/testing/selftests/drivers/net/./netpoll_basic.py", line 230, in bpftrace_any_hit
# # Exception|     raise KsftFailEx(f"bpftrace failed to run!?: {MAPS}")
# # Exception| net.lib.py.ksft.KsftFailEx: bpftrace failed to run!?: {}
Quoted 2 lines

Looks like I haven't added bpftrace to the image before. Fixed now.

Thanks, it looks good now.