Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: net: local_termination: test link-local protocols

Add tests to local_termination.sh to verify that link-local frames
arrive. On some switches the DSA driver uses bridges to connect the
user ports to their CPU ports. More "intelligent" switches typically
don't forward link-local frames, but may trap them to an internal
microcontroller. The driver may have to change trapping rules, so
link-local frames end up on the DSA CPU ports instead of being
silently dropped or trapped to the internal microcontroller of the
switch.

Add two tests which help to validate this has been done correctly:
- Link-local STP BPDU should arrive at the Linux netdev when the
bridge has STP disabled (BR_NO_STP), in which case the bridge
forwards them rather than consuming them in the control plane
- Link-local LLDP should arrive at standalone ports (and the test
should be skipped on bridged ports similar to how it is done
for the IEEE1588v2/PTP tests)

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/1a67081b2ede1e6d2d32f7dd54ae9688f3566152.1773166131.git.daniel@makrotopia.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Daniel Golle and committed by
Jakub Kicinski
7e27d620 410593fe

+25
+25
tools/testing/selftests/net/forwarding/local_termination.sh
··· 100 100 00 00 3e 37 63 ff fe cf 17 0e 00 01 00 01 05 7f \ 101 101 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ 102 102 00 00 00 00 00 00" 103 + LINK_LOCAL_STP_BPDU=" \ 104 + 01:80:c2:00:00:00 00:00:de:ad:be:ef 00 26 42 42 03 \ 105 + 00 00 00 00 00 80 00 aa bb cc dd ee ff 00 00 00 00 \ 106 + 80 00 aa bb cc dd ee ff 80 01 00 00 14 00 02 00 \ 107 + 0f 00" 108 + LINK_LOCAL_LLDP=" \ 109 + 01:80:c2:00:00:0e 00:00:de:ad:be:ef 88:cc 02 07 04 \ 110 + 00 11 22 33 44 55 04 05 05 65 74 68 30 06 02 00 \ 111 + 78 00 00" 103 112 104 113 # Disable promisc to ensure we don't receive unknown MAC DA packets 105 114 export TCPDUMP_EXTRA_FLAGS="-pl" ··· 222 213 mc_route_destroy $rcv_if_name 223 214 mc_route_destroy $send_if_name 224 215 216 + ip maddress add 01:80:c2:00:00:00 dev $rcv_if_name 217 + send_raw $send_if_name "$LINK_LOCAL_STP_BPDU" 218 + ip maddress del 01:80:c2:00:00:00 dev $rcv_if_name 219 + 225 220 if [ $skip_ptp = false ]; then 221 + ip maddress add 01:80:c2:00:00:0e dev $rcv_if_name 222 + send_raw $send_if_name "$LINK_LOCAL_LLDP" 223 + ip maddress del 01:80:c2:00:00:0e dev $rcv_if_name 224 + 226 225 ip maddress add 01:1b:19:00:00:00 dev $rcv_if_name 227 226 send_raw $send_if_name "$PTP_1588_L2_SYNC" 228 227 send_raw $send_if_name "$PTP_1588_L2_FOLLOW_UP" ··· 321 304 "$smac > $UNKNOWN_MACV6_MC_ADDR3, ethertype IPv6 (0x86dd)" \ 322 305 true "$test_name" 323 306 307 + check_rcv $rcv_if_name "Link-local STP BPDU" \ 308 + "> 01:80:c2:00:00:00" \ 309 + true "$test_name" 310 + 324 311 if [ $skip_ptp = false ]; then 312 + check_rcv $rcv_if_name "Link-local LLDP" \ 313 + "> 01:80:c2:00:00:0e" \ 314 + true "$test_name" 315 + 325 316 check_rcv $rcv_if_name "1588v2 over L2 transport, Sync" \ 326 317 "ethertype PTP (0x88f7).* PTPv2.* msg type *: sync msg" \ 327 318 true "$test_name"