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

bpf: Support specifying ingress via xdp_md context in BPF_PROG_TEST_RUN



Support specifying the ingress_ifindex and rx_queue_index of xdp_md
contexts for BPF_PROG_TEST_RUN.

The intended use case is to allow testing XDP programs that make decisions
based on the ingress interface or RX queue.

If ingress_ifindex is specified, look up the device by the provided index
in the current namespace and use its xdp_rxq for the xdp_buff. If the
rx_queue_index is out of range, or is non-zero when the ingress_ifindex is
0, return -EINVAL.

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-4-zeffron@riotgames.com
parent 47316f4a
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