Skip to content

Commit bcc46a8

Browse files
qsnNipaLocal
authored and
NipaLocal
committed
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 <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 0b7d028 commit bcc46a8

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)