diff options
author | Petr Machata <petrm@mellanox.com> | 2018-09-20 09:21:34 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-20 07:46:01 -0700 |
commit | 3136a3698804f55a26f68e8c897d7ccf254923ad (patch) | |
tree | 11297a29f7a1f29238959f4363b3af34c5ae56c1 /tools | |
parent | 6a23f9a49722c391c5624ad1790997cd6b6b8fef (diff) | |
download | linux-stable-3136a3698804f55a26f68e8c897d7ccf254923ad.tar.gz linux-stable-3136a3698804f55a26f68e8c897d7ccf254923ad.tar.bz2 linux-stable-3136a3698804f55a26f68e8c897d7ccf254923ad.zip |
selftests: forwarding: lib: Add ethtool_stats_get()
Add a new service function to obtain ethtool counters.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@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 | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index ca53b539aa2d..4c2351996a7f 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -494,6 +494,14 @@ tc_rule_stats_get() | jq '.[1].options.actions[].stats.packets' } +ethtool_stats_get() +{ + local dev=$1; shift + local stat=$1; shift + + ethtool -S $dev | grep "^ *$stat:" | head -n 1 | cut -d: -f2 +} + mac_get() { local if_name=$1 |