android_kernel_xiaomi_sm8450/tools/include/uapi/linux
Daniel Borkmann b4ab314149 bpf: Add redirect_neigh helper as redirect drop-in
Add a redirect_neigh() helper as redirect() drop-in replacement
for the xmit side. Main idea for the helper is to be very similar
in semantics to the latter just that the skb gets injected into
the neighboring subsystem in order to let the stack do the work
it knows best anyway to populate the L2 addresses of the packet
and then hand over to dev_queue_xmit() as redirect() does.

This solves two bigger items: i) skbs don't need to go up to the
stack on the host facing veth ingress side for traffic egressing
the container to achieve the same for populating L2 which also
has the huge advantage that ii) the skb->sk won't get orphaned in
ip_rcv_core() when entering the IP routing layer on the host stack.

Given that skb->sk neither gets orphaned when crossing the netns
as per 9c4c325252 ("skbuff: preserve sock reference when scrubbing
the skb.") the helper can then push the skbs directly to the phys
device where FQ scheduler can do its work and TCP stack gets proper
backpressure given we hold on to skb->sk as long as skb is still
residing in queues.

With the helper used in BPF data path to then push the skb to the
phys device, I observed a stable/consistent TCP_STREAM improvement
on veth devices for traffic going container -> host -> host ->
container from ~10Gbps to ~15Gbps for a single stream in my test
environment.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: David Ahern <dsahern@gmail.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Cc: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/bpf/f207de81629e1724899b73b8112e0013be782d35.1601477936.git.daniel@iogearbox.net
2020-09-30 11:50:35 -07:00
..
tc_act net: Move all TC actions identifiers to one place 2019-02-10 09:28:43 -08:00
bpf_common.h bpf: Sync kernel ABI header with tooling header for bpf_common.h 2018-02-09 00:24:38 +01:00
bpf_perf_event.h selftests/bpf: sync kernel headers and introduce arch support in Makefile 2017-12-05 15:02:41 +01:00
bpf.h bpf: Add redirect_neigh helper as redirect drop-in 2020-09-30 11:50:35 -07:00
btf.h libbpf: Sanitize global functions 2020-01-10 17:20:07 +01:00
const.h tools headers: Grab copy of linux/const.h, needed by linux/bits.h 2019-08-20 12:08:23 -03:00
erspan.h tools, include: Grab a copy of linux/erspan.h 2018-04-30 17:56:24 +02:00
ethtool.h libbpf: add support for using AF_XDP sockets 2019-02-25 23:21:42 +01:00
fadvise.h tools headers uapi: Grab a copy of fadvise.h 2018-12-18 16:17:40 -03:00
fcntl.h tools headers API: Update faccessat2 affected files 2020-06-09 12:40:03 -03:00
filter.h tools: bpf: Use local copy of headers including uapi/linux/filter.h 2020-07-21 10:50:35 +01:00
fs.h tools headers UAPI: Sync linux/fs.h with the kernel sources 2020-06-17 13:23:02 -03:00
fscrypt.h tools headers UAPI: Sync linux/fscrypt.h with the kernel sources 2020-06-09 12:40:04 -03:00
hw_breakpoint.h tools/headers: Synchronize kernel ABI headers 2017-11-04 09:27:46 +01:00
if_link.h net: bridge: Add port attribute IFLA_BRPORT_MRP_IN_OPEN 2020-07-14 13:46:43 -07:00
if_tun.h selftests/bpf: fix compilation error for flow_dissector.c 2019-05-29 15:15:07 +02:00
if_xdp.h xsk: Add new statistics 2020-07-13 15:32:56 -07:00
in.h tools headers UAPI: update linux/in.h copy 2020-09-14 19:06:41 -03:00
kcmp.h tools headers: Synchronize kernel ABI headers wrt SPDX tags 2017-11-28 14:29:20 -03:00
kvm.h tools headers UAPI: Sync kvm.h headers with the kernel sources 2020-09-14 19:02:18 -03:00
lirc.h media: rc: rcmm decoder and encoder 2019-02-18 15:39:49 -05:00
mman.h tools headers UAPI: Sync linux/mman.h with the kernel 2020-04-14 09:04:53 -03:00
mount.h tools include UAPI: Update copy of files related to new fspick, fsmount, fsconfig, fsopen, move_mount and open_tree syscalls 2019-05-28 09:49:03 -03:00
netlink.h net: netlink: rename NETLINK_DUMP_STRICT_CHK -> NETLINK_GET_STRICT_CHK 2018-12-14 11:44:31 -08:00
openat2.h tools include UAPI: Sync x86's syscalls_64.tbl, generic unistd.h and fcntl.h to pick up openat2 and pidfd_getfd 2020-02-11 16:41:06 -03:00
perf_event.h perf tools: Correct SNOOPX field offset 2020-09-01 12:19:16 -03:00
pkt_cls.h net: sched: remove NET_CLS_IND config option 2019-06-15 14:06:13 -07:00
pkt_sched.h bpf: pull in pkt_sched.h header for tooling to fix bpftool build 2019-01-18 15:16:36 -08:00
prctl.h tools headers UAPI: Sync prctl.h with the kernel sources 2020-02-11 16:41:50 -03:00
sched.h tools headers UAPI: Sync sched.h with the kernel 2020-04-14 09:01:08 -03:00
seg6_local.h selftests/bpf: missing headers test_lwt_seg6local 2018-05-28 17:41:00 +02:00
seg6.h selftests/bpf: missing headers test_lwt_seg6local 2018-05-28 17:41:00 +02:00
stat.h tools headers uapi: Sync linux/stat.h with the kernel sources 2020-06-09 12:40:03 -03:00
tls.h bpf, tls: add tls header to tools infrastructure 2018-10-16 08:10:01 -07:00
types.h tools/bpf: Move linux/types.h for selftests and bpftool 2020-03-13 20:56:34 +01:00
usbdevice_fs.h tools headers uapi: Sync linux/usbdevice_fs.h with the kernel sources 2019-09-30 17:29:02 -03:00
vhost.h tools include UAPI: Sync linux/vhost.h with the kernel sources 2020-08-12 08:57:07 -03:00