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

Petr Machata petrm at mellanox.com
Fri Jun 15 08:17:15 AEST 2018


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 at mellanox.com>
---
 tools/testing/selftests/net/forwarding/lib.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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'
 }
 
-- 
2.4.11



More information about the Linux-mlxsw mailing list