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>
This commit is contained in:
parent
6a23f9a497
commit
3136a36988
@ -494,6 +494,14 @@ tc_rule_stats_get()
|
|||||||
| jq '.[1].options.actions[].stats.packets'
|
| 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()
|
mac_get()
|
||||||
{
|
{
|
||||||
local if_name=$1
|
local if_name=$1
|
||||||
|
Loading…
Reference in New Issue
Block a user