Re: [PATCH net] net/sched: act_api: deny mismatched skip_sw/skip_hw flags for actions created by classifiers
From: Cong Wang
Date: Sat Oct 26 2024 - 13:03:31 EST
On Thu, Oct 17, 2024 at 07:10:48PM +0300, Vladimir Oltean wrote:
> There are 3 more important cases to discuss. First there is this command:
>
> $ tc qdisc add dev eth0 clasct
> $ tc filter add dev eth0 ingress matchall skip_sw \
> action mirred ingress mirror dev eth1
>
> which should be allowed, because prior to the concept of dedicated
> action flags, it used to work and it used to mean the action inherited
> the skip_sw/skip_hw flags from the classifier. It's not a mismatch.
>
> Then we have this command:
>
> $ tc qdisc add dev eth0 clasct
> $ tc filter add dev eth0 ingress matchall skip_sw \
> action mirred ingress mirror dev eth1 skip_hw
>
> where there is a mismatch and it should be rejected.
>
> Finally, we have:
>
> $ tc qdisc add dev eth0 clasct
> $ tc filter add dev eth0 ingress matchall skip_sw \
> action mirred ingress mirror dev eth1 skip_sw
>
> where the offload flags coincide, and this should be treated the same as
> the first command based on inheritance, and accepted.
>
Can we add some selftests to cover the above cases?
Thanks.