Message ID | 20211209092806.12336-13-simon.horman@corigine.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | allow user to offload tc action to net device | expand |
On 2021-12-09 04:28, Simon Horman wrote: > From: Baowen Zheng<baowen.zheng@corigine.com> > > Add selftest cases in action police with skip_hw. > Add selftest case to validate flags of filter and action. > These tests depend on corresponding iproute2 command support. > > Signed-off-by: Baowen Zheng<baowen.zheng@corigine.com> > Signed-off-by: Simon Horman<simon.horman@corigine.com> Thanks for doing this. If you have cycles add one or two tests that fail (example offload action then try to bind with match that doesnt offload, etc). Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> cheers, jamal
On December 12, 2021 3:57 AM, Jamal Hadi Salim wrote: >On 2021-12-09 04:28, Simon Horman wrote: >> From: Baowen Zheng<baowen.zheng@corigine.com> >> >> Add selftest cases in action police with skip_hw. >> Add selftest case to validate flags of filter and action. >> These tests depend on corresponding iproute2 command support. >> >> Signed-off-by: Baowen Zheng<baowen.zheng@corigine.com> >> Signed-off-by: Simon Horman<simon.horman@corigine.com> > >Thanks for doing this. If you have cycles add one or two tests that fail >(example offload action then try to bind with match that doesnt offload, etc). > Thanks, we will consider to add more tests for offloading fail cases. > >Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> > > >cheers, >jamal
diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/police.json b/tools/testing/selftests/tc-testing/tc-tests/actions/police.json index 8e45792703ed..b7205a069534 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/actions/police.json +++ b/tools/testing/selftests/tc-testing/tc-tests/actions/police.json @@ -812,5 +812,29 @@ "teardown": [ "$TC actions flush action police" ] + }, + { + "id": "7d64", + "name": "Add police action with skip_hw option", + "category": [ + "actions", + "police" + ], + "setup": [ + [ + "$TC actions flush action police", + 0, + 1, + 255 + ] + ], + "cmdUnderTest": "$TC actions add action police rate 1kbit burst 10k index 100 skip_hw", + "expExitCode": "0", + "verifyCmd": "$TC actions ls action police | grep skip_hw", + "matchPattern": "skip_hw", + "matchCount": "1", + "teardown": [ + "$TC actions flush action police" + ] } ] diff --git a/tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json b/tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json index 51799874a972..4a8d1c5fff29 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json +++ b/tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json @@ -387,5 +387,29 @@ "$TC qdisc del dev $DUMMY ingress", "$IP link del dev $DUMMY type dummy" ] + }, + { + "id": "3329", + "name": "Validate flags of the matchall filter and police action with skip_sw", + "category": [ + "filter", + "matchall" + ], + "setup": [ + "$IP link add dev $DUMMY type dummy || /bin/true", + "$TC qdisc add dev $DUMMY ingress", + "$TC actions flush action police", + "$TC actions add action police rate 1mbit burst 100k index 199 skip_hw" + ], + "cmdUnderTest": "$TC filter add dev $DUMMY parent ffff: handle 0x1 prio 1 protocol ipv4 matchall skip_sw action police index 199", + "expExitCode": "2", + "verifyCmd": "$TC filter get dev $DUMMY parent ffff: handle 1 prio 1 protocol ipv4 matchall", + "matchPattern": "^filter parent ffff: protocol ip pref 1 matchall.*handle 0x1.*", + "matchCount": "0", + "teardown": [ + "$TC qdisc del dev $DUMMY ingress", + "$IP link del dev $DUMMY type dummy", + "$TC actions del action police index 199" + ] } ]