aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/net
diff options
context:
space:
mode:
authorPetr Machata <petrm@mellanox.com>2020-01-24 15:23:17 +0200
committerDavid S. Miller <davem@davemloft.net>2020-01-25 10:56:31 +0100
commitc143139b7fd36cb66afb4423ac14a1efd8a45609 (patch)
tree7abd16ac7cf80fb179f3f0e42247da2d546f9710 /tools/testing/selftests/net
parentselftests: forwarding: lib: Add helpers for busywaiting (diff)
downloadlinux-dev-c143139b7fd36cb66afb4423ac14a1efd8a45609.tar.xz
linux-dev-c143139b7fd36cb66afb4423ac14a1efd8a45609.zip
selftests: forwarding: lib: Allow reading TC rule byte counters
The function tc_rule_stats_get() fetches a packet counter of a given TC rule. Extend it to support byte counters as well by adding an optional argument with selector. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/net')
-rw-r--r--tools/testing/selftests/net/forwarding/lib.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index 096340f064db..2f5da414aaa7 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -593,9 +593,10 @@ tc_rule_stats_get()
local dev=$1; shift
local pref=$1; shift
local dir=$1; shift
+ local selector=${1:-.packets}; shift
tc -j -s filter show dev $dev ${dir:-ingress} pref $pref \
- | jq '.[1].options.actions[].stats.packets'
+ | jq ".[1].options.actions[].stats$selector"
}
ethtool_stats_get()