selftests: forwarding: lib: add netns support for tc rule handle stats get
authorHangbin Liu <liuhangbin@gmail.com>
Tue, 9 May 2023 03:11:59 +0000 (11:11 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 May 2023 08:27:20 +0000 (09:27 +0100)
commitb6d1599f8c282bfbc4d291af750436d93005b9ea
treedf65a8c1dca040c2a1d42645e0ce0532560803fa
parent84df83e0ecd3beba62c3d06b43ab51cc47efaca0
selftests: forwarding: lib: add netns support for tc rule handle stats get

When run the test in netns, it's not easy to get the tc stats via
tc_rule_handle_stats_get(). With the new netns parameter, we can get
stats from specific netns like

  num=$(tc_rule_handle_stats_get "dev eth0 ingress" 101 ".packets" "-n ns")

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/forwarding/lib.sh