TencentOS-kernel/net
Daniel Borkmann 13dc0ea1ed bpf: Add redirect_peer helper
Add an efficient ingress to ingress netns switch that can be used out of tc BPF
programs in order to redirect traffic from host ns ingress into a container
veth device ingress without having to go via CPU backlog queue [0]. For local
containers this can also be utilized and path via CPU backlog queue only needs
to be taken once, not twice. On a high level this borrows from ipvlan which does
similar switch in __netif_receive_skb_core() and then iterates via another_round.
This helps to reduce latency for mentioned use cases.

Pod to remote pod with redirect(), TCP_RR [1]:

  # percpu_netperf 10.217.1.33
          RT_LATENCY:         122.450         (per CPU:         122.666         122.401         122.333         122.401 )
        MEAN_LATENCY:         121.210         (per CPU:         121.100         121.260         121.320         121.160 )
      STDDEV_LATENCY:         120.040         (per CPU:         119.420         119.910         125.460         115.370 )
         MIN_LATENCY:          46.500         (per CPU:          47.000          47.000          47.000          45.000 )
         P50_LATENCY:         118.500         (per CPU:         118.000         119.000         118.000         119.000 )
         P90_LATENCY:         127.500         (per CPU:         127.000         128.000         127.000         128.000 )
         P99_LATENCY:         130.750         (per CPU:         131.000         131.000         129.000         132.000 )

    TRANSACTION_RATE:       32666.400         (per CPU:        8152.200        8169.842        8174.439        8169.897 )

Pod to remote pod with redirect_peer(), TCP_RR:

  # percpu_netperf 10.217.1.33
          RT_LATENCY:          44.449         (per CPU:          43.767          43.127          45.279          45.622 )
        MEAN_LATENCY:          45.065         (per CPU:          44.030          45.530          45.190          45.510 )
      STDDEV_LATENCY:          84.823         (per CPU:          66.770          97.290          84.380          90.850 )
         MIN_LATENCY:          33.500         (per CPU:          33.000          33.000          34.000          34.000 )
         P50_LATENCY:          43.250         (per CPU:          43.000          43.000          43.000          44.000 )
         P90_LATENCY:          46.750         (per CPU:          46.000          47.000          47.000          47.000 )
         P99_LATENCY:          52.750         (per CPU:          51.000          54.000          53.000          53.000 )

    TRANSACTION_RATE:       90039.500         (per CPU:       22848.186       23187.089       22085.077       21919.130 )

  [0] https://linuxplumbersconf.org/event/7/contributions/674/attachments/568/1002/plumbers_2020_cilium_load_balancer.pdf
  [1] https://github.com/borkmann/netperf_scripts/blob/master/percpu_netperf

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201010234006.7075-3-daniel@iogearbox.net
2022-08-30 11:33:35 +08:00
..
6lowpan Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
9p net: 9p: initialize sun_server.sun_path to have addr's value only when addr is valid 2021-03-16 16:39:51 +08:00
802 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
8021q net: vlan: avoid leaks on register_vlan_dev() failures 2021-04-12 12:51:15 +08:00
appletalk appletalk: Fix skb allocation size in loopback case 2021-05-20 16:06:48 +08:00
atm atm: fix a memory leak of vcc->user_back 2021-03-16 16:37:15 +08:00
ax25 AX.25: Prevent integer overflows in connect and sendmsg 2021-03-16 16:32:42 +08:00
batman-adv batman-adv: initialize "struct batadv_tvlv_tt_vlan_data"->reserved field 2021-05-20 16:06:56 +08:00
bluetooth bluetooth: eliminate the potential race condition when removing the HCI controller 2021-05-20 16:07:38 +08:00
bpf bpf: Add selftests for BPF_MODIFY_RETURN 2022-08-30 11:33:31 +08:00
bpfilter net/bpfilter: remove superfluous testing message 2021-03-16 16:26:23 +08:00
bridge net: bridge: mcast: fix broken length + header check for MRDv6 Adv. 2021-05-20 16:08:01 +08:00
caif Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
can can: bcm/raw: fix msg_namelen values depending on CAN_REQUIRED_SIZE 2021-05-20 16:07:00 +08:00
ceph libceph: clear con->out_msg on Policy::stateful_server faults 2021-03-16 16:40:11 +08:00
core bpf: Add redirect_peer helper 2022-08-30 11:33:35 +08:00
dcb net: dcb: Accept RTM_GETDCB messages carrying set-like DCB commands 2021-04-12 12:51:30 +08:00
dccp inet_diag: Move the INET_DIAG_REQ_BYTECODE nlattr to cb->data 2022-08-30 11:33:28 +08:00
decnet Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
dns_resolver KEYS: Don't write out to userspace while holding key semaphore 2021-03-16 16:26:42 +08:00
dsa net: dsa: tag_mtk: fix 802.1ad VLAN egress 2021-04-12 12:53:14 +08:00
ethernet Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hsr hsr: use netdev_err() instead of WARN_ONCE() 2021-05-20 16:07:38 +08:00
ieee802154 net: ieee802154: forbid monitor for add llsec seclevel 2021-05-20 16:07:10 +08:00
ife Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ipv4 bpf: Allow any port in bpf_bind helper 2022-08-30 11:33:35 +08:00
ipv6 bpf: Allow any port in bpf_bind helper 2022-08-30 11:33:35 +08:00
iucv net/af_iucv: remove WARN_ONCE on malformed RX packets 2021-04-12 12:52:44 +08:00
kcm Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
key af_key: relax availability checks for skb size calculation 2021-04-12 12:51:58 +08:00
l2tp l2tp: remove skb_dst_set() from l2tp_xmit_skb() 2021-03-16 16:31:43 +08:00
l3mdev Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
lapb net: lapb: Copy the skb before sending a packet 2021-04-12 12:51:53 +08:00
llc net: silence data-races on sk_backlog.tail 2021-03-16 16:36:36 +08:00
mac80211 mac80211: bail out if cipher schemes are invalid 2021-05-20 16:07:57 +08:00
mac802154 net: mac802154: Fix general protection fault 2021-05-20 16:07:04 +08:00
mpls net: avoid infinite loop in mpls_gso_segment when mpls_hlen == 0 2021-04-12 12:52:56 +08:00
ncsi net/ncsi: Avoid channel_monitor hrtimer deadlock 2021-05-20 16:07:00 +08:00
netfilter netfilter: nf_tables_offload: incorrect flow offload action array size 2022-04-06 16:56:54 +08:00
netlabel cipso,calipso: resolve a number of problems with the DOI refcounts 2021-04-12 12:52:59 +08:00
netlink bpf: Refactor bpf_iter_reg to have separate seq_info member 2022-08-30 11:33:28 +08:00
netrom net: netrom: Fix potential nr_neigh refcnt leak in nr_add_node 2021-03-16 16:26:51 +08:00
nfc net:nfc:digital: Fix a double free in digital_tg_recv_dep_req 2021-05-20 16:08:01 +08:00
nsh Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
openvswitch openvswitch: fix stack OOB read while fragmenting IPv4 packets 2021-05-20 16:07:33 +08:00
packet net/packet: fix packet_sock xmit return value checking 2022-08-08 14:58:13 +08:00
phonet Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
psample Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
qrtr net: qrtr: fix a kernel-infoleak in qrtr_recvmsg() 2021-04-12 12:53:32 +08:00
rds net/rds: Fix a use after free in rds_message_map_pages 2021-05-20 16:07:01 +08:00
rfkill rfkill: Fix use-after-free in rfkill_resume() 2021-03-16 16:41:16 +08:00
rose rose: Fix Null pointer dereference in rose_send_frame() 2021-03-16 16:41:52 +08:00
rxrpc rxrpc: Fix clearance of Tx/Rx ring when releasing a call 2021-04-12 12:52:05 +08:00
sched bpf: Add socket assign support 2022-08-30 11:33:23 +08:00
sctp inet_diag: Move the INET_DIAG_REQ_BYTECODE nlattr to cb->data 2022-08-30 11:33:28 +08:00
smc net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid() 2021-03-16 16:41:07 +08:00
strparser Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sunrpc rpc: fix NULL dereference on kmalloc failure 2021-05-20 16:06:45 +08:00
switchdev net: switchdev: don't set port_obj_info->handled true when -EOPNOTSUPP 2021-04-12 12:51:48 +08:00
tipc net:tipc: Fix a double free in tipc_sk_mcast_rcv 2021-05-20 16:07:00 +08:00
tls net, sk_msg: Annotate lockless access to sk_prot on clone 2022-08-30 11:33:20 +08:00
toa net: csig toa patch 2022-04-06 16:55:16 +08:00
unix skbuff: fix a data race in skb_queue_len() 2021-03-16 16:36:50 +08:00
vmw_vsock vsock/vmci: log once the failed queue pair allocation 2021-05-20 16:07:59 +08:00
wimax Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
wireless cfg80211: scan: drop entry from hidden_list on overflow 2021-05-20 16:07:41 +08:00
x25 net/x25: prevent a couple of overflows 2021-03-16 16:41:56 +08:00
xdp xsk: Replace datagram_poll by sock_poll_wait 2021-03-16 16:42:25 +08:00
xfrm net: xfrm: Localize sequence counter per network namespace 2021-05-20 16:06:58 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
compat.c net/compat: Add missing sock updates for SCM_RIGHTS 2021-03-16 16:34:05 +08:00
socket.c net: Set fput_needed iff FDPUT_FPUT is set 2021-03-16 16:33:49 +08:00
sysctl_net.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00