Commit Graph

7 Commits

Author SHA1 Message Date
Jesper Dangaard Brouer
ba2c114db0 tc-policy: Take into account locally generated traffic
The BPF-prog "not_txq_zero" also needed to take into account
that skb->queue_mapping usually isn't set for locally
generated traffic.

I worry that sockets can set another queue id that could
override our (BPF choice) in netdev_pick_tx().
See sk_tx_queue_set() and sk_tx_queue_get().

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2022-02-01 13:28:20 +01:00
Jesper Dangaard Brouer
a3af1bb99c tc-policy: Implement new BPF section that disallow using TXQ zero
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2022-02-01 13:11:31 +01:00
Jesper Dangaard Brouer
520d2e6109 tc-policy: Add README documentation
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2022-01-31 21:40:18 +01:00
Jesper Dangaard Brouer
9fba4b12ac tc-policy: Fix issue of too many TC-BPF filter prog attached multi
This seems to be a common occuring issue with tc cmdline.
And the C-code have inherited the issue in the API.

Trying to replace a TC-BPF prog often result in appending a new prog
(as a new tc filter instance).

Be careful to set both handle and prio and the replace flag.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2022-01-31 15:20:38 +01:00
Jesper Dangaard Brouer
dcdceea90c tc-policy: Add C-code boilerplate tc_txq_policy.c
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2022-01-31 12:10:45 +01:00
Jesper Dangaard Brouer
fb84a226b0 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>
2022-01-31 09:17:09 +01:00
Jesper Dangaard Brouer
8fbccb90ab tc-policy: Simple approach static map to TXq 4
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2022-01-28 17:25:08 +01:00