From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>,
Breno Leitao <leitao@debian.org>,
Willem de Bruijn <willemb@google.com>
Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Subject: [PATCH net-next] selftests: drv-net: netpoll_basic: xfail if no hits
Date: Thu, 19 Nov 2026 11:52:01 +0100 [thread overview]
Message-ID: <20261119-net-next-netpoll-basic-xfail-v1-1-206bf59911ea@kernel.org> (raw)
When netpoll_poll_dev() is not called during the test, bpftrace doesn't
print the '@hits' map, because it is empty. The test then fails instead
of reporting the expected XFAIL:
net.lib.py.ksft.KsftFailEx: bpftrace failed to run!?: {}
This has been observed regularly in the netdev CI with netdevsim, since
a recent switch to Fedora 45: hitting this function depends on timings.
Fixes: b3019343e4bd ("selftests: net: add netpoll basic functionality test")
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
I added the Fixes tag to help people validating this on stable kernel,
but feel free to remove it if you prefer not to.
Note that the test is currently ignored on NIPA.
---
tools/testing/selftests/drivers/net/netpoll_basic.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/drivers/net/netpoll_basic.py b/tools/testing/selftests/drivers/net/netpoll_basic.py
index 408bd54d6779..a4dc68c828cf 100755
--- a/tools/testing/selftests/drivers/net/netpoll_basic.py
+++ b/tools/testing/selftests/drivers/net/netpoll_basic.py
@@ -236,7 +236,8 @@ def bpftrace_call() -> None:
global MAPS # pylint: disable=W0603
# This will be passed to bpftrace as in bpftrace -e "expr"
- expr = "kprobe:netpoll_poll_dev { @hits = count(); }"
+ # Init @hits: bpftrace doesn't print empty maps
+ expr = "BEGIN { @hits = 0; } kprobe:netpoll_poll_dev { @hits++; }"
MAPS = bpftrace(expr, timeout=BPFTRACE_TIMEOUT, json=True)
logging.debug("BPFtrace output: %s", MAPS)
---
base-commit: ac9dfaeb9cd9ab731c14d202a2f00098f0417766
change-id: 20261119-net-next-netpoll-basic-xfail-7da4cdeca5b9
Best regards,
--
Matthieu Baerts (NGI0) <matttbe@kernel.org>
reply other threads:[~2026-11-19 10:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261119-net-next-netpoll-basic-xfail-v1-1-206bf59911ea@kernel.org \
--to=matttbe@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®