Joanne Koong
b5964b968a
bpf: Add skb dynptrs
...
Add skb dynptrs, which are dynptrs whose underlying pointer points
to a skb. The dynptr acts on skb data. skb dynptrs have two main
benefits. One is that they allow operations on sizes that are not
statically known at compile-time (eg variable-sized accesses).
Another is that parsing the packet data through dynptrs (instead of
through direct access of skb->data and skb->data_end) can be more
ergonomic and less brittle (eg does not need manual if checking for
being within bounds of data_end).
For bpf prog types that don't support writes on skb data, the dynptr is
read-only (bpf_dynptr_write() will return an error)
For reads and writes through the bpf_dynptr_read() and bpf_dynptr_write()
interfaces, reading and writing from/to data in the head as well as from/to
non-linear paged buffers is supported. Data slices through the
bpf_dynptr_data API are not supported; instead bpf_dynptr_slice() and
bpf_dynptr_slice_rdwr() (added in subsequent commit) should be used.
For examples of how skb dynptrs can be used, please see the attached
selftests.
Signed-off-by: Joanne Koong <joannelkoong@gmail.com >
Link: https://lore.kernel.org/r/20230301154953.641654-8-joannelkoong@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
2023-03-01 09:55:24 -08:00
..
2022-06-27 16:16:30 +02:00
2022-09-15 09:08:09 +02:00
2022-12-07 17:58:47 +01:00
2022-11-17 22:49:39 +01:00
2022-09-21 18:42:55 +01:00
2022-06-28 21:26:05 +02:00
2023-01-27 22:56:18 -08:00
2022-06-28 21:26:05 +02:00
2022-06-28 21:26:05 +02:00
2022-06-28 21:26:05 +02:00
2022-08-09 19:51:05 +02:00
2022-06-28 21:26:05 +02:00
2022-11-08 12:15:19 +01:00
2022-12-08 16:53:47 +01:00
2022-11-23 19:55:22 +01: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
2022-10-31 07:29:47 -04:00
2022-12-27 12:52:10 +01:00
2023-01-21 19:01:59 +01:00
2022-06-28 21:26:05 +02:00
2023-03-01 09:55:24 -08:00
2022-12-05 18:00:58 +01:00
2022-12-05 18:00:59 +01:00
2022-09-15 09:08:09 +02:00
2022-11-05 01:25:57 -04:00
2022-09-24 08:50:04 +02:00
2022-09-24 08:50:04 +02:00
2022-06-28 21:26:05 +02:00
2022-09-30 14:32:35 +02:00
2022-12-06 14:36:02 -08:00
2022-06-28 21:26:05 +02:00
2023-01-20 09:33:22 +00:00
2022-12-07 20:09:18 -08:00
2022-08-23 14:54:54 -05:00
2022-08-02 19:50:47 -07:00
2022-06-28 21:26:05 +02:00
2022-06-20 18:21:25 +02:00
2022-08-29 15:32:13 +02:00
2023-01-20 12:23:07 +00:00
2023-02-13 11:05:12 +00:00
2023-01-23 12:44:18 +00:00
2022-11-21 07:45:29 -07:00
2022-11-28 12:46:23 -08:00
2023-02-07 12:53:53 +01:00
2022-06-28 21:26:05 +02:00
2022-06-28 21:26:05 +02:00
2023-01-24 10:58:11 +01:00
2022-06-28 21:26:05 +02:00
2022-12-01 19:58:50 -08:00
2022-11-23 09:10:50 +01:00
2022-08-10 13:49:50 +01:00
2022-09-20 11:53:32 +01:00
2022-11-14 03:56:37 +05:30
2022-10-28 12:36:34 +08:00
2022-06-28 21:26:05 +02:00
2023-02-06 08:48:26 +00:00
2022-09-15 09:08:09 +02:00
2023-02-06 08:48:26 +00:00
2022-08-18 20:37:35 -07:00
2023-02-01 20:54:27 -08:00
2022-06-28 21:26:05 +02:00
2022-12-12 09:29:56 +00:00
2022-06-28 21:26:05 +02:00
2023-01-25 22:45:00 -08: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-02-21 11:07:23 -08:00
2023-01-06 19:22:53 -08:00
2022-11-30 20:16:49 -04: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
2023-02-06 09:01:00 +00:00
2022-06-28 21:26:05 +02:00
2022-06-28 21:26:05 +02:00
2022-06-28 21:26:05 +02:00
2022-07-12 16:50:44 -04:00
2022-12-27 06:01:49 -05:00
2022-09-20 09:13:38 +02:00
2022-10-19 09:01:44 +02:00
2022-07-08 10:46:53 -07:00
2022-08-29 10:44:08 +02:00
2022-08-02 12:34:03 -04:00
2023-02-13 11:12:31 +00:00
2022-10-25 14:38:31 +03:00
2023-01-07 11:29:29 +01:00
2022-06-28 21:26:05 +02:00
2022-12-01 20:06:06 -08: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
2022-12-08 19:49:21 -08:00
2023-02-02 20:48:23 -08:00
2022-09-07 16:46:03 +02:00
2022-11-18 18:36:54 -08:00
2023-02-14 12:35:02 +01:00
2022-12-09 10:43:46 +00:00
2022-12-14 09:54:10 -08:00
2023-02-07 11:52:00 +00:00
2022-09-20 09:13:38 +02:00
2022-09-29 18:52:05 -07:00
2023-01-04 14:44:13 -07:00
2022-12-01 03:22:20 +00:00
2023-01-06 17:12:39 +00:00
2022-06-28 21:26:05 +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
2022-12-27 12:52:12 +01:00
2023-01-17 09:38:33 +01:00
2022-06-28 21:26:05 +02:00
2022-12-08 09:17:45 -07: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
2022-07-16 08:16:01 +02:00
2022-06-27 14:41:31 +02:00
2022-11-03 03:43:05 +01:00
2022-07-18 11:19:17 +01:00
2023-01-26 10:52:18 +01:00
2022-09-11 19:47:04 -05:00
2022-06-28 21:26:05 +02:00
2022-11-09 14:06:51 +01:00
2022-06-30 13:14:35 +02:00
2022-06-28 21:26:05 +02:00
2022-10-28 10:47:42 +01:00
2022-11-17 11:04:23 -08:00
2022-09-27 17:29:09 -07:00
2022-06-27 16:25:41 +02:00
2023-01-29 15:18:34 -07:00
2022-06-28 21:26:05 +02:00
2022-08-31 09:07:53 +02:00
2022-09-11 20:25:48 -07:00
2022-12-07 17:58:46 +01:00
2022-12-07 17:58:46 +01:00
2022-12-07 17:58:46 +01:00
2022-12-07 17:58:46 +01:00
2022-12-07 17:58:46 +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
2022-12-06 12:36:43 -07:00
2022-08-12 09:50:34 -07:00
2022-08-11 04:31:15 -04:00
2022-11-25 11:01:29 +00:00
2022-06-28 21:26:05 +02:00
2022-10-07 09:32:41 -04:00
2022-12-12 14:19:23 -08:00
2022-08-11 04:06:40 -04:00
2022-12-12 09:29:56 +00:00
2022-08-11 04:06:40 -04:00
2022-08-16 01:40:24 -04:00
2022-12-05 10:30:47 +01:00