From: Sabrina Dubroca <sd@queasysnail.net>
To: netdev@vger.kernel.org
Cc: Sabrina Dubroca <sd@queasysnail.net>,
Jakub Kicinski <kuba@kernel.org>, Shuah Khan <shuah@kernel.org>,
linux-kselftest@vger.kernel.org
Subject: [PATCH net-next 8/8] selftests: netdevsim: add ethtool features to macsec offload tests
Date: Thu, 7 Nov 2024 00:13:34 +0100 [thread overview]
Message-ID: <ba801bd0a75b02de2dddbfc77f9efceb8b3d8a2e.1730929545.git.sd@queasysnail.net> (raw)
In-Reply-To: <cover.1730929545.git.sd@queasysnail.net>
The test verifies that available features aren't changed by toggling
offload on the device. Creating a device with offload off and then
enabling it later should result in the same features as creating the
device with offload enabled directly.
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
.../drivers/net/netdevsim/macsec-offload.sh | 33 +++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/tools/testing/selftests/drivers/net/netdevsim/macsec-offload.sh b/tools/testing/selftests/drivers/net/netdevsim/macsec-offload.sh
index 1f2775846ea0..98033e6667d2 100755
--- a/tools/testing/selftests/drivers/net/netdevsim/macsec-offload.sh
+++ b/tools/testing/selftests/drivers/net/netdevsim/macsec-offload.sh
@@ -75,6 +75,39 @@ for dev in ${MACSEC_NETDEV}{,2,3} ; do
done
+#
+# test ethtool features when toggling offload
+#
+
+ip link add link $NSIM_NETDEV $MACSEC_NETDEV type macsec offload mac
+TMP_FEATS_ON_1="$(ethtool -k $MACSEC_NETDEV)"
+
+ip link set $MACSEC_NETDEV type macsec offload off
+TMP_FEATS_OFF_1="$(ethtool -k $MACSEC_NETDEV)"
+
+ip link set $MACSEC_NETDEV type macsec offload mac
+TMP_FEATS_ON_2="$(ethtool -k $MACSEC_NETDEV)"
+
+[ "$TMP_FEATS_ON_1" = "$TMP_FEATS_ON_2" ]
+check $?
+
+ip link del $MACSEC_NETDEV
+
+ip link add link $NSIM_NETDEV $MACSEC_NETDEV type macsec
+check $?
+
+TMP_FEATS_OFF_2="$(ethtool -k $MACSEC_NETDEV)"
+[ "$TMP_FEATS_OFF_1" = "$TMP_FEATS_OFF_2" ]
+check $?
+
+ip link set $MACSEC_NETDEV type macsec offload mac
+check $?
+
+TMP_FEATS_ON_3="$(ethtool -k $MACSEC_NETDEV)"
+[ "$TMP_FEATS_ON_1" = "$TMP_FEATS_ON_3" ]
+check $?
+
+
if [ $num_errors -eq 0 ]; then
echo "PASSED all $((num_passes)) checks"
exit 0
--
2.47.0
next prev parent reply other threads:[~2024-11-06 23:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 23:13 [PATCH net-next 0/8] macsec: inherit lower device's features and TSO limits when offloading Sabrina Dubroca
2024-11-06 23:13 ` [PATCH net-next 1/8] netdevsim: add more hw_features Sabrina Dubroca
2024-11-11 12:15 ` Simon Horman
2024-11-06 23:13 ` [PATCH net-next 2/8] selftests: netdevsim: add a test checking ethtool features Sabrina Dubroca
2024-11-11 12:15 ` Simon Horman
2024-11-06 23:13 ` [PATCH net-next 3/8] macsec: add some of the lower device's features when offloading Sabrina Dubroca
2024-11-11 12:15 ` Simon Horman
2024-11-06 23:13 ` [PATCH net-next 4/8] macsec: clean up local variables in macsec_notify Sabrina Dubroca
2024-11-11 12:15 ` Simon Horman
2024-11-06 23:13 ` [PATCH net-next 5/8] macsec: inherit lower device's TSO limits when offloading Sabrina Dubroca
2024-11-11 12:16 ` Simon Horman
2024-11-06 23:13 ` [PATCH net-next 6/8] selftests: move macsec offload tests from net/rtnetlink to drivers/net/netdvesim Sabrina Dubroca
2024-11-11 12:16 ` Simon Horman
2024-11-06 23:13 ` [PATCH net-next 7/8] selftests: netdevsim: add test toggling macsec offload Sabrina Dubroca
2024-11-11 12:16 ` Simon Horman
2024-11-06 23:13 ` Sabrina Dubroca [this message]
2024-11-11 12:16 ` [PATCH net-next 8/8] selftests: netdevsim: add ethtool features to macsec offload tests Simon Horman
2024-11-11 22:20 ` [PATCH net-next 0/8] macsec: inherit lower device's features and TSO limits when offloading patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ba801bd0a75b02de2dddbfc77f9efceb8b3d8a2e.1730929545.git.sd@queasysnail.net \
--to=sd@queasysnail.net \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox