diff options
author | Petr Machata <petrm@mellanox.com> | 2020-01-24 15:23:17 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-01-25 10:56:31 +0100 |
commit | c143139b7fd36cb66afb4423ac14a1efd8a45609 (patch) | |
tree | 7abd16ac7cf80fb179f3f0e42247da2d546f9710 /tools | |
parent | 4121d9479b24c20ff7d3e7b62a7cf330fae7b2af (diff) |
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')
-rw-r--r-- | tools/testing/selftests/net/forwarding/lib.sh | 3 |
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() |