linux-stable/tools
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
..
accounting
arch tools headers kvm s390: Sync headers with the kernel sources 2020-08-12 08:52:32 -03:00
bootconfig tools/bootconfig: Add testcases for value override operator 2020-08-03 16:22:29 -04:00
bpf Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2020-09-23 13:11:11 -07:00
build tools, bpf/build: Cleanup feature files on make clean 2020-08-28 14:04:27 +02:00
cgroup tools/cgroup: add memcg_slabinfo.py tool 2020-08-07 11:33:25 -07:00
debugging
edid
firewire
firmware
gpio tools: gpio: fix spurious close warning in gpio-event-mon 2020-07-12 10:22:01 +02:00
hv tools: hv: change http to https in hv_kvp_daemon.c 2020-07-06 10:46:23 +00:00
iio
include bpf: Add redirect_neigh helper as redirect drop-in 2020-09-30 11:50:35 -07:00
io_uring tools/io_uring: fix compile breakage 2020-09-21 07:50:58 -06:00
kvm/kvm_stat
laptop
leds
lib libbpf: Compile in PIC mode only for shared library case 2020-09-29 17:05:31 -07:00
memory-model These were the main changes in this cycle: 2020-08-03 14:39:35 -07:00
nfsd
objtool objtool: Fix noreturn detection for ignored functions 2020-09-18 19:37:51 +02:00
pci
pcmcia
perf Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2020-09-23 13:11:11 -07:00
power ACPI updates for 5.9-rc1 2020-08-03 20:37:22 -07:00
scripts
spi spi: tools: Make default_tx/rx and input_tx static 2020-06-11 16:27:24 +01:00
testing selftests/bpf: Fix endianness issues in sk_lookup/ctx_narrow_access 2020-09-29 16:28:34 -07:00
thermal/tmon
time
usb tools: usb: move to tools buildsystem 2020-08-19 14:11:44 +02:00
virtio virtio: fixes, features 2020-08-11 14:34:17 -07:00
vm
wmi
Makefile bpf: Compile resolve_btfids tool at kernel compilation start 2020-07-13 10:42:02 -07:00