Home
last modified time | relevance | path

Searched hist:"3 daf8e703ec3dcf73a27a7dcabbac152793eb114" (Results 1 – 2 of 2) sorted by relevance

/openbmc/linux/tools/testing/selftests/bpf/progs/
H A Dtest_skb_ctx.c3daf8e703ec3dcf73a27a7dcabbac152793eb114 Tue Apr 09 13:49:11 CDT 2019 Stanislav Fomichev <sdf@google.com> selftests: bpf: add selftest for __sk_buff context in BPF_PROG_TEST_RUN

Simple test that sets cb to {1,2,3,4,5} and priority to 6, runs bpf
program that fails if cb is not what we expect and increments cb[i] and
priority. When the test finishes, we check that cb is now {2,3,4,5,6}
and priority is 7.

We also test the sanity checks:
* ctx_in is provided, but ctx_size_in is zero (same for
ctx_out/ctx_size_out)
* unexpected non-zero fields in __sk_buff return EINVAL

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
/openbmc/linux/tools/testing/selftests/bpf/prog_tests/
H A Dskb_ctx.c3daf8e703ec3dcf73a27a7dcabbac152793eb114 Tue Apr 09 13:49:11 CDT 2019 Stanislav Fomichev <sdf@google.com> selftests: bpf: add selftest for __sk_buff context in BPF_PROG_TEST_RUN

Simple test that sets cb to {1,2,3,4,5} and priority to 6, runs bpf
program that fails if cb is not what we expect and increments cb[i] and
priority. When the test finishes, we check that cb is now {2,3,4,5,6}
and priority is 7.

We also test the sanity checks:
* ctx_in is provided, but ctx_size_in is zero (same for
ctx_out/ctx_size_out)
* unexpected non-zero fields in __sk_buff return EINVAL

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>