Andrey Ignatov
0d7c4a6dc9
bpf: Introduce ARG_PTR_TO_{INT,LONG} arg types
...
Currently the way to pass result from BPF helper to BPF program is to
provide memory area defined by pointer and size: func(void *, size_t).
It works great for generic use-case, but for simple types, such as int,
it's overkill and consumes two arguments when it could use just one.
Introduce new argument types ARG_PTR_TO_INT and ARG_PTR_TO_LONG to be
able to pass result from helper to program via pointer to int and long
correspondingly: func(int *) or func(long *).
New argument types are similar to ARG_PTR_TO_MEM with the following
differences:
* they don't require corresponding ARG_CONST_SIZE argument, predefined
access sizes are used instead (32bit for int, 64bit for long);
* it's possible to use more than one such an argument in a helper;
* provided pointers have to be aligned.
It's easy to introduce similar ARG_PTR_TO_CHAR and ARG_PTR_TO_SHORT
argument types. It's not done due to lack of use-case though.
Signed-off-by: Andrey Ignatov <rdna@fb.com >
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
2025-09-24 21:37:43 +02:00
..
2024-03-17 00:06:11 +01:00
2024-08-19 07:25:59 +00:00
2023-03-06 19:14:22 +01:00
2024-02-13 00:46:27 +01:00
2023-08-25 11:32:22 +00:00
2024-04-19 23:41:35 +03:00
2024-08-06 00:36:59 +03:00
2023-07-11 15:03:00 +03:00
2023-03-06 19:14:22 +01:00
2024-09-04 13:12:59 +02:00
2023-06-14 09:45:37 +00:00
2025-01-10 13:09:21 +02:00
2025-09-24 21:37:43 +02:00
2025-09-24 21:37:19 +02:00
2025-09-24 21:37:18 +02:00
2025-09-24 21:37:43 +02:00
2025-09-24 21:37:19 +02:00
2024-01-06 18:53:38 +02:00
2025-03-31 10:08:57 -04:00
2024-12-16 01:21:42 +02:00
2024-07-18 11:39:31 +02:00
2025-03-31 10:08:57 -04:00
2023-06-30 00:05:33 +05:30
2023-09-19 18:11:03 +03:00
2023-06-30 00:05:33 +05:30
2023-12-19 09:45:25 +00:00
2024-10-01 11:50:22 +03:00
2023-04-05 11:15:42 +02:00
2024-03-15 12:38:56 +00:00
2025-04-14 14:16:37 +03:00
2023-05-17 11:13:06 +02:00
2024-04-19 23:41:35 +03:00
2024-02-23 08:12:53 +01:00
2023-03-07 19:31:08 +02:00
2024-05-17 11:42:37 +02:00
2023-09-23 10:47:59 +02:00
2024-09-04 13:13:08 +02:00
2025-09-24 21:37:18 +02:00
2025-04-14 14:16:37 +03:00
2025-04-14 14:16:37 +03:00
2024-07-19 13:17:59 +00:00
2025-04-14 14:16:37 +03:00
2023-04-21 13:30:50 +00:00
2023-12-11 15:30:00 +05:30
2024-05-07 22:02:57 +03:00
2023-12-08 08:43:23 +01:00
2024-03-26 18:22:37 -04:00
2024-05-07 22:02:57 +03:00
2023-02-22 12:47:20 +01:00
2024-08-19 05:31:56 +02:00
2023-09-23 10:48:11 +02:00
2023-10-10 21:44:57 +02:00
2023-03-11 16:31:51 +01:00
2023-10-25 11:16:17 +02:00
2024-06-09 02:32:30 +03:00
2023-06-28 10:15:27 +02:00
2024-11-08 16:19:06 +01:00
2024-12-05 11:21:28 +00:00
2024-08-19 07:25:59 +00:00
2023-03-11 16:31:35 +01:00
2023-03-11 16:31:51 +01:00
2023-03-05 15:12:41 +01:00
2023-10-10 21:45:00 +02:00
2024-04-15 10:17:13 +00:00
2023-10-25 11:16:31 +02:00
2023-08-18 12:23:55 +05:45
2024-10-31 21:43:13 +00:00
2024-06-16 13:23:35 +02:00
2023-10-16 15:01:41 +03:00
2024-05-07 22:02:57 +03:00
2023-06-21 15:39:57 +02:00
2023-06-21 15:39:57 +02:00
2024-12-05 10:59:33 +01:00
2023-09-23 10:47:58 +02:00
2023-09-19 18:11:03 +03:00
2023-02-25 11:51:51 +01:00
2024-07-05 09:00:32 +02:00
2024-09-04 13:13:00 +02:00
2025-04-14 14:16:37 +03:00
2024-11-08 16:19:19 +01:00
2023-09-23 10:48:11 +02:00
2024-07-06 10:19:40 +00:00
2023-12-19 09:45:25 +00:00
2023-02-22 12:28:07 +00:00
2023-11-25 18:54:24 +00:00
2023-08-11 11:45:40 +02:00
2024-03-26 18:22:34 -04:00
2024-02-13 00:46:27 +01:00
2023-11-20 10:29:18 +01:00
2023-05-18 15:51:07 +00:00
2025-09-24 21:37:18 +02:00
2024-02-06 16:07:32 +02:00
2023-03-06 19:14:22 +01:00
2023-12-14 13:13:51 +02:00
2024-03-26 18:22:40 -04:00
2023-10-25 11:43:43 +00:00
2023-10-25 11:16:20 +02:00
2023-08-30 16:31:56 +02:00
2023-02-25 15:35:59 +00:00
2023-06-28 10:15:28 +02:00
2024-09-12 11:02:55 +02:00
2023-06-08 11:22:40 +03:00
2023-12-14 13:13:51 +02:00
2025-07-01 00:56:04 +03:00
2024-04-15 10:17:13 +00:00
2023-08-11 11:45:22 +02:00
2024-05-02 16:17:14 +02:00
2023-03-22 13:27:11 +01:00
2025-09-24 21:37:43 +02:00
2023-03-05 15:29:18 +01:00
2023-05-30 12:42:13 +01:00
2024-06-01 07:55:42 +00:00
2024-07-06 10:19:40 +00:00
2023-09-19 18:11:03 +03:00
2023-03-07 19:31:08 +02:00
2023-05-18 15:51:07 +00:00
2024-05-07 22:02:57 +03:00
2024-10-01 11:50:22 +03:00
2025-09-24 21:37:43 +02:00
2023-03-22 13:27:11 +01:00
2023-07-11 15:03:00 +03:00
2024-02-23 08:12:39 +01:00
2023-07-11 15:03:00 +03:00
2023-08-30 16:38:16 +00:00
2023-05-17 11:13:15 +02:00
2023-08-25 11:24:56 +00:00