diff options
author | Zvi Effron <zeffron@riotgames.com> | 2021-07-07 22:16:55 +0000 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-07-07 19:51:13 -0700 |
commit | 47316f4a305367794fc04f23e5c778678d8f1d8e (patch) | |
tree | 078b3af08b95b3ef685452b5bb4be8fd95b17618 /crypto/ghash-generic.c | |
parent | 7445cf31d2e25e3f8ad7b1c5342e624c09ab23a2 (diff) | |
download | linux-47316f4a305367794fc04f23e5c778678d8f1d8e.tar.gz linux-47316f4a305367794fc04f23e5c778678d8f1d8e.tar.bz2 linux-47316f4a305367794fc04f23e5c778678d8f1d8e.zip |
bpf: Support input xdp_md context in BPF_PROG_TEST_RUN
Support passing a xdp_md via ctx_in/ctx_out in bpf_attr for
BPF_PROG_TEST_RUN.
The intended use case is to pass some XDP meta data to the test runs of
XDP programs that are used as tail calls.
For programs that use bpf_prog_test_run_xdp, support xdp_md input and
output. Unlike with an actual xdp_md during a non-test run, data_meta must
be 0 because it must point to the start of the provided user data. From
the initial xdp_md, use data and data_end to adjust the pointers in the
generated xdp_buff. All other non-zero fields are prohibited (with
EINVAL). If the user has set ctx_out/ctx_size_out, copy the (potentially
different) xdp_md back to the userspace.
We require all fields of input xdp_md except the ones we explicitly
support to be set to zero. The expectation is that in the future we might
add support for more fields and we want to fail explicitly if the user
runs the program on the kernel where we don't yet support them.
Co-developed-by: Cody Haas <chaas@riotgames.com>
Co-developed-by: Lisa Watanabe <lwatanabe@riotgames.com>
Signed-off-by: Cody Haas <chaas@riotgames.com>
Signed-off-by: Lisa Watanabe <lwatanabe@riotgames.com>
Signed-off-by: Zvi Effron <zeffron@riotgames.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20210707221657.3985075-3-zeffron@riotgames.com
Diffstat (limited to 'crypto/ghash-generic.c')
0 files changed, 0 insertions, 0 deletions