tc-policy: Manuel setup steps via tc cmdline

Yocto build have a problem with loading this via tc

 # tc filter replace dev eth1 egress prio 0xC000 handle 1 bpf da obj tc_txq_policy_kern.o
 Continuing without mounted eBPF fs. Too old kernel?
 mkdir (null)/globals failed: No such file or directory
 Unable to load program

It can be worked around via mounting BPF file-system manually:

 # mount -t bpf bpf /sys/fs/bpf/

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
This commit is contained in:
Jesper Dangaard Brouer
2022-01-31 09:17:09 +01:00
parent ae52ac2140
commit fb84a226b0

View File

@@ -9,6 +9,20 @@
//#include <stdbool.h>
//#include "../include/xdp/parsing_helpers.h"
/* Manuel setup:
export DEV=eth1
tc qdisc add dev "$DEV" clsact
tc filter add dev "$DEV" egress bpf da obj tc_txq_policy_kern.o
tc filter list dev "$DEV" egress
* Quick test reloading with tc:
tc filter replace dev "$DEV" egress prio 0xC000 handle 1 bpf da obj tc_txq_policy_kern.o
* Delete by teardown of clsact
tc qdisc delete dev "$DEV" clsact
*/
SEC("classifier")
int queue_map_4 (struct __sk_buff *skb)
{