Jakub Kicinski
855631afe0
selftests: drv-net: let ethtool stats settle before reading
...
Some devices refresh the statistics exposed via ethtool only
periodically, every stats-block-usecs (as reported by ethtool -c).
ethtool_std_stats and ethtool_rmon sample the counters immediately
after generating traffic, so on such devices they can read stale
values and fail with a delta short of the packets just sent.
Add a hw_stats_settle() helper which sleeps for 1.25x the configured
stats-block-usecs (defaulting to 20ms when the device reports no, or
a zero, period). Use it for ethtool std stats and RMON.
The 1.25x/20msec heuristic matches what the Python tests do.
Reviewed-by: Petr Machata <petrm@nvidia.com >
Link: https://patch.msgid.link/20260808163653.2460381-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2026-08-10 16:47:49 -07:00
..
2026-07-24 15:10:05 -07:00
2025-07-01 17:42:11 -07:00
2025-11-27 14:24:31 -08:00
2026-08-10 16:47:49 -07:00
2026-07-27 17:46:41 -07:00
2026-06-30 16:54:37 -07:00
2026-08-06 08:46:23 -07:00
2026-07-22 20:34:15 +02:00
2026-08-06 15:09:23 +02:00
2026-07-23 10:04:17 -07:00
2026-07-23 08:27:22 -07:00
2026-06-05 17:29:40 -07:00
2026-06-11 12:19:05 +02:00
2026-04-30 09:38:56 +02:00
2026-06-09 18:48:17 -07:00
2026-01-21 19:20:30 -08:00
2025-12-01 12:02:13 -08:00
2024-05-21 13:25:11 +02:00
2025-10-29 17:56:03 -07:00
2026-07-22 13:47:03 +02:00
2024-02-05 12:36:16 +00:00
2026-06-02 19:27:25 -07:00
2023-09-10 18:49:29 +01:00
2025-11-27 14:24:31 -08:00
2025-11-27 14:24:31 -08:00
2025-08-20 19:28:03 -07:00
2024-04-24 20:15:45 -07:00
2026-04-10 15:52:25 -07:00
2026-07-22 10:23:18 -07:00
2026-06-18 18:22:30 -07:00
2025-07-14 17:29:41 -07:00
2025-11-03 18:11:40 -08:00
2025-11-03 18:11:40 -08:00
2025-03-10 13:13:04 -07:00
2025-11-27 14:24:31 -08:00
2023-12-05 13:00:56 +01:00
2024-12-16 18:14:12 -08:00
2025-01-17 18:36:14 -08:00
2026-08-06 15:09:23 +02:00
2026-01-23 11:31:14 -08:00
2024-11-15 16:39:19 -08:00
2026-06-15 15:58:13 -07:00
2025-11-27 14:24:31 -08:00
2025-09-09 15:34:11 -07:00
2025-09-09 15:34:11 -07:00
2025-09-09 15:34:11 -07:00
2026-01-25 13:16:47 -08:00
2025-02-18 18:10:31 -08:00
2025-09-26 17:48:37 -07:00
2023-12-14 18:38:35 -08:00
2023-12-14 18:38:35 -08:00
2026-07-30 16:09:23 -07:00
2025-05-12 18:10:55 -07:00
2026-06-12 17:53:48 -07:00
2026-01-22 20:14:36 -08:00
2026-08-10 15:22:44 -07:00
2026-07-21 11:09:02 +02:00
2026-03-26 18:48:44 -07:00
2026-08-03 16:55:23 -07:00
2023-12-23 00:26:32 +00:00
2025-07-10 18:11:04 -07:00
2023-07-18 17:43:51 -07:00
2025-05-12 18:10:55 -07:00
2026-01-22 18:29:49 -08:00
2023-12-05 13:00:56 +01:00
2025-10-17 16:57:53 -07:00
2026-03-23 19:58:32 -07:00
2024-10-04 15:34:07 -07:00
2026-05-29 13:00:54 -07:00
2026-02-23 17:33:29 -08:00
2025-11-27 14:24:31 -08:00
2025-02-25 18:13:28 -08:00
2026-04-07 10:47:58 +02:00
2025-07-25 13:06:19 -07:00
2025-11-27 14:24:31 -08:00
2025-05-27 17:31:42 -07:00
2026-01-19 10:03:31 -08:00
2023-12-05 13:00:56 +01:00
2026-07-06 12:13:37 +02:00
2026-05-22 17:11:09 -07:00
2025-03-20 11:25:52 +01:00
2026-03-03 18:08:13 -08:00
2026-07-22 08:01:02 -07:00
2025-07-02 15:07:16 -07:00
2025-07-02 15:07:16 -07:00
2024-04-24 20:15:45 -07:00
2025-06-11 17:02:29 -07:00
2023-12-05 13:00:56 +01:00
2025-07-11 17:00:18 -07:00
2024-08-22 16:56:06 -07:00
2025-12-06 14:01:20 -08:00
2025-04-03 15:32:09 -07:00
2024-06-01 16:03:21 -07:00
2025-06-17 16:22:59 -07:00
2026-04-14 08:17:02 -07:00
2026-05-08 14:54:55 -07:00
2026-03-18 16:41:42 -07:00
2025-09-09 16:26:44 -07:00
2025-11-27 14:24:31 -08:00
2026-05-08 16:50:27 -07:00
2025-11-27 14:24:31 -08:00
2025-09-13 16:55:16 -07:00
2026-07-29 16:59:45 -07:00
2026-07-29 16:59:45 -07:00
2025-11-27 14:24:31 -08:00
2024-04-01 20:42:45 -07:00
2025-11-27 14:24:31 -08:00
2025-04-11 18:58:10 -07:00
2026-03-23 19:58:29 -07:00
2026-03-23 19:58:29 -07:00
2026-03-23 19:58:29 -07:00
2026-03-23 19:58:29 -07:00
2025-08-25 16:07:16 -07:00
2023-10-24 13:53:39 -07:00
2025-09-01 13:08:07 -07:00
2025-06-22 17:32:04 +01:00
2026-07-03 08:50:44 +02:00
2026-05-27 17:23:05 -07:00
2025-11-27 14:24:31 -08:00
2024-04-10 14:03:12 -07:00
2024-04-10 14:03:12 -07:00
2025-10-20 16:41:33 -07:00
2025-10-20 16:41:33 -07:00
2023-12-14 18:38:35 -08:00
2025-11-27 14:24:31 -08:00
2025-04-09 20:02:51 -07:00
2025-04-09 20:02:51 -07:00
2025-11-27 14:24:31 -08:00
2025-02-17 16:45:19 -08:00
2025-11-27 14:24:31 -08:00
2026-07-22 08:01:02 -07:00
2025-05-12 18:10:55 -07:00
2023-12-14 18:38:35 -08:00
2026-07-23 15:10:09 +02:00
2024-06-19 18:42:10 +02:00
2024-06-19 18:42:10 +02:00
2025-05-20 18:14:08 -07:00
2025-07-01 19:32:45 -07:00
2025-07-01 19:32:45 -07:00
2026-03-26 18:45:29 -07:00
2025-07-01 19:32:45 -07:00
2026-04-07 20:20:56 -07:00
2023-12-23 00:26:32 +00:00
2025-12-23 12:30:23 +01:00
2026-05-01 17:58:44 -07:00
2025-11-27 14:24:31 -08:00
2026-07-23 07:18:53 -07:00
2025-11-27 14:24:31 -08:00
2025-08-14 17:45:36 -07:00
2026-05-14 12:42:12 +02:00
2025-08-01 13:51:41 -07:00
2025-02-17 16:45:19 -08:00
2025-09-26 17:48:37 -07:00
2024-03-26 12:29:25 +01:00
2026-07-30 16:09:23 -07:00
2023-12-08 12:12:16 +00:00
2023-12-08 12:12:16 +00:00
2026-06-04 08:47:45 -07:00
2025-06-19 15:24:09 +02:00
2026-01-17 18:01:26 -08:00
2026-01-17 18:01:26 -08:00
2026-08-06 09:08:58 -07:00
2025-10-29 18:28:30 -07:00
2026-07-20 17:59:25 -07:00
2026-01-23 11:43:28 -08:00
2026-01-13 11:46:39 -08:00
2024-10-04 11:52:20 -07:00
2025-05-27 17:31:42 -07:00
2025-05-27 17:31:42 -07:00
2026-02-03 19:23:41 -08:00
2025-07-15 15:26:47 +02:00
2024-02-02 21:10:36 -08:00
2025-11-27 14:24:31 -08:00
2024-12-04 19:22:20 -08:00
2025-02-03 10:13:27 +00:00
2024-06-28 18:13:00 -07:00
2024-08-22 12:55:47 +02:00
2025-03-31 16:44:25 -07:00
2026-06-18 18:15:34 -07:00
2025-08-01 14:40:19 -07:00
2025-06-19 15:24:08 +02:00
2023-12-08 12:12:16 +00:00
2023-12-08 12:12:16 +00:00
2024-08-24 09:55:01 +02:00
2024-05-16 19:30:12 -07:00
2026-02-28 15:08:15 -08:00
2025-09-08 12:57:05 -07:00