Eric Joyner and Jakub Kicinski
97ac08560d
ethtool: Embed FEC hist ranges as buffer in struct
...
When a driver's .get_fec_stats() handler is called and the driver
supports FEC histogram stats, the driver supplies the histogram bin
ranges via a pointer. This pointer is assigned while under the netdev
ops lock in fec_prepare_data(), but the actual data is only read after
the lock is released; so this allows the driver to change the ranges
(e.g. from another .get_fec_stats() call) while the current call chain
is reading them in fec_fill_reply().
Fix this by adding an ethtool core-owned buffer, ranges_buf, to struct
ethtool_fec_hist. Drivers whose ranges are built dynamically (currently
just mlx5) fill ranges_buf and then point the existing ranges pointer at
it, giving ethtool a consistent copy that stays valid after the netdev
ops lock is dropped and later in fec_fill_reply(). Drivers whose ranges
are compile-time constants (bnxt, netdevsim) are unaffected by the
potential race and keep setting the existing ranges pointer to their
constant array, without making copies.
Fixes: cc2f081299 ("ethtool: add FEC bins histogram report")
Signed-off-by: Eric Joyner <eric.joyner@amd.com >
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev >
Link: https://patch.msgid.link/20260723041342.39238-1-eric.joyner@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2026-07-27 18:23:07 -07:00
..
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-23 10:24:12 -07:00
2026-07-16 09:12:24 +02:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:14 +02:00
2026-07-03 07:37:43 +02:00
2026-06-22 12:20:21 -07:00
2026-06-18 08:50:52 -07:00
2026-07-03 07:38:16 +02:00
2026-06-11 10:26:40 +02:00
2026-07-03 07:38:16 +02:00
2026-06-23 15:51:14 -07:00
2026-06-17 11:32:14 +01:00
2026-07-23 08:19:29 -07:00
2026-07-03 07:38:16 +02:00
2026-06-21 17:05:45 +02:00
2026-07-22 19:47:17 +02:00
2026-07-03 07:38:16 +02:00
2026-06-08 10:03:43 +02:00
2026-07-03 07:38:16 +02:00
2026-06-17 12:10:11 +01:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-08 14:07:19 -04:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-06-21 11:31:28 -07:00
2026-07-15 12:13:30 +02:00
2026-06-17 11:21:40 -07:00
2026-06-16 08:53:53 -07:00
2026-07-03 07:38:16 +02:00
2026-06-24 06:53:25 -06:00
2026-06-16 13:02:47 +05:30
2026-06-16 10:07:36 -06:00
2026-06-30 16:31:56 +02:00
2026-06-07 10:03:01 -07:00
2026-06-14 13:47:38 -07:00
2026-06-17 09:18:14 +01:00
2026-06-07 10:03:01 -07:00
2026-07-16 16:11:29 -07:00
2026-06-06 15:08:36 -07:00
2026-06-17 12:03:56 +01:00
2026-06-05 14:46:51 +02:00
2026-06-15 13:51:27 +05:30
2026-06-21 11:31:28 -07:00
2026-06-08 18:21:32 -07:00
2026-06-15 14:21:14 +05:30
2026-06-15 14:21:14 +05:30
2026-06-15 05:01:15 +05:30
2026-06-22 12:20:21 -07:00
2026-07-09 15:48:53 -07:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-06-13 13:24:34 -07:00
2026-07-03 07:38:16 +02:00
2026-07-27 18:23:07 -07:00
2026-06-22 19:52:36 +00:00
2026-06-09 16:00:11 +02:00
2026-06-15 03:59:45 +05:30
2026-07-01 10:33:38 +02:00
2026-07-03 07:38:16 +02:00
2026-06-18 16:39:31 -07:00
2026-07-01 19:02:56 -07:00
2026-06-15 02:50:44 +05:30
2026-06-05 13:36:22 +02:00
2026-06-07 10:03:00 -07:00
2026-07-07 10:42:28 -04:00
2026-06-29 23:24:46 +01:00
2026-07-03 07:38:16 +02:00
2026-06-21 11:37:16 -07:00
2026-06-16 08:10:21 +05:30
2026-07-03 07:38:16 +02:00
2026-06-17 00:15:09 +02:00
2026-07-03 07:38:16 +02:00
2026-07-06 14:11:09 +02:00
2026-06-08 08:59:03 +02:00
2026-06-05 17:46:17 -07:00
2026-07-08 14:41:01 +02:00
2026-07-03 07:38:16 +02:00
2026-06-15 02:13:01 +03:00
2026-07-03 07:38:16 +02:00
2026-06-06 19:51:14 -05:00
2026-06-16 09:48:00 -06:00
2026-07-01 15:26:47 +02:00
2026-06-17 12:33:23 -07:00
2026-06-23 12:08:51 -05:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-06-10 10:42:55 -04:00
2026-06-15 16:33:40 +02:00
2026-06-06 15:21:40 +02:00
2026-06-16 00:39:57 +02:00
2026-06-17 11:28:52 +01:00
2026-06-05 11:44:10 +01:00
2026-06-08 18:21:24 -07:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-06-08 18:21:25 -07:00
2026-07-03 07:38:16 +02:00
2026-06-19 10:14:34 -07:00
2026-06-08 18:21:29 -07:00
2026-06-08 18:21:27 -07:00
2026-07-03 07:37:43 +02:00
2026-06-11 15:17:30 -07:00
2026-06-15 03:59:45 +05:30
2026-06-12 16:43:10 -07:00
2026-06-25 10:18:40 -07:00
2026-07-01 15:26:29 +02:00
2026-06-09 12:42:20 +02:00
2026-06-08 10:21:54 -04:00
2026-06-08 12:06:41 -04:00
2026-06-23 18:36:41 -07:00
2026-06-08 18:21:23 -07:00
2026-06-26 22:18:34 -04:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-01 19:02:54 -07:00
2026-07-09 15:48:56 -07:00
2026-06-21 11:37:38 -07:00
2026-06-09 17:04:02 -05:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-06-11 13:41:25 +02:00
2026-06-16 08:44:43 +05:30
2026-06-17 09:18:14 +01:00
2026-06-09 10:13:04 -07:00
2026-07-03 07:38:16 +02:00
2026-06-10 11:08:23 +02:00
2026-07-03 07:38:14 +02:00
2026-07-03 07:38:16 +02:00
2026-06-10 00:58:04 +02:00
2026-06-15 03:05:50 +05:30
2026-06-07 12:36:13 -07:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-06-23 00:13:21 +02:00
2026-06-21 13:20:19 -07:00
2026-07-03 07:38:16 +02:00
2026-06-23 12:03:44 -07:00
2026-06-21 13:20:19 -07:00
2026-07-15 11:10:14 +02:00
2026-06-22 08:28:48 -07:00
2026-07-03 07:38:16 +02:00
2026-06-17 08:17:00 +01:00
2026-06-18 16:39:31 -07:00
2026-06-08 18:21:31 -07:00
2026-06-17 09:18:14 +01:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-06-07 10:03:01 -07:00
2026-07-07 10:42:29 -04:00
2026-06-21 13:20:19 -07:00
2026-07-03 07:38:16 +02:00
2026-06-08 18:21:29 -07:00
2026-06-29 13:46:50 -06:00
2026-07-03 07:38:16 +02:00
2026-06-08 18:21:31 -07:00
2026-06-15 16:33:40 +02:00
2026-06-08 11:53:18 -07:00
2026-07-03 07:38:16 +02:00
2026-06-06 15:22:44 +02:00
2026-07-03 07:38:16 +02:00