Skip to content

Commit 6f4a958

Browse files
author
Sabrina Dubroca
committed
selftests: netdevsim: add test toggling macsec offload
JIRA: https://issues.redhat.com/browse/RHEL-26055 commit 29084ea Author: Sabrina Dubroca <sd@queasysnail.net> Date: Thu Nov 7 00:13:33 2024 +0100 selftests: netdevsim: add test toggling macsec offload The test verifies that toggling offload works (both via rtnetlink and macsec's genetlink APIs). This is only possible when no SA is configured. Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/bf8e27ee0d921caa4eb35f1e830eca6d4080ddb2.1730929545.git.sd@queasysnail.net Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sabrina Dubroca <sdubroca@redhat.com>
1 parent b4f9763 commit 6f4a958

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tools/testing/selftests/drivers/net/netdevsim/macsec-offload.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,27 @@ check $?
4848
ip macsec add "${MACSEC_NETDEV}" rx port 1235 address "1c:ed:de:ad:be:ef" 2> /dev/null
4949
check $? '' '' 1
5050

51+
# can't disable macsec offload when SAs are configured
52+
ip link set "${MACSEC_NETDEV}" type macsec offload off 2> /dev/null
53+
check $? '' '' 1
54+
55+
ip macsec offload "${MACSEC_NETDEV}" off 2> /dev/null
56+
check $? '' '' 1
57+
58+
# toggle macsec offload via rtnetlink
59+
ip link set "${MACSEC_NETDEV}2" type macsec offload off
60+
check $?
61+
62+
ip link set "${MACSEC_NETDEV}2" type macsec offload mac
63+
check $?
64+
65+
# toggle macsec offload via genetlink
66+
ip macsec offload "${MACSEC_NETDEV}2" off
67+
check $?
68+
69+
ip macsec offload "${MACSEC_NETDEV}2" mac
70+
check $?
71+
5172
for dev in ${MACSEC_NETDEV}{,2,3} ; do
5273
ip link del $dev
5374
check $?

0 commit comments

Comments
 (0)