TencentOS-kernel/drivers/net
Daniel Borkmann 3c899fa7ce 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-01 10:23:57 +08:00
..
appletalk Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
arcnet Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
bonding net: bonding proc file 2021-03-16 16:43:58 +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 drivers: net: fix memory leak in peak_usb_create_dev 2021-05-20 16:07:04 +08:00
dsa net: phy: marvell: fix detection of PHY on Topaz switches 2021-05-20 16:07:14 +08:00
ethernet drivers/net/bnxt: fix xdp initialization error in bnxt_xdp.c 2022-07-27 11:52:54 +08:00
fddi FDDI: defxx: Bail out gracefully with unassigned PCI resource for CSR 2021-05-20 16:07:40 +08:00
fjes Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hamradio yam: fix possible memory leak in yam_init_driver 2021-03-16 16:30:06 +08:00
hippi hippi: Fix a size used in a 'pci_free_consistent()' in an error handling path 2021-03-16 16:32:23 +08:00
hyperv hv_netvsc: Remove "unlikely" from netvsc_select_queue 2021-03-16 16:36:11 +08:00
ieee802154 drivers: net: fix memory leak in atusb_probe 2021-05-20 16:07:03 +08:00
ipvlan ipvlan: fix device features 2021-03-16 16:34:45 +08:00
netdevsim netdevsim: init u64 stats for 32bit hardware 2021-04-12 12:52:59 +08:00
phy net: phy: intel-xway: enable integrated led functions 2021-05-20 16:08:00 +08:00
plip Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ppp pppoe: only process PADT targeted at local interfaces 2021-03-16 16:27:47 +08:00
slip Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
team team: protect features update by RCU to avoid deadlock 2021-04-12 12:51:48 +08:00
usb net: usb: ax88179_178a: initialize local variables before use 2021-05-20 16:07:17 +08:00
vmxnet3 vmxnet3: use correct tcp hdr length when packet is encapsulated 2021-03-16 16:33:49 +08:00
wan net: lapbether: Prevent racing when checking whether the netif is running 2021-05-20 16:07:55 +08:00
wimax staging: wimax/i2400m: fix byte-order issue 2021-05-20 16:07:23 +08:00
wireless ath10k: Fix ath10k_wmi_tlv_op_pull_peer_stats_info() unlock without lock 2021-05-20 16:08:00 +08:00
xen-netback xen-netback: Check for hotplug-status existence before watching 2021-05-20 16:07:15 +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
LICENSE.SRC 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
Space.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
dummy.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
eql.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
geneve.c net: geneve: modify IP header check in geneve6_xmit_skb and geneve_xmit_skb 2021-05-20 16:08:00 +08:00
gtp.c net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending 2021-04-12 12:52:42 +08:00
ifb.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
loopback.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
macsec.c macsec: avoid use-after-free in macsec_handle_frame() 2021-03-16 16:37:58 +08:00
macvlan.c macvlan: validate setting of multiple remote source MAC addresses 2021-03-16 16:35:08 +08:00
macvtap.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
mdio.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
mii.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
net_failover.c net_failover: fixed rollback in net_failover_open() 2021-03-16 16:28:54 +08:00
netconsole.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
nlmon.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
ntb_netdev.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
rionet.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
sb1000.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
sungem_phy.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
tap.c net: tap: track dropped skb via kfree_skb_reason() 2022-06-17 10:08:51 +08:00
thunderbolt.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
tun.c net: tun: track dropped skb via kfree_skb_reason() 2022-06-17 10:08:51 +08:00
veth.c bpf: Add redirect_peer helper 2022-08-01 10:23:57 +08:00
virtio_net.c virtio_net: Add timeout protection to virnet_send_command 2022-04-19 16:17:45 +08:00
vrf.c vrf: packets with lladdr src needs dst at input with orig_iif when needs strict 2021-03-16 16:42:16 +08:00
vsockmon.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
vxlan.c vxlan: move debug check after netdev unregister 2021-04-12 12:52:31 +08:00
xen-netfront.c xen-netfront: fix potential deadlock in xennet_remove() 2021-03-16 16:32:57 +08:00