From: Dimitri Daskalakis <dimitri.daskalakis1@gmail.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: "Alexander Duyck" <alexanderduyck@fb.com>,
"Jakub Kicinski" <kuba@kernel.org>,
kernel-team@meta.com, "Andrew Lunn" <andrew+netdev@lunn.ch>,
"Eric Dumazet" <edumazet@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Shuah Khan" <shuah@kernel.org>,
"Mohsin Bashir" <hmohsin@meta.com>,
"Mike Marciniszyn (Meta)" <mike.marciniszyn@gmail.com>,
"Stanislav Fomichev" <sdf@fomichev.me>,
"Bobby Eshleman" <bobbyeshleman@meta.com>,
"Björn Töpel" <bjorn@kernel.org>,
"Breno Leitao" <leitao@debian.org>,
"Simon Horman" <horms@kernel.org>,
"Mina Almasry" <almasrymina@google.com>,
"Vadim Fedorenko" <vadim.fedorenko@linux.dev>,
"Dimitri Daskalakis" <daskald@meta.com>,
netdev@vger.kernel.org,
"Dimitri Daskalakis" <dimitri.daskalakis1@gmail.com>
Subject: [PATCH net 4/4] selftests: drv-net: stats: query timestamping stats while down
Date: Mon, 16 Nov 2026 12:29:57 -0800 [thread overview]
Message-ID: <20261116202957.3601684-5-dimitri.daskalakis1@gmail.com> (raw)
In-Reply-To: <20261116202957.3601684-1-dimitri.daskalakis1@gmail.com>
From: Dimitri Daskalakis <daskald@meta.com>
Read timestamping statistics before and after ifdown, to catch drivers
that crash or reset them while the interface is down.
Signed-off-by: Dimitri Daskalakis <daskald@meta.com>
---
tools/testing/selftests/drivers/net/stats.py | 25 +++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/drivers/net/stats.py b/tools/testing/selftests/drivers/net/stats.py
index b08e4d48b15c..e61db30b5181 100755
--- a/tools/testing/selftests/drivers/net/stats.py
+++ b/tools/testing/selftests/drivers/net/stats.py
@@ -220,6 +220,28 @@ def check_down(cfg) -> None:
netfam.qstats_get({"ifindex": cfg.ifindex, "scope": "queue"}, dump=True)
+@ksft_disruptive
+def check_down_ts_stats(cfg) -> None:
+ """Test timestamping stats are not impacted by ifdown"""
+
+ req = {"header": {"dev-index": cfg.ifindex, "flags": {"stats"}}}
+ try:
+ stats = ethnl.tsinfo_get(req).get("stats")
+ except NlError as e:
+ if e.error == errno.EOPNOTSUPP:
+ raise KsftSkipEx("timestamping not supported by the device") from e
+ raise
+ if not stats:
+ raise KsftSkipEx("timestamping stats not supported by the device")
+
+ ip(f"link set dev {cfg.dev['ifname']} down")
+ defer(ip, f"link set dev {cfg.dev['ifname']} up")
+
+ stats2 = ethnl.tsinfo_get(req).get("stats", {})
+ for k in stats:
+ ksft_ge(stats2[k], stats[k], comment=f"{k} went backwards on device down")
+
+
def __run_inf_loop(body):
body = body.strip()
if body[-1] != ';':
@@ -311,7 +333,8 @@ def main() -> None:
with NetDrvEnv(__file__, queue_count=100) as cfg:
ksft_run([check_pause, check_fec, check_fec_hist, pkt_byte_sum,
- qstat_by_ifindex, check_down, procfs_hammer,
+ qstat_by_ifindex, check_down, check_down_ts_stats,
+ procfs_hammer,
procfs_downup_hammer],
args=(cfg, ))
ksft_exit()
--
2.52.1
prev parent reply other threads:[~2026-11-16 20:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 20:29 [PATCH net 0/4] eth: fbnic: miscellaneous driver fixes Dimitri Daskalakis
2026-11-16 20:29 ` [PATCH net 1/4] eth: fbnic: wait on the correct queues in fbnic_queue_stop() Dimitri Daskalakis
2026-11-16 20:29 ` [PATCH net 2/4] eth: fbnic: skip disabled Tx rings when setting the queue NAPI Dimitri Daskalakis
2026-11-16 20:29 ` [PATCH net 3/4] eth: fbnic: skip freed Tx rings in fbnic_get_ts_stats() Dimitri Daskalakis
2026-11-16 20:29 ` Dimitri Daskalakis [this message]
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=20261116202957.3601684-5-dimitri.daskalakis1@gmail.com \
--to=dimitri.daskalakis1@gmail.com \
--cc=alexanderduyck@fb.com \
--cc=almasrymina@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=bjorn@kernel.org \
--cc=bobbyeshleman@meta.com \
--cc=daskald@meta.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hmohsin@meta.com \
--cc=horms@kernel.org \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=leitao@debian.org \
--cc=mike.marciniszyn@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=vadim.fedorenko@linux.dev \
/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