summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIoana Ciornei <ioana.ciornei@nxp.com>2026-03-30 18:29:25 +0300
committerPaolo Abeni <pabeni@redhat.com>2026-04-02 13:11:03 +0300
commit4799ff80c68a76e408b8dadd4aeaa5311962033c (patch)
treee6908dcf22b1e5df18e148e9f3ec2b80bb4bd431
parentcee10a01e286e88e0949979e91231270ca9fdb8e (diff)
downloadlinux-4799ff80c68a76e408b8dadd4aeaa5311962033c.tar.xz
selftests: forwarding: extend ethtool_std_stats_get with pause statistics
Even though pause frame statistics are not exported through the same ethtool command, there is no point in adding another helper just for them. Extent the ethtool_std_stats_get() function so that we are able to interrogate using the same helper all the standard statistics. And since we are touching the function, convert the initial ethtool call as well to the jq --arg form in order to be easier to read. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Reviewed-by: Petr Machata <petrm@nvidia.com> Link: https://patch.msgid.link/20260330152933.2195885-2-ioana.ciornei@nxp.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-rw-r--r--tools/testing/selftests/net/forwarding/lib.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index a9034f0bb58b..3009ce00c5dc 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -831,8 +831,14 @@ ethtool_std_stats_get()
local name=$1; shift
local src=$1; shift
- ethtool --json -S $dev --groups $grp -- --src $src | \
- jq '.[]."'"$grp"'"."'$name'"'
+ if [[ "$grp" == "pause" ]]; then
+ ethtool -I --json -a "$dev" --src "$src" | \
+ jq --arg name "$name" '.[].statistics[$name]'
+ return
+ fi
+
+ ethtool --json -S "$dev" --groups "$grp" -- --src "$src" | \
+ jq --arg grp "$grp" --arg name "$name" '.[][$grp][$name]'
}
qdisc_stats_get()