Files
kernel_xiaomi_sm8250/include/linux
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
..
2025-09-24 21:37:19 +02:00
2025-09-24 21:37:19 +02:00
2025-09-24 21:37:18 +02:00
2024-06-09 02:32:30 +03:00
2023-06-21 15:39:57 +02:00
2024-07-06 10:19:40 +00:00
2023-02-22 12:28:07 +00:00
2023-03-06 19:14:22 +01:00
2023-10-25 11:16:20 +02:00
2023-05-18 15:51:07 +00:00
2024-02-23 08:12:39 +01:00