You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A tc classifier eBPF program can set the tc_classid field to specify the class that should be used to handle the packet. A direct-action eBPF program only supports setting the minor 16 bits of the classid, meaning the classid/flowid attribute needs to be set on the eBPF configuration for it to work. AYA currently doesn't support setting the classid/flowid attribute(via TCA_BPF_CLASSID) on a classifier program.
Since the program can only set the minor 16 bits and the major 16 bits need to be set, setting the tc_classid field from bpf has no effect unless the program classid/flowid is set.
A tc classifier eBPF program can set the
tc_classid
field to specify the class that should be used to handle the packet. A direct-action eBPF program only supports setting the minor 16 bits of theclassid
, meaning theclassid/flowid
attribute needs to be set on the eBPF configuration for it to work. AYA currently doesn't support setting theclassid/flowid
attribute(viaTCA_BPF_CLASSID
) on a classifier program.Explaination
An aya tc classifier program is always
direct-action
https://github.com/aya-rs/aya/blob/main/aya/src/sys/netlink.rs#L161-L162
direct-action
means exts_integratedhttps://github.com/torvalds/linux/blob/master/net/sched/cls_bpf.c#L480
If
exts_integrated
, theclassid
isprog->res.classid
(a 32bit integer)OR
ed withqdisc_skb_cb(skb)->tc_classid
, which is a 16bit integer - meaning the bpf program can only set the minor 16 bits.https://github.com/torvalds/linux/blob/master/net/sched/cls_bpf.c#L110-L119
Since the program can only set the minor 16 bits and the major 16 bits need to be set, setting the
tc_classid
field from bpf has no effect unless the programclassid/flowid
is set.Note: calling the property
classid/flowid
because that's whattc
accepts and outputs asflowid
(parsingclassid/flowid
https://github.com/iproute2/iproute2/blob/d9b886d745ada3b8481e041ceca579c6f3acbea3/tc/f_bpf.c#L123-L132C26)
I've verified it works with the following change:
The text was updated successfully, but these errors were encountered: