diff options
| author | Yonghong Song <yonghong.song@linux.dev> | 2026-09-12 12:53:02 -0700 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-09-12 20:54:18 -0700 |
| commit | 9b55be31d16d962bb5b1fa063a2a4ba780214743 (patch) | |
| tree | 1b0cab5122526ba6b8aa2a5c571bca10b55e02f8 /tools/testing/selftests/bpf/xdp_lb_bench_common.h | |
| parent | e1891a2c64747fbe9ee236a6aa45e9203b02f99d (diff) | |
| download | linux-next-9b55be31d16d962bb5b1fa063a2a4ba780214743.tar.gz linux-next-9b55be31d16d962bb5b1fa063a2a4ba780214743.zip | |
selftests/bpf: Add C tests for by-value arguments up to 16 bytes
Extend the by-value argument test with the aggregate cases, written in C
so that they depend on the compiler lowering the argument into a pair of
argument registers rather than on a hand-written register layout.
The programs cover a struct and a union that fill two registers, a
smaller struct that fills one, and two struct arguments in a row,
alongside the __int128 already there. Each has an int argument around it
so that a wrong slot count shows up as a wrong value in the parameters
beside it; two pairs leave room for only one, which follows them. A
global function taking a struct with a pointer member is rejected: the
callee would receive the pointer as an opaque scalar.
A struct the argument registers cannot hold reaches the callee partly on
the stack, which the interpreter does not implement, so that case is
loaded only when the JIT is on.
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20260912195302.991273-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/xdp_lb_bench_common.h')
0 files changed, 0 insertions, 0 deletions
