Skip to content

Commit

Permalink
selftests: forwarding: lib: Add ethtool_stats_get()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Petr Machata authored and David S. Miller committed Sep 20, 2018
1 parent 6a23f9a commit 3136a36
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/testing/selftests/net/forwarding/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3136a36

Please sign in to comment.