Skip to content
Commit 939b9c68 authored by Zvi Effron's avatar Zvi Effron Committed by Alexei Starovoitov
Browse files

selftests/bpf: Add test for xdp_md context in BPF_PROG_TEST_RUN



Add a test for using xdp_md as a context to BPF_PROG_TEST_RUN for XDP
programs.

The test uses a BPF program that takes in a return value from XDP
meta data, then reduces the size of the XDP meta data by 4 bytes.

Test cases validate the possible failure cases for passing in invalid
xdp_md contexts, that the return value is successfully passed
in, and that the adjusted meta data is successfully copied out.

Co-developed-by: default avatarCody Haas <chaas@riotgames.com>
Co-developed-by: default avatarLisa Watanabe <lwatanabe@riotgames.com>
Signed-off-by: default avatarCody Haas <chaas@riotgames.com>
Signed-off-by: default avatarLisa Watanabe <lwatanabe@riotgames.com>
Signed-off-by: default avatarZvi Effron <zeffron@riotgames.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20210707221657.3985075-5-zeffron@riotgames.com
parent ec94670f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment