Stanislav Fomichev
48eb03dd26
xsk: Add TX timestamp and TX checksum offload support
...
This change actually defines the (initial) metadata layout
that should be used by AF_XDP userspace (xsk_tx_metadata).
The first field is flags which requests appropriate offloads,
followed by the offload-specific fields. The supported per-device
offloads are exported via netlink (new xsk-flags).
The offloads themselves are still implemented in a bit of a
framework-y fashion that's left from my initial kfunc attempt.
I'm introducing new xsk_tx_metadata_ops which drivers are
supposed to implement. The drivers are also supposed
to call xsk_tx_metadata_request/xsk_tx_metadata_complete in
the right places. Since xsk_tx_metadata_{request,_complete}
are static inline, we don't incur any extra overhead doing
indirect calls.
The benefit of this scheme is as follows:
- keeps all metadata layout parsing away from driver code
- makes it easy to grep and see which drivers implement what
- don't need any extra flags to maintain to keep track of what
offloads are implemented; if the callback is implemented - the offload
is supported (used by netlink reporting code)
Two offloads are defined right now:
1. XDP_TXMD_FLAGS_CHECKSUM: skb-style csum_start+csum_offset
2. XDP_TXMD_FLAGS_TIMESTAMP: writes TX timestamp back into metadata
area upon completion (tx_timestamp field)
XDP_TXMD_FLAGS_TIMESTAMP is also implemented for XDP_COPY mode: it writes
SW timestamp from the skb destructor (note I'm reusing hwtstamps to pass
metadata pointer).
The struct is forward-compatible and can be extended in the future
by appending more fields.
Reviewed-by: Song Yoong Siang <yoong.siang.song@intel.com >
Signed-off-by: Stanislav Fomichev <sdf@google.com >
Acked-by: Jakub Kicinski <kuba@kernel.org >
Link: https://lore.kernel.org/r/20231127190319.1190813-3-sdf@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
2023-11-29 14:59:40 -08:00
..
2023-01-19 17:14:18 +01:00
2021-12-21 15:09:46 -08:00
2023-06-22 09:44:28 +02:00
2021-09-13 14:51:10 -05:00
2023-05-14 16:05:28 +01:00
2022-11-17 22:49:39 +01:00
2023-09-24 13:39:25 +01:00
2021-01-25 18:44:44 +01:00
2022-06-28 21:26:05 +02:00
2023-09-06 18:09:12 +02:00
2022-06-28 21:26:05 +02:00
2023-08-22 15:13:20 +02:00
2022-06-28 21:26:05 +02:00
2022-08-09 19:51:05 +02:00
2023-04-27 18:49:24 -04:00
2022-06-28 21:26:05 +02:00
2023-10-02 20:48:16 +02:00
2023-05-30 15:20:08 +01:00
2021-06-16 17:47:53 +02:00
2023-03-30 23:24:24 -07:00
2023-10-27 12:58:16 +02:00
2022-04-29 14:38:03 -07:00
2022-11-23 19:55:22 +01:00
2023-06-20 14:28:17 -06:00
2022-05-13 10:56:10 +02:00
2021-11-01 13:36:08 +00:00
2022-11-04 16:56:41 +01:00
2022-08-11 10:31:19 -07:00
2022-12-22 18:18:37 -08:00
2023-03-10 21:05:16 +01:00
2022-10-31 07:29:47 -04:00
2023-05-30 16:42:00 -07:00
2022-12-27 12:52:10 +01:00
2023-11-14 08:16:34 +01:00
2021-02-06 09:22:10 +01:00
2021-02-15 18:28:30 +01:00
2021-04-02 11:18:30 -06:00
2023-07-24 20:11:54 -06:00
2023-11-28 21:50:09 -08:00
2022-06-07 10:20:42 -07:00
2023-11-09 14:02:12 +01:00
2023-10-12 16:44:10 +02:00
2022-05-18 00:11:18 +08:00
2023-06-22 09:44:28 +02:00
2023-06-06 17:05:54 -04:00
2021-01-12 17:31:14 +01:00
2022-05-15 18:31:28 -06:00
2022-09-24 08:50:04 +02:00
2022-09-24 08:50:04 +02:00
2023-07-14 08:43:49 -10:00
2023-07-23 11:34:22 +01:00
2021-11-26 16:48:59 +01:00
2022-06-28 21:26:05 +02:00
2023-04-18 16:39:34 -07:00
2023-10-16 11:38:56 -04:00
2023-04-22 14:41:30 -07:00
2022-01-26 14:49:46 +01:00
2022-06-28 21:26:05 +02:00
2023-01-20 09:33:22 +00:00
2023-10-23 16:12:46 -07:00
2021-10-18 12:28:53 -07:00
2023-07-20 17:24:57 -05:00
2023-03-06 15:49:07 -06:00
2023-03-06 15:49:07 -06:00
2023-03-30 15:57:50 -04:00
2022-06-28 21:26:05 +02:00
2022-06-20 18:21:25 +02:00
2023-10-15 16:08:24 +01:00
2021-03-18 17:03:54 +01:00
2022-08-29 15:32:13 +02:00
2022-06-03 20:09:27 +08:00
2023-08-23 14:17:42 -07:00
2023-09-24 18:17:31 -07:00
2023-11-18 18:42:37 -08:00
2023-01-23 12:44:18 +00:00
2023-06-15 14:55:15 +02:00
2023-03-10 21:05:16 +01:00
2023-04-19 23:39:42 -04:00
2022-11-28 12:46:23 -08:00
2023-02-07 12:53:53 +01:00
2022-04-04 08:55:23 +02:00
2023-05-25 13:16:57 +02:00
2021-04-20 08:59:03 -06:00
2022-06-28 21:26:05 +02:00
2023-06-06 07:54:00 +09:00
2023-03-16 21:20:32 -07:00
2023-10-18 14:34:12 -07:00
2023-09-25 22:34:33 -07:00
2023-08-09 15:43:27 +09:30
2021-01-27 15:13:52 +01:00
2022-02-17 09:09:37 +01:00
2021-02-07 14:51:19 -08:00
2023-08-16 12:39:38 +02:00
2023-09-21 19:22:05 +02:00
2022-08-10 13:49:50 +01:00
2021-02-08 13:01:24 +01:00
2022-05-04 11:06:13 +02:00
2023-10-27 09:21:13 +02:00
2023-10-24 12:02:02 +02:00
2023-05-24 22:05:24 -07:00
2023-10-27 18:04:30 +08:00
2022-09-20 11:53:32 +01:00
2023-03-10 21:05:16 +01:00
2022-02-18 13:08:18 +00:00
2021-11-15 07:53:10 -08:00
2021-11-15 07:53:10 -08:00
2021-06-03 15:31:34 -07:00
2021-03-30 13:29:39 -07:00
2023-10-04 13:00:34 +05:30
2022-02-18 21:20:06 -08:00
2022-10-28 12:36:34 +08:00
2022-06-28 21:26:05 +02:00
2021-07-29 15:06:50 +01:00
2021-05-07 00:26:34 -07:00
2023-10-27 10:51:41 +01:00
2022-09-15 09:08:09 +02:00
2021-03-10 12:45:16 -08:00
2023-11-16 22:33:31 +00:00
2022-08-18 20:37:35 -07:00
2023-10-12 09:15:15 +02:00
2022-06-28 21:26:05 +02:00
2022-12-12 09:29:56 +00:00
2022-03-11 08:28:27 -08:00
2023-11-29 14:59:40 -08:00
2022-06-28 21:26:05 +02:00
2021-07-21 08:14:33 -07:00
2023-05-23 15:38:59 +02:00
2022-06-28 21:26:05 +02:00
2022-06-28 21:26:05 +02:00
2022-11-22 17:50:36 -08:00
2022-07-17 07:52:46 -07:00
2023-11-01 11:25:08 -10:00
2021-07-21 08:14:33 -07:00
2022-02-04 20:24:45 -08:00
2023-01-06 19:22:53 -08:00
2022-02-28 13:25:48 +01:00
2023-10-26 11:16:34 -03:00
2023-08-15 10:06:49 -06:00
2022-06-28 21:26:05 +02:00
2023-02-06 09:01:00 +00:00
2022-10-17 09:51:26 -05:00
2021-10-05 06:54:16 -05:00
2023-07-28 13:30:51 -07:00
2022-06-28 21:26:05 +02:00
2023-03-16 15:18:02 +01:00
2022-06-28 21:26:05 +02:00
2022-06-28 21:26:05 +02:00
2023-01-19 16:28:57 +01:00
2020-12-15 12:13:36 -08:00
2023-08-24 16:25:14 -07:00
2023-09-20 16:24:06 -04:00
2023-06-09 12:34:45 -04:00
2021-06-17 14:25:39 -04:00
2023-10-31 16:37:07 -04:00
2022-09-20 09:13:38 +02:00
2023-10-26 21:07:15 +02:00
2022-05-25 09:51:36 -07:00
2022-07-08 10:46:53 -07:00
2022-05-10 06:30:05 -06:00
2022-08-29 10:44:08 +02:00
2022-08-02 12:34:03 -04:00
2021-03-10 09:34:06 +01:00
2021-03-24 08:26:29 +01:00
2021-10-21 23:36:28 +02:00
2022-02-09 12:00:11 +00:00
2023-07-20 12:24:06 +02:00
2023-10-16 11:47:43 +02:00
2023-05-25 16:21:22 +02:00
2023-03-23 17:25:46 +01:00
2023-10-05 13:34:04 +02:00
2023-01-07 11:29:29 +01:00
2023-01-18 17:12:37 -08:00
2023-10-25 16:47:16 -07:00
2022-06-28 21:26:05 +02:00
2023-06-09 16:25:16 -07:00
2022-01-11 18:45:02 -08:00
2023-08-14 18:48:02 +02:00
2023-10-27 14:56:04 -07:00
2023-10-27 14:56:04 -07:00
2022-02-19 16:05:54 +00:00
2021-01-23 12:38:42 -08:00
2021-06-30 15:34:04 -06:00
2023-04-27 19:15:11 -06:00
2022-06-28 21:26:05 +02:00
2022-11-03 20:46:32 -07:00
2022-06-28 21:26:05 +02:00
2023-11-18 18:42:37 -08:00
2021-06-18 13:02:45 -07:00
2023-11-29 14:59:40 -08:00
2022-09-07 16:46:03 +02:00
2023-10-20 11:43:35 +01:00
2021-03-11 16:12:59 -08:00
2021-12-27 14:58:37 +00:00
2021-01-25 09:36:25 -05:00
2022-02-25 18:50:12 -05:00
2022-03-13 12:59:35 -04:00
2023-11-06 09:03:46 +00:00
2021-09-14 11:11:20 +02:00
2021-10-21 17:25:17 +02:00
2023-10-23 11:48:49 +02:00
2023-09-27 09:40:02 +02:00
2022-05-20 06:17:33 -06:00
2022-02-27 10:58:04 -08:00
2021-01-04 11:42:26 -05:00
2023-08-14 08:01:06 +01:00
2023-03-23 12:22:19 +09:00
2023-10-28 13:31:05 -05:00
2021-07-06 10:37:46 -05:00
2023-07-26 12:28:44 +02:00
2021-12-23 09:32:51 +01:00
2021-12-27 17:12:58 +01:00
2023-08-03 14:34:37 -07:00
2023-10-05 13:27:46 +02:00
2023-06-07 14:26:09 -06:00
2020-12-21 17:36:48 -08:00
2022-12-01 03:22:20 +00:00
2023-10-06 14:44:11 -07:00
2021-03-25 15:31:22 -07:00
2023-01-06 17:12:39 +00:00
2023-07-20 22:14:21 +12:00
2023-10-19 18:11:49 -07:00
2023-10-15 20:07:52 +01:00
2023-04-16 14:23:07 +02:00
2023-08-09 09:15:39 +02:00
2022-06-28 21:26:05 +02:00
2022-02-17 09:09:38 +01:00
2021-12-10 17:10:55 -08:00
2022-05-09 14:00:07 +02:00
2022-09-24 08:31:54 +02:00
2022-06-28 21:26:05 +02:00
2023-01-06 19:28:01 -08:00
2023-07-15 11:35:02 -07:00
2022-12-27 12:52:12 +01:00
2022-03-23 19:58:40 +01:00
2023-10-25 18:04:29 -07:00
2023-03-09 11:31:44 +01:00
2023-07-17 16:08:08 -07:00
2023-08-22 11:10:26 -06:00
2022-08-03 16:29:08 -07:00
2022-09-20 12:33:22 +02:00
2022-06-28 21:26:05 +02:00
2023-10-10 08:51:10 +02:00
2023-09-18 11:14:42 +02:00
2022-11-03 03:43:05 +01:00
2023-10-19 18:11:49 -07:00
2021-05-18 16:20:54 -05:00
2022-02-02 07:42:41 -08:00
2023-08-19 12:46:53 +01:00
2023-10-27 10:35:45 +01:00
2022-06-01 16:48:05 -07:00
2022-01-08 17:41:00 +09:00
2022-09-11 19:47:04 -05:00
2023-09-13 20:09:49 -07:00
2022-06-28 21:26:05 +02:00
2022-11-09 14:06:51 +01:00
2023-08-04 16:20:39 +02:00
2022-06-30 13:14:35 +02:00
2023-03-24 16:59:09 -04:00
2023-04-18 16:39:34 -07:00
2023-10-27 10:35:46 +01:00
2022-11-17 11:04:23 -08:00
2022-04-26 10:17:03 +02:00
2021-01-07 16:17:32 +01:00
2022-02-03 19:50:49 +01:00
2022-04-06 13:48:02 +01:00
2022-09-27 17:29:09 -07:00
2023-06-15 13:41:53 +02:00
2021-04-10 10:36:34 +02:00
2022-06-27 16:25:41 +02:00
2023-06-05 09:36:35 +02:00
2023-08-20 20:24:34 -06:00
2022-06-28 21:26:05 +02:00
2022-08-31 09:07:53 +02:00
2023-10-03 22:29:43 -04:00
2023-10-18 14:34:12 -07:00
2023-03-23 17:25:46 +01:00
2023-01-15 23:45:15 +02:00
2022-12-07 17:58:46 +01:00
2023-09-27 09:40:02 +02:00
2022-12-07 17:58:46 +01:00
2022-12-07 17:58:46 +01:00
2023-04-15 08:58:41 +01:00
2022-12-28 05:09:46 -05:00
2022-08-11 04:26:08 -04:00
2022-07-11 09:54:37 +02:00
2023-09-28 12:12:08 -06:00
2023-11-01 09:20:00 -04:00
2023-11-01 09:19:55 -04:00
2023-09-27 09:40:01 +02:00
2022-06-28 21:26:05 +02:00
2023-04-04 11:01:57 -04:00
2022-12-12 14:19:23 -08:00
2023-11-01 09:19:59 -04:00
2022-03-28 16:52:58 -04:00
2021-11-04 16:36:54 +01:00
2021-09-29 09:22:29 +02:00
2021-11-01 05:26:48 -04:00
2022-05-10 07:22:28 -04:00
2021-12-06 15:03:05 +01:00
2021-11-10 15:32:38 +01:00
2023-08-01 21:02:00 -07:00
2023-11-01 09:31:16 -04:00
2021-08-26 22:28:03 +02:00
2022-08-16 01:40:24 -04:00
2021-08-05 10:24:08 +01:00
2021-03-07 09:07:16 +01:00
2021-09-05 16:23:09 -04:00
2023-10-15 13:19:42 +01:00
2023-05-28 19:07:48 -06:00
2021-06-12 13:16:45 -07:00
2023-10-05 08:18:19 +02:00