提交 d1038cd0 编写于 作者: P Petr Machata 提交者: David S. Miller

selftests: forwarding: lib: Add link_stats_rx_errors_get()

Such a function will be useful for counting malformed packets in the ECN
decap test.

To that end, introduce a common handler for handling stat-fetching, and
reuse it in link_stats_tx_packets_get() and link_stats_rx_errors_get().
Signed-off-by: NPetr Machata <petrm@mellanox.com>
Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d20b0f21
......@@ -477,11 +477,24 @@ master_name_get()
ip -j link show dev $if_name | jq -r '.[]["master"]'
}
link_stats_get()
{
local if_name=$1; shift
local dir=$1; shift
local stat=$1; shift
ip -j -s link show dev $if_name \
| jq '.[]["stats64"]["'$dir'"]["'$stat'"]'
}
link_stats_tx_packets_get()
{
local if_name=$1
link_stats_get $1 tx packets
}
ip -j -s link show dev $if_name | jq '.[]["stats64"]["tx"]["packets"]'
link_stats_rx_errors_get()
{
link_stats_get $1 rx errors
}
tc_rule_stats_get()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册