2 Commits

Author SHA1 Message Date
Jesper Dangaard Brouer
04db7bd740 preserve-dscp: Adjust for newer libbpf API
‘bpf_map__next’ is deprecated: libbpf v0.7+:
 use bpf_object__next_map() instead

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2022-09-02 15:49:40 +02:00
Toke Høiland-Jørgensen
7bb3c6ac91 Add preserve-dscp example for preserving a DSCP mark over encapsulation
This is a fun example showing how to use BPF to preserve DSCP values across
an encapsulating interface, such as Wireguard. It relies on the
encapsulation layer preserving the skb->hash value across the
encapsulation, which is commonly the case on kernel encapsulation
protocols (including Wireguard), and uses a pair of TC BPF programs and a
map to re-match the packets after encapsulation and add back the DSCP
value.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2021-06-18 00:56:08 +02:00