Skip to content

Commit 25334ea

Browse files
author
Sabrina Dubroca
committed
selftests: netdevsim: add a test checking ethtool features
JIRA: https://issues.redhat.com/browse/RHEL-26055 commit 0189270 Author: Sabrina Dubroca <sd@queasysnail.net> Date: Thu Nov 7 00:13:28 2024 +0100 selftests: netdevsim: add a test checking ethtool features Add a test checking that some features are active by default and changeable. Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/fff58fa70f8a300440958b5020f6a4eb2e9dad61.1730929545.git.sd@queasysnail.net Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sabrina Dubroca <sdubroca@redhat.com>
1 parent f329df0 commit 25334ea

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

tools/testing/selftests/drivers/net/netdevsim/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ TEST_PROGS = devlink.sh \
44
devlink_in_netns.sh \
55
devlink_trap.sh \
66
ethtool-coalesce.sh \
7+
ethtool-features.sh \
78
ethtool-fec.sh \
89
ethtool-pause.sh \
910
ethtool-ring.sh \
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
4+
source ethtool-common.sh
5+
6+
NSIM_NETDEV=$(make_netdev)
7+
8+
set -o pipefail
9+
10+
FEATS="
11+
tx-checksum-ip-generic
12+
tx-scatter-gather
13+
tx-tcp-segmentation
14+
generic-segmentation-offload
15+
generic-receive-offload"
16+
17+
for feat in $FEATS ; do
18+
s=$(ethtool --json -k $NSIM_NETDEV | jq ".[].\"$feat\".active" 2>/dev/null)
19+
check $? "$s" true
20+
21+
s=$(ethtool --json -k $NSIM_NETDEV | jq ".[].\"$feat\".fixed" 2>/dev/null)
22+
check $? "$s" false
23+
done
24+
25+
if [ $num_errors -eq 0 ]; then
26+
echo "PASSED all $((num_passes)) checks"
27+
exit 0
28+
else
29+
echo "FAILED $num_errors/$((num_errors+num_passes)) checks"
30+
exit 1
31+
fi

0 commit comments

Comments
 (0)