diff mbox

[net-next,mlxsw,3/5] selftests: forwarding: tc_rule_stats_get: Parameterize direction

Message ID 8474a8b0db29a4b52cc7aa315e658bf43b9b87dd.1529013676.git.petrm@mellanox.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Petr Machata June 14, 2018, 10:17 p.m. UTC
The GRE multipath tests need stats on an egress counter. Change
tc_rule_stats_get() to take direction as an optional argument, with
default of ingress.

Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 tools/testing/selftests/net/forwarding/lib.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index bce3df52f705..cdfc8e8b76b2 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -439,8 +439,9 @@  tc_rule_stats_get()
 {
 	local dev=$1; shift
 	local pref=$1; shift
+	local dir=$1; shift
 
-	tc -j -s filter show dev $dev ingress pref $pref |
+	tc -j -s filter show dev $dev ${dir:-ingress} pref $pref |
 	jq '.[1].options.actions[].stats.packets'
 }