]> git.baikalelectronics.ru Git - kernel.git/commit
xdp: Add xdp_txq_info to xdp_buff
authorDavid Ahern <dsahern@kernel.org>
Fri, 29 May 2020 22:07:14 +0000 (16:07 -0600)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 1 Jun 2020 21:48:32 +0000 (14:48 -0700)
commit7e7c75174e973874e06a714c81fe97da86943c7f
tree6d47a7f0f047306a1aede92a803a50e629b6c50a
parent80a3d07b0ea3410a275a13984c9432459287dbe7
xdp: Add xdp_txq_info to xdp_buff

Add xdp_txq_info as the Tx counterpart to xdp_rxq_info. At the
moment only the device is added. Other fields (queue_index)
can be added as use cases arise.

>From a UAPI perspective, add egress_ifindex to xdp context for
bpf programs to see the Tx device.

Update the verifier to only allow accesses to egress_ifindex by
XDP programs with BPF_XDP_DEVMAP expected attach type.

Signed-off-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/bpf/20200529220716.75383-4-dsahern@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/net/xdp.h
include/uapi/linux/bpf.h
kernel/bpf/devmap.c
net/core/filter.c
tools/include/uapi/linux/bpf.h