Centos-kernel-stream-9/net/core
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
..
Makefile netdev-genl: create a simple family for netdev stuff 2023-06-13 22:45:50 +02:00
bpf_sk_storage.c bpf: Teach verifier that certain helpers accept NULL pointer. 2023-09-22 09:12:26 +02:00
datagram.c
dev.c Merge: net: core: stable backport form upstream for 9.3 phase 2 2023-07-07 07:38:20 +02:00
dev.h
dev_addr_lists.c
dev_addr_lists_test.c
dev_ioctl.c
drop_monitor.c net: extend drop reasons for multiple subsystems 2023-06-20 09:18:16 +02:00
dst.c
dst_cache.c
failover.c
fib_notifier.c
fib_rules.c
filter.c bpf: Set skb redirect and from_ingress info in __bpf_tx_skb 2023-09-22 09:12:31 +02:00
flow_dissector.c flow_dissector: Add support for HSRv0 2023-07-26 17:35:28 +02:00
flow_offload.c net: flow_offload: add support for ARP frame matching 2023-05-10 20:48:48 +02:00
gen_estimator.c treewide: Convert del_timer*() to timer_shutdown*() 2023-05-08 15:02:53 -03:00
gen_stats.c net: Remove the obsolte u64_stats_fetch_*_irq() users (net). 2023-06-08 13:38:11 +02:00
gro.c
gro_cells.c
hwbm.c
link_watch.c
lwt_bpf.c
lwtunnel.c Merge: net: enable IPV6 SEG6 2023-05-23 20:57:05 +02:00
neighbour.c
net-procfs.c
net-sysfs.c driver core: make struct class.dev_uevent() take a const * 2023-06-08 12:32:05 -04:00
net-sysfs.h
net-traces.c net: bridge: Add a tracepoint for MDB overflows 2023-05-17 12:54:07 +02:00
net_namespace.c
netclassid_cgroup.c
netdev-genl-gen.c netdev-genl: create a simple family for netdev stuff 2023-06-13 22:45:50 +02:00
netdev-genl-gen.h netdev-genl: create a simple family for netdev stuff 2023-06-13 22:45:50 +02:00
netdev-genl.c netdev-genl: create a simple family for netdev stuff 2023-06-13 22:45:50 +02:00
netevent.c
netpoll.c
netprio_cgroup.c
of_net.c
page_pool.c page_pool: fix inconsistency for page_pool_ring_[un]lock() 2023-06-29 12:37:10 +02:00
pktgen.c
ptp_classifier.c
request_sock.c
rtnetlink.c Merge: rtnetlink: a couple of fixes in linkmsg validation 2023-06-14 13:27:32 +02:00
scm.c
secure_seq.c
selftests.c
skbuff.c Merge: CNB: net: extend drop reasons for multiple subsystems 2023-08-14 14:00:39 +02:00
skmsg.c bpf, sockmap: Pass skb ownership through read_skb 2023-06-29 15:45:40 +02:00
sock.c Merge: enable io_uring 2023-05-17 07:47:08 +02:00
sock_destructor.h
sock_diag.c
sock_map.c bpf, sockmap: Revert buggy deadlock fix in the sockhash and sockmap 2023-09-22 09:12:30 +02:00
sock_reuseport.c
stream.c net: Remove WARN_ON_ONCE(sk->sk_forward_alloc) from sk_stream_kill_queues(). 2023-05-30 20:43:28 +02:00
sysctl_net_core.c
timestamping.c
tso.c
utils.c
xdp.c xdp: rss hash types representation 2023-06-14 10:44:31 +02:00