Centos-kernel-stream-9/net
Artem Savkov 6643a3bc2b bpf: Set skb redirect and from_ingress info in __bpf_tx_skb
Bugzilla: https://bugzilla.redhat.com/2221599

commit 59e498a3289f685261c076b998a8a2f8a516874f
Author: Daniel Borkmann <daniel@iogearbox.net>
Date:   Mon Apr 17 15:49:15 2023 +0200

    bpf: Set skb redirect and from_ingress info in __bpf_tx_skb
    
    There are some use-cases where it is desirable to use bpf_redirect()
    in combination with ifb device, which currently is not supported, for
    example, around filtering inbound traffic with BPF to then push it to
    ifb which holds the qdisc for shaping in contrast to doing that on the
    egress device.
    
    Toke mentions the following case related to OpenWrt:
    
       Because there's not always a single egress on the other side. These are
       mainly home routers, which tend to have one or more WiFi devices bridged
       to one or more ethernet ports on the LAN side, and a single upstream WAN
       port. And the objective is to control the total amount of traffic going
       over the WAN link (in both directions), to deal with bufferbloat in the
       ISP network (which is sadly still all too prevalent).
    
       In this setup, the traffic can be split arbitrarily between the links
       on the LAN side, and the only "single bottleneck" is the WAN link. So we
       install both egress and ingress shapers on this, configured to something
       like 95-98% of the true link bandwidth, thus moving the queues into the
       qdisc layer in the router. It's usually necessary to set the ingress
       bandwidth shaper a bit lower than the egress due to being "downstream"
       of the bottleneck link, but it does work surprisingly well.
    
       We usually use something like a matchall filter to put all ingress
       traffic on the ifb, so doing the redirect from BPF has not been an
       immediate requirement thus far. However, it does seem a bit odd that
       this is not possible, and we do have a BPF-based filter that layers on
       top of this kind of setup, which currently uses u32 as the ingress
       filter and so it could presumably be improved to use BPF instead if
       that was available.
    
    Reported-by: Toke Høiland-Jørgensen <toke@redhat.com>
    Reported-by: Yafang Shao <laoar.shao@gmail.com>
    Reported-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Acked-by: Yafang Shao <laoar.shao@gmail.com>
    Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
    Link: https://git.openwrt.org/?p=project/qosify.git;a=blob;f=README
    Link: https://lore.kernel.org/bpf/875y9yzbuy.fsf@toke.dk
    Link: https://lore.kernel.org/r/8cebc8b2b6e967e10cbafe2ffd6795050e74accd.1681739137.git.daniel@iogearbox.net
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2023-09-22 09:12:31 +02:00
..
6lowpan
9p
802
8021q vlan: partially enable SIOCSHWTSTAMP in container 2023-07-03 10:57:39 +02:00
appletalk
atm driver core: make struct class.dev_uevent() take a const * 2023-06-08 12:32:05 -04:00
ax25
batman-adv
bluetooth Merge: Bluetooth: L2CAP: Fix u8 overflow 2023-09-21 09:45:22 -04:00
bpf bpf: Remove bpf_kfunc_call_test_kptr_get() test kfunc 2023-09-22 09:12:30 +02:00
bpfilter
bridge net: add vlan_get_protocol_and_depth() helper 2023-06-26 16:58:59 +02:00
caif net: Remove WARN_ON_ONCE(sk->sk_forward_alloc) from sk_stream_kill_queues(). 2023-05-30 20:43:28 +02:00
can
ceph libceph: fix potential hang in ceph_osdc_notify() 2023-08-04 22:22:10 +02:00
core bpf: Set skb redirect and from_ingress info in __bpf_tx_skb 2023-09-22 09:12:31 +02:00
dcb
dccp Merge: net: core: stable backports for 9.3 phase 1 2023-05-16 11:49:41 +02:00
decnet
devlink devlink: Fix crash with CONFIG_NET_NS=n 2023-07-03 10:57:40 +02:00
dns_resolver
dsa Merge: CNB: net: adopt u64_stats_t & remove obsolete u64_stats_fetch_*_irq() functions 2023-06-13 14:02:50 +02:00
ethernet
ethtool
hsr hsr: ratelimit only when errors are printed 2023-07-26 17:35:32 +02:00
ieee802154
ife
ipv4 bpf: Remove unused arguments from btf_struct_access(). 2023-09-22 09:12:26 +02:00
ipv6 Merge: netfilter: nf_tables: Support resetting state in rules and set elements 2023-08-10 17:14:39 +00:00
iucv net/af_iucv: Use struct_group() to zero struct iucv_sock region 2023-06-12 08:40:01 +00:00
kcm
key net: deprecate PF_KEY 2023-08-07 10:35:09 +02:00
l2tp
l3mdev
lapb
llc
mac80211 wifi: mac80211: report all unusable beacon frames 2023-07-26 13:16:37 +02:00
mac802154
mpls net: Remove the obsolte u64_stats_fetch_*_irq() users (net). 2023-06-08 13:38:11 +02:00
mptcp mptcp: do not rely on implicit state check in mptcp_listen() 2023-07-12 12:28:05 +02:00
ncsi net/ncsi: use proper "mellanox" DT vendor prefix 2023-06-21 19:06:38 -04:00
netfilter bpf: Remove unused arguments from btf_struct_access(). 2023-09-22 09:12:26 +02:00
netlabel
netlink
netrom
nfc
nsh
openvswitch net: openvswitch: add misc error drop reasons 2023-08-21 08:34:23 +02:00
packet Merge: net/other: phase-2 backports for RHEL-9.3 2023-07-21 17:32:19 +02:00
phonet
psample
qrtr
rds
rfkill net: rfkill-gpio: Add explicit include for of.h 2023-07-26 13:15:30 +02:00
rose
rxrpc rxrpc: Truncate UTS_RELEASE for rxrpc version 2023-07-14 10:35:47 -03:00
sched Merge: net/sched: cls_fw: Fix improper refcount update leads to use-after-free 2023-09-07 15:00:53 +02:00
sctp sctp: fix potential deadlock on &net->sctp.addr_wq_lock 2023-07-02 12:36:19 -04:00
smc net/smc: Fix device de-init sequence 2023-05-26 09:39:21 +00:00
strparser
sunrpc nfsd: fix double fget() bug in __write_ports_addfd() 2023-06-14 15:44:46 -04:00
switchdev
tipc net: tipc: resize nlattr array to correct size 2023-07-08 14:44:09 -04:00
tls tls: improve lockless access safety of tls_err_abort() 2023-07-05 15:14:34 +02:00
unix bpf, sockmap: Pass skb ownership through read_skb 2023-06-29 15:45:40 +02:00
vmw_vsock virtio_transport: temporarily do not depend on ANY_LAYOUT support 2023-07-28 17:41:58 +02:00
wireless wifi: cfg80211: Fix return value in scan logic 2023-07-26 13:16:42 +02:00
x25
xdp bpf: return long from bpf_map_ops funcs 2023-09-22 09:12:19 +02:00
xfrm Merge: xfrm: out-of-bounds read of XFRMA_MTIMER_THRESH nlattr 2023-08-18 16:21:26 +02:00
Kconfig
Kconfig.debug
Makefile
compat.c
devres.c
socket.c
sysctl_net.c