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-10-09 18:14:15 +02:00
2023-11-03 14:51:08 -10:00
2023-11-10 09:52:56 -08:00
2023-10-24 13:08:14 -07:00
2023-11-01 14:46:51 -10:00
2023-11-04 10:22:52 +01:00
2023-10-09 12:37:23 +03:00
2023-11-04 16:25:36 -10:00
2023-10-11 15:54:41 +01:00
2023-10-16 12:44:04 -04:00
2023-11-02 14:40:51 -10:00
2023-11-15 11:34:31 -08:00
2023-11-03 12:01:32 +01:00
2023-11-04 11:04:30 -10:00
2023-10-24 19:26:14 +00:00
2023-11-04 10:23:22 +01:00
2023-11-07 17:10:02 -08:00
2023-11-02 20:53:31 -10:00
2023-11-01 14:46:51 -10:00
2023-11-10 13:54:58 +00:00
2023-11-08 13:39:16 -08:00
2023-10-21 12:45:45 +02:00
2023-11-05 08:41:14 -10:00
2023-10-27 20:13:38 -07:00
2023-10-06 16:01:54 +02:00
2023-10-08 21:18:48 +01:00
2023-10-11 08:46:01 -07:00
2023-10-14 20:25:22 -07:00
2023-10-16 16:14:45 -07:00
2023-10-28 13:29:16 +02:00
2023-10-25 16:47:13 -07:00
2023-10-20 14:15:13 -07:00
2023-11-23 12:20:58 -08:00
2023-10-11 17:27:47 -07:00
2023-11-01 11:16:34 -10:00
2023-11-24 10:40:06 +01:00
2023-10-06 16:01:27 -07:00
2023-11-01 22:33:53 -07:00
2023-10-25 16:47:10 -07:00
2023-10-18 18:07:57 -07:00
2023-10-25 16:47:10 -07:00
2023-11-09 13:25:47 -10:00
2023-11-09 13:25:47 -10:00
2023-10-13 15:38:24 -07:00
2023-10-30 21:48:22 -04:00
2023-11-10 07:53:19 -08:00
2023-10-18 14:43:22 -07:00
2023-11-03 15:44:25 -10:00
2023-10-18 14:43:22 -07:00
2023-10-23 11:32:25 +02:00
2023-10-06 22:05:56 +02:00
2023-11-19 13:35:07 -08:00
2023-10-14 20:25:21 -07:00
2023-11-02 20:53:31 -10:00
2023-10-30 20:13:17 -10:00
2023-10-27 18:04:29 +08:00
2023-10-25 16:47:15 -07:00
2023-10-28 13:29:18 +02:00
2023-11-06 08:35:09 +01:00
2023-10-15 16:08:24 +01:00
2023-11-18 14:52:57 +00:00
2023-11-17 13:24:08 +09:00
2023-11-07 12:11:26 -08:00
2023-10-16 12:52:39 -07:00
2023-10-19 11:02:48 +02:00
2023-10-16 21:05:33 -07:00
2023-11-02 20:53:31 -10:00
2023-10-12 18:53:36 +03:00
2023-10-18 14:08:29 +02:00
2023-11-02 19:38:47 -10:00
2023-10-08 20:44:26 -07:00
2023-10-19 11:03:15 +02:00
2023-10-27 20:48:03 -07:00
2023-10-19 14:47:33 -04:00
2023-10-25 16:47:16 -07:00
2023-10-25 18:33:42 +02:00
2023-10-25 20:19:00 +02:00
2023-10-20 13:39:26 +08:00
2023-11-11 18:06:42 +01:00
2023-10-18 14:34:17 -07:00
2023-10-25 16:47:16 -07:00
2023-11-03 09:12:00 +00:00
2023-10-26 20:27:58 -07:00
2023-11-16 12:26:57 +01:00
2023-10-28 21:31:22 +09:00
2023-10-13 20:18:42 -07:00
2023-10-30 18:01:41 -10:00
2023-11-01 11:25:08 -10:00
2023-10-19 16:42:03 -06:00
2023-10-24 11:58:42 -03:00
2023-11-09 13:37:28 -08:00
2023-10-12 09:58:02 +02:00
2023-10-24 11:58:42 -03:00
2023-10-26 13:53:06 +02:00
2023-10-16 12:44:14 -04:00
2023-10-26 13:46:28 -07:00
2023-10-11 10:11:54 -07:00
2023-11-10 19:59:05 +09:00
2023-10-18 14:43:21 -07:00
2023-10-08 22:46:04 -07:00
2023-11-16 23:45:04 +00:00
2023-10-16 12:44:06 -04:00
2023-11-08 15:39:42 -05:00
2023-10-16 12:44:06 -04:00
2023-11-13 11:02:30 +00:00
2023-10-18 10:01:33 +02:00
2023-10-25 16:47:14 -07:00
2023-10-16 15:44:39 -07:00
2023-10-25 16:47:16 -07:00
2023-10-20 11:50:46 +01:00
2023-11-18 14:52:56 +00:00
2023-10-18 14:43:22 -07:00
2023-10-18 14:34:18 -07:00
2023-11-02 19:38:47 -10:00
2023-11-02 19:38:47 -10:00
2023-10-06 14:44:10 -07:00
2023-10-25 16:47:11 -07:00
2023-11-03 23:28:33 +01:00
2023-11-03 15:31:04 -10:00
2023-11-01 13:07:08 -07:00
2023-11-01 21:09:37 -10:00
2023-10-26 13:53:06 +02:00
2023-10-19 11:02:49 +02:00
2023-11-18 18:42:37 -08:00
2023-11-29 14:59:40 -08:00
2023-10-18 10:26:43 +02:00
2023-11-18 20:18:25 -08:00
2023-10-16 12:44:26 -04:00
2023-11-01 15:15:52 -04:00
2023-11-01 15:40:44 -04:00
2023-10-30 15:40:57 -10:00
2023-10-17 13:57:54 -07:00
2023-11-08 08:07:08 -08:00
2023-10-11 10:11:54 -07:00
2023-11-06 08:34:15 -08:00
2023-10-27 13:17:54 +02:00
2023-10-18 22:35:36 +09:00
2023-10-30 13:20:02 -10:00
2023-10-27 18:04:30 +08:00
2023-10-18 14:34:17 -07:00
2023-10-18 14:34:16 -07:00
2023-10-18 10:02:52 +02:00
2023-11-02 14:05:18 -10:00
2023-11-02 14:05:18 -10:00
2023-10-18 14:34:14 -07:00
2023-10-20 14:15:06 -07:00
2023-11-15 04:18:31 +01:00
2023-11-18 18:42:37 -08:00
2023-10-17 17:51:53 -07:00
2023-10-19 11:02:47 +02:00
2023-10-28 13:29:17 +02:00
2023-10-26 15:16:03 +02:00
2023-10-15 20:07:52 +01:00
2023-10-10 13:49:21 +02:00
2023-11-10 09:20:55 +01:00
2023-10-11 19:43:43 +02:00
2023-10-18 23:59:54 +09:00
2023-10-18 14:34:14 -07:00
2023-10-09 15:03:28 +02:00
2023-11-02 20:53:31 -10:00
2023-10-08 21:16:30 +01:00
2023-10-17 09:10:06 -06:00
2023-10-28 16:52:43 -04:00
2023-10-17 13:28:12 +02:00
2023-10-18 14:34:13 -07:00
2023-10-18 14:34:18 -07:00
2023-11-29 14:59:40 -08:00
2023-11-04 15:58:13 -10:00
2023-10-15 13:19:42 +01:00
2023-10-27 10:35:44 +01:00
2023-11-01 10:02:18 +00:00
2023-11-08 11:06:50 -08:00
2023-10-19 13:01:33 +02:00
2023-11-03 19:15:19 -10:00
2023-10-18 14:43:21 -07:00
2023-10-28 13:29:19 +02:00
2023-11-01 15:28:33 -10:00
2023-11-01 12:10:02 -07:00
2023-11-03 09:16:42 +00:00
2023-10-20 19:26:37 +02:00
2023-10-13 08:49:13 +03:00
2023-10-18 14:43:21 -07:00
2023-11-15 12:03:41 -08:00
2023-11-03 07:41:18 -10:00
2023-10-20 12:16:10 -04:00
2023-11-02 00:16:49 -04:00
2023-10-19 18:11:38 -07:00
2023-10-09 09:35:14 +02:00
2023-10-27 18:04:28 +08:00
2023-10-11 08:46:01 -07:00
2023-10-18 14:34:12 -07:00
2023-11-01 09:20:00 -04:00
2023-10-15 19:59:15 +01:00
2023-11-01 09:31:16 -04:00
2023-10-18 14:34:18 -07:00
2023-10-19 11:02:48 +02:00
2023-10-17 23:49:19 -10:00