1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3#
4# Test various interface configuration scenarios. Observe that configurations
5# deemed valid by mlxsw succeed, invalid configurations fail and that no traces
6# are produced. To prevent the test from passing in case traces are produced,
7# the user can set the 'kernel.panic_on_warn' and 'kernel.panic_on_oops'
8# sysctls in its environment.
9
10lib_dir=$(dirname $0)/../../../net/forwarding
11
12ALL_TESTS="
13	rif_set_addr_test
14	rif_vrf_set_addr_test
15	rif_inherit_bridge_addr_test
16	rif_non_inherit_bridge_addr_test
17	vlan_interface_deletion_test
18	bridge_deletion_test
19	bridge_vlan_flags_test
20	vlan_1_test
21	lag_bridge_upper_test
22	duplicate_vlans_test
23	vlan_rif_refcount_test
24	subport_rif_refcount_test
25	vlan_dev_deletion_test
26	lag_unlink_slaves_test
27	lag_dev_deletion_test
28	vlan_interface_uppers_test
29	bridge_extern_learn_test
30	neigh_offload_test
31	nexthop_offload_test
32	devlink_reload_test
33"
34NUM_NETIFS=2
35: ${TIMEOUT:=20000} # ms
36source $lib_dir/lib.sh
37source $lib_dir/devlink_lib.sh
38
39setup_prepare()
40{
41	swp1=${NETIFS[p1]}
42	swp2=${NETIFS[p2]}
43
44	ip link set dev $swp1 up
45	ip link set dev $swp2 up
46}
47
48cleanup()
49{
50	pre_cleanup
51
52	ip link set dev $swp2 down
53	ip link set dev $swp1 down
54}
55
56rif_set_addr_test()
57{
58	local swp1_mac=$(mac_get $swp1)
59	local swp2_mac=$(mac_get $swp2)
60
61	RET=0
62
63	# $swp1 and $swp2 likely got their IPv6 local addresses already, but
64	# here we need to test the transition to RIF.
65	ip addr flush dev $swp1
66	ip addr flush dev $swp2
67	sleep .1
68
69	ip addr add dev $swp1 192.0.2.1/28
70	check_err $?
71
72	ip link set dev $swp1 addr 00:11:22:33:44:55
73	check_err $?
74
75	# IP address enablement should be rejected if the MAC address prefix
76	# doesn't match other RIFs.
77	ip addr add dev $swp2 192.0.2.2/28 &>/dev/null
78	check_fail $? "IP address addition passed for a device with a wrong MAC"
79	ip addr add dev $swp2 192.0.2.2/28 2>&1 >/dev/null \
80	    | grep -q mlxsw_spectrum
81	check_err $? "no extack for IP address addition"
82
83	ip link set dev $swp2 addr 00:11:22:33:44:66
84	check_err $?
85	ip addr add dev $swp2 192.0.2.2/28 &>/dev/null
86	check_err $?
87
88	# Change of MAC address of a RIF should be forbidden if the new MAC
89	# doesn't share the prefix with other MAC addresses.
90	ip link set dev $swp2 addr 00:11:22:33:00:66 &>/dev/null
91	check_fail $? "change of MAC address passed for a wrong MAC"
92	ip link set dev $swp2 addr 00:11:22:33:00:66 2>&1 >/dev/null \
93	    | grep -q mlxsw_spectrum
94	check_err $? "no extack for MAC address change"
95
96	log_test "RIF - bad MAC change"
97
98	ip addr del dev $swp2 192.0.2.2/28
99	ip addr del dev $swp1 192.0.2.1/28
100
101	ip link set dev $swp2 addr $swp2_mac
102	ip link set dev $swp1 addr $swp1_mac
103}
104
105rif_vrf_set_addr_test()
106{
107	# Test that it is possible to set an IP address on a VRF upper despite
108	# its random MAC address.
109	RET=0
110
111	ip link add name vrf-test type vrf table 10
112	ip link set dev $swp1 master vrf-test
113
114	ip -4 address add 192.0.2.1/24 dev vrf-test
115	check_err $? "failed to set IPv4 address on VRF"
116	ip -6 address add 2001:db8:1::1/64 dev vrf-test
117	check_err $? "failed to set IPv6 address on VRF"
118
119	log_test "RIF - setting IP address on VRF"
120
121	ip link del dev vrf-test
122}
123
124rif_inherit_bridge_addr_test()
125{
126	RET=0
127
128	# Create first RIF
129	ip addr add dev $swp1 192.0.2.1/28
130	check_err $?
131
132	# Create a FID RIF
133	ip link add name br1 up type bridge vlan_filtering 0
134	ip link set dev $swp2 master br1
135	ip addr add dev br1 192.0.2.17/28
136	check_err $?
137
138	# Prepare a device with a low MAC address
139	ip link add name d up type dummy
140	ip link set dev d addr 00:11:22:33:44:55
141
142	# Attach the device to br1. That prompts bridge address change, which
143	# should be vetoed, thus preventing the attachment.
144	ip link set dev d master br1 &>/dev/null
145	check_fail $? "Device with low MAC was permitted to attach a bridge with RIF"
146	ip link set dev d master br1 2>&1 >/dev/null \
147	    | grep -q mlxsw_spectrum
148	check_err $? "no extack for bridge attach rejection"
149
150	ip link set dev $swp2 addr 00:11:22:33:44:55 &>/dev/null
151	check_fail $? "Changing swp2's MAC address permitted"
152	ip link set dev $swp2 addr 00:11:22:33:44:55 2>&1 >/dev/null \
153	    | grep -q mlxsw_spectrum
154	check_err $? "no extack for bridge port MAC address change rejection"
155
156	log_test "RIF - attach port with bad MAC to bridge"
157
158	ip link del dev d
159	ip link del dev br1
160	ip addr del dev $swp1 192.0.2.1/28
161}
162
163rif_non_inherit_bridge_addr_test()
164{
165	local swp2_mac=$(mac_get $swp2)
166
167	RET=0
168
169	# Create first RIF
170	ip addr add dev $swp1 192.0.2.1/28
171	check_err $?
172
173	# Create a FID RIF
174	ip link add name br1 up type bridge vlan_filtering 0
175	ip link set dev br1 addr $swp2_mac
176	ip link set dev $swp2 master br1
177	ip addr add dev br1 192.0.2.17/28
178	check_err $?
179
180	# Prepare a device with a low MAC address
181	ip link add name d up type dummy
182	ip link set dev d addr 00:11:22:33:44:55
183
184	# Attach the device to br1. Since the bridge address was set, it should
185	# work.
186	ip link set dev d master br1 &>/dev/null
187	check_err $? "Could not attach a device with low MAC to a bridge with RIF"
188
189	# Port MAC address change should be allowed for a bridge with set MAC.
190	ip link set dev $swp2 addr 00:11:22:33:44:55
191	check_err $? "Changing swp2's MAC address not permitted"
192
193	log_test "RIF - attach port with bad MAC to bridge with set MAC"
194
195	ip link set dev $swp2 addr $swp2_mac
196	ip link del dev d
197	ip link del dev br1
198	ip addr del dev $swp1 192.0.2.1/28
199}
200
201vlan_interface_deletion_test()
202{
203	# Test that when a VLAN interface is deleted, its associated router
204	# interface (RIF) is correctly deleted and not leaked. See commit
205	# c360867ec46a ("mlxsw: spectrum: Delete RIF when VLAN device is
206	# removed") for more details
207	RET=0
208
209	ip link add name br0 type bridge vlan_filtering 1
210	ip link set dev $swp1 master br0
211
212	ip link add link br0 name br0.10 type vlan id 10
213	ip -6 address add 2001:db8:1::1/64 dev br0.10
214	ip link del dev br0.10
215
216	# If we leaked the previous RIF, then this should produce a trace
217	ip link add link br0 name br0.20 type vlan id 20
218	ip -6 address add 2001:db8:1::1/64 dev br0.20
219	ip link del dev br0.20
220
221	log_test "vlan interface deletion"
222
223	ip link del dev br0
224}
225
226bridge_deletion_test()
227{
228	# Test that when a bridge with VLAN interfaces is deleted, we correctly
229	# delete the associated RIFs. See commit 602b74eda813 ("mlxsw:
230	# spectrum_switchdev: Do not leak RIFs when removing bridge") for more
231	# details
232	RET=0
233
234	ip link add name br0 type bridge vlan_filtering 1
235	ip link set dev $swp1 master br0
236	ip -6 address add 2001:db8::1/64 dev br0
237
238	ip link add link br0 name br0.10 type vlan id 10
239	ip -6 address add 2001:db8:1::1/64 dev br0.10
240
241	ip link add link br0 name br0.20 type vlan id 20
242	ip -6 address add 2001:db8:2::1/64 dev br0.20
243
244	ip link del dev br0
245
246	# If we leaked previous RIFs, then this should produce a trace
247	ip -6 address add 2001:db8:1::1/64 dev $swp1
248	ip -6 address del 2001:db8:1::1/64 dev $swp1
249
250	log_test "bridge deletion"
251}
252
253bridge_vlan_flags_test()
254{
255	# Test that when bridge VLAN flags are toggled, we do not take
256	# unnecessary references on related structs. See commit 9e25826ffc94
257	# ("mlxsw: spectrum_switchdev: Fix port_vlan refcounting") for more
258	# details
259	RET=0
260
261	ip link add name br0 type bridge vlan_filtering 1
262	ip link set dev $swp1 master br0
263
264	bridge vlan add vid 10 dev $swp1 pvid untagged
265	bridge vlan add vid 10 dev $swp1 untagged
266	bridge vlan add vid 10 dev $swp1 pvid
267	bridge vlan add vid 10 dev $swp1
268	ip link del dev br0
269
270	# If we did not handle references correctly, then this should produce a
271	# trace
272	devlink dev reload "$DEVLINK_DEV"
273
274	# Allow netdevices to be re-created following the reload
275	sleep 20
276
277	log_test "bridge vlan flags"
278}
279
280vlan_1_test()
281{
282	# Test that VLAN 1 can be configured over mlxsw ports. In the past it
283	# was used internally for untagged traffic. See commit 47bf9df2e820
284	# ("mlxsw: spectrum: Forbid creation of VLAN 1 over port/LAG") for more
285	# details
286	RET=0
287
288	ip link add link $swp1 name $swp1.1 type vlan id 1
289	check_err $? "did not manage to create vlan 1 when should"
290
291	log_test "vlan 1"
292
293	ip link del dev $swp1.1
294}
295
296lag_bridge_upper_test()
297{
298	# Test that ports cannot be enslaved to LAG devices that have uppers
299	# and that failure is handled gracefully. See commit b3529af6bb0d
300	# ("spectrum: Reference count VLAN entries") for more details
301	RET=0
302
303	ip link add name bond1 type bond mode 802.3ad
304
305	ip link add name br0 type bridge vlan_filtering 1
306	ip link set dev bond1 master br0
307
308	ip link set dev $swp1 down
309	ip link set dev $swp1 master bond1 &> /dev/null
310	check_fail $? "managed to enslave port to lag when should not"
311
312	# This might generate a trace, if we did not handle the failure
313	# correctly
314	ip -6 address add 2001:db8:1::1/64 dev $swp1
315	ip -6 address del 2001:db8:1::1/64 dev $swp1
316
317	log_test "lag with bridge upper"
318
319	ip link del dev br0
320	ip link del dev bond1
321}
322
323duplicate_vlans_test()
324{
325	# Test that on a given port a VLAN is only used once. Either as VLAN
326	# in a VLAN-aware bridge or as a VLAN device
327	RET=0
328
329	ip link add name br0 type bridge vlan_filtering 1
330	ip link set dev $swp1 master br0
331	bridge vlan add vid 10 dev $swp1
332
333	ip link add link $swp1 name $swp1.10 type vlan id 10 &> /dev/null
334	check_fail $? "managed to create vlan device when should not"
335
336	bridge vlan del vid 10 dev $swp1
337	ip link add link $swp1 name $swp1.10 type vlan id 10
338	check_err $? "did not manage to create vlan device when should"
339	bridge vlan add vid 10 dev $swp1 &> /dev/null
340	check_fail $? "managed to add bridge vlan when should not"
341
342	log_test "duplicate vlans"
343
344	ip link del dev $swp1.10
345	ip link del dev br0
346}
347
348vlan_rif_refcount_test()
349{
350	# Test that RIFs representing VLAN interfaces are not affected from
351	# ports member in the VLAN. We use the offload indication on routes
352	# configured on the RIF to understand if it was created / destroyed
353	RET=0
354
355	ip link add name br0 type bridge vlan_filtering 1
356	ip link set dev $swp1 master br0
357
358	ip link set dev $swp1 up
359	ip link set dev br0 up
360
361	ip link add link br0 name br0.10 up type vlan id 10
362	ip -6 address add 2001:db8:1::1/64 dev br0.10
363
364	busywait "$TIMEOUT" wait_for_offload \
365		ip -6 route get fibmatch 2001:db8:1::2 dev br0.10
366	check_err $? "vlan rif was not created before adding port to vlan"
367
368	bridge vlan add vid 10 dev $swp1
369	busywait "$TIMEOUT" wait_for_offload \
370		ip -6 route get fibmatch 2001:db8:1::2 dev br0.10
371	check_err $? "vlan rif was destroyed after adding port to vlan"
372
373	bridge vlan del vid 10 dev $swp1
374	busywait "$TIMEOUT" wait_for_offload \
375		ip -6 route get fibmatch 2001:db8:1::2 dev br0.10
376	check_err $? "vlan rif was destroyed after removing port from vlan"
377
378	ip link set dev $swp1 nomaster
379	busywait "$TIMEOUT" not wait_for_offload \
380		ip -6 route get fibmatch 2001:db8:1::2 dev br0.10
381	check_err $? "vlan rif was not destroyed after unlinking port from bridge"
382
383	log_test "vlan rif refcount"
384
385	ip link del dev br0.10
386	ip link set dev $swp1 down
387	ip link del dev br0
388}
389
390subport_rif_refcount_test()
391{
392	# Test that RIFs representing upper devices of physical ports are
393	# reference counted correctly and destroyed when should. We use the
394	# offload indication on routes configured on the RIF to understand if
395	# it was created / destroyed
396	RET=0
397
398	ip link add name bond1 type bond mode 802.3ad
399	ip link set dev $swp1 down
400	ip link set dev $swp2 down
401	ip link set dev $swp1 master bond1
402	ip link set dev $swp2 master bond1
403
404	ip link set dev bond1 up
405	ip link add link bond1 name bond1.10 up type vlan id 10
406	ip -6 address add 2001:db8:1::1/64 dev bond1
407	ip -6 address add 2001:db8:2::1/64 dev bond1.10
408
409	busywait "$TIMEOUT" wait_for_offload \
410		ip -6 route get fibmatch 2001:db8:1::2 dev bond1
411	check_err $? "subport rif was not created on lag device"
412	busywait "$TIMEOUT" wait_for_offload \
413		ip -6 route get fibmatch 2001:db8:2::2 dev bond1.10
414	check_err $? "subport rif was not created on vlan device"
415
416	ip link set dev $swp1 nomaster
417	busywait "$TIMEOUT" wait_for_offload \
418		ip -6 route get fibmatch 2001:db8:1::2 dev bond1
419	check_err $? "subport rif of lag device was destroyed when should not"
420	busywait "$TIMEOUT" wait_for_offload \
421		ip -6 route get fibmatch 2001:db8:2::2 dev bond1.10
422	check_err $? "subport rif of vlan device was destroyed when should not"
423
424	ip link set dev $swp2 nomaster
425	busywait "$TIMEOUT" not wait_for_offload \
426		ip -6 route get fibmatch 2001:db8:1::2 dev bond1
427	check_err $? "subport rif of lag device was not destroyed when should"
428	busywait "$TIMEOUT" not wait_for_offload \
429		ip -6 route get fibmatch 2001:db8:2::2 dev bond1.10
430	check_err $? "subport rif of vlan device was not destroyed when should"
431
432	log_test "subport rif refcount"
433
434	ip link del dev bond1.10
435	ip link del dev bond1
436}
437
438vlan_dev_deletion_test()
439{
440	# Test that VLAN devices are correctly deleted / unlinked when enslaved
441	# to bridge
442	RET=0
443
444	ip link add name br10 type bridge
445	ip link add name br20 type bridge
446	ip link add name br30 type bridge
447	ip link add link $swp1 name $swp1.10 type vlan id 10
448	ip link add link $swp1 name $swp1.20 type vlan id 20
449	ip link add link $swp1 name $swp1.30 type vlan id 30
450	ip link set dev $swp1.10 master br10
451	ip link set dev $swp1.20 master br20
452	ip link set dev $swp1.30 master br30
453
454	# If we did not handle the situation correctly, then these operations
455	# might produce a trace
456	ip link set dev $swp1.30 nomaster
457	ip link del dev $swp1.20
458	# Deletion via ioctl uses different code paths from netlink
459	vconfig rem $swp1.10 &> /dev/null
460
461	log_test "vlan device deletion"
462
463	ip link del dev $swp1.30
464	ip link del dev br30
465	ip link del dev br20
466	ip link del dev br10
467}
468
469lag_create()
470{
471	ip link add name bond1 type bond mode 802.3ad
472	ip link set dev $swp1 down
473	ip link set dev $swp2 down
474	ip link set dev $swp1 master bond1
475	ip link set dev $swp2 master bond1
476
477	ip link add link bond1 name bond1.10 type vlan id 10
478	ip link add link bond1 name bond1.20 type vlan id 20
479
480	ip link add name br0 type bridge vlan_filtering 1
481	ip link set dev bond1 master br0
482
483	ip link add name br10 type bridge
484	ip link set dev bond1.10 master br10
485
486	ip link add name br20 type bridge
487	ip link set dev bond1.20 master br20
488}
489
490lag_unlink_slaves_test()
491{
492	# Test that ports are correctly unlinked from their LAG master, when
493	# the LAG and its VLAN uppers are enslaved to bridges
494	RET=0
495
496	lag_create
497
498	ip link set dev $swp1 nomaster
499	check_err $? "lag slave $swp1 was not unlinked from master"
500	ip link set dev $swp2 nomaster
501	check_err $? "lag slave $swp2 was not unlinked from master"
502
503	# Try to configure corresponding VLANs as router interfaces
504	ip -6 address add 2001:db8:1::1/64 dev $swp1
505	check_err $? "failed to configure ip address on $swp1"
506
507	ip link add link $swp1 name $swp1.10 type vlan id 10
508	ip -6 address add 2001:db8:10::1/64 dev $swp1.10
509	check_err $? "failed to configure ip address on $swp1.10"
510
511	ip link add link $swp1 name $swp1.20 type vlan id 20
512	ip -6 address add 2001:db8:20::1/64 dev $swp1.20
513	check_err $? "failed to configure ip address on $swp1.20"
514
515	log_test "lag slaves unlinking"
516
517	ip link del dev $swp1.20
518	ip link del dev $swp1.10
519	ip address flush dev $swp1
520
521	ip link del dev br20
522	ip link del dev br10
523	ip link del dev br0
524	ip link del dev bond1
525}
526
527lag_dev_deletion_test()
528{
529	# Test that LAG device is correctly deleted, when the LAG and its VLAN
530	# uppers are enslaved to bridges
531	RET=0
532
533	lag_create
534
535	ip link del dev bond1
536
537	log_test "lag device deletion"
538
539	ip link del dev br20
540	ip link del dev br10
541	ip link del dev br0
542}
543
544vlan_interface_uppers_test()
545{
546	# Test that uppers of a VLAN interface are correctly sanitized
547	RET=0
548
549	ip link add name br0 type bridge vlan_filtering 1
550	ip link set dev $swp1 master br0
551
552	ip link add link br0 name br0.10 type vlan id 10
553	ip link add link br0.10 name macvlan0 \
554		type macvlan mode private &> /dev/null
555	check_fail $? "managed to create a macvlan when should not"
556
557	ip -6 address add 2001:db8:1::1/64 dev br0.10
558	ip link add link br0.10 name macvlan0 type macvlan mode private
559	check_err $? "did not manage to create a macvlan when should"
560
561	ip link del dev macvlan0
562
563	ip link add name vrf-test type vrf table 10
564	ip link set dev br0.10 master vrf-test
565	check_err $? "did not manage to enslave vlan interface to vrf"
566	ip link del dev vrf-test
567
568	ip link add name br-test type bridge
569	ip link set dev br0.10 master br-test &> /dev/null
570	check_fail $? "managed to enslave vlan interface to bridge when should not"
571	ip link del dev br-test
572
573	log_test "vlan interface uppers"
574
575	ip link del dev br0
576}
577
578bridge_extern_learn_test()
579{
580	# Test that externally learned entries added from user space are
581	# marked as offloaded
582	RET=0
583
584	ip link add name br0 type bridge
585	ip link set dev $swp1 master br0
586
587	bridge fdb add de:ad:be:ef:13:37 dev $swp1 master extern_learn
588
589	busywait "$TIMEOUT" wait_for_offload \
590		bridge fdb show brport $swp1 de:ad:be:ef:13:37
591	check_err $? "fdb entry not marked as offloaded when should"
592
593	log_test "externally learned fdb entry"
594
595	ip link del dev br0
596}
597
598neigh_offload_test()
599{
600	# Test that IPv4 and IPv6 neighbour entries are marked as offloaded
601	RET=0
602
603	ip -4 address add 192.0.2.1/24 dev $swp1
604	ip -6 address add 2001:db8:1::1/64 dev $swp1
605
606	ip -4 neigh add 192.0.2.2 lladdr de:ad:be:ef:13:37 nud perm dev $swp1
607	ip -6 neigh add 2001:db8:1::2 lladdr de:ad:be:ef:13:37 nud perm \
608		dev $swp1
609
610	busywait "$TIMEOUT" wait_for_offload \
611		ip -4 neigh show dev $swp1 192.0.2.2
612	check_err $? "ipv4 neigh entry not marked as offloaded when should"
613	busywait "$TIMEOUT" wait_for_offload \
614		ip -6 neigh show dev $swp1 2001:db8:1::2
615	check_err $? "ipv6 neigh entry not marked as offloaded when should"
616
617	log_test "neighbour offload indication"
618
619	ip -6 neigh del 2001:db8:1::2 dev $swp1
620	ip -4 neigh del 192.0.2.2 dev $swp1
621	ip -6 address del 2001:db8:1::1/64 dev $swp1
622	ip -4 address del 192.0.2.1/24 dev $swp1
623}
624
625nexthop_offload_test()
626{
627	# Test that IPv4 and IPv6 nexthops are marked as offloaded
628	RET=0
629
630	sysctl_set net.ipv6.conf.$swp2.keep_addr_on_down 1
631	simple_if_init $swp1 192.0.2.1/24 2001:db8:1::1/64
632	simple_if_init $swp2 192.0.2.2/24 2001:db8:1::2/64
633	setup_wait
634
635	ip -4 route add 198.51.100.0/24 vrf v$swp1 \
636		nexthop via 192.0.2.2 dev $swp1
637	ip -6 route add 2001:db8:2::/64 vrf v$swp1 \
638		nexthop via 2001:db8:1::2 dev $swp1
639
640	busywait "$TIMEOUT" wait_for_offload \
641		ip -4 route show 198.51.100.0/24 vrf v$swp1
642	check_err $? "ipv4 nexthop not marked as offloaded when should"
643	busywait "$TIMEOUT" wait_for_offload \
644		ip -6 route show 2001:db8:2::/64 vrf v$swp1
645	check_err $? "ipv6 nexthop not marked as offloaded when should"
646
647	ip link set dev $swp2 down
648	sleep 1
649
650	busywait "$TIMEOUT" not wait_for_offload \
651		ip -4 route show 198.51.100.0/24 vrf v$swp1
652	check_err $? "ipv4 nexthop marked as offloaded when should not"
653	busywait "$TIMEOUT" not wait_for_offload \
654		ip -6 route show 2001:db8:2::/64 vrf v$swp1
655	check_err $? "ipv6 nexthop marked as offloaded when should not"
656
657	ip link set dev $swp2 up
658	setup_wait
659
660	busywait "$TIMEOUT" wait_for_offload \
661		ip -4 route show 198.51.100.0/24 vrf v$swp1
662	check_err $? "ipv4 nexthop not marked as offloaded after neigh add"
663	busywait "$TIMEOUT" wait_for_offload \
664		ip -6 route show 2001:db8:2::/64 vrf v$swp1
665	check_err $? "ipv6 nexthop not marked as offloaded after neigh add"
666
667	log_test "nexthop offload indication"
668
669	ip -6 route del 2001:db8:2::/64 vrf v$swp1
670	ip -4 route del 198.51.100.0/24 vrf v$swp1
671
672	simple_if_fini $swp2 192.0.2.2/24 2001:db8:1::2/64
673	simple_if_fini $swp1 192.0.2.1/24 2001:db8:1::1/64
674	sysctl_restore net.ipv6.conf.$swp2.keep_addr_on_down
675}
676
677devlink_reload_test()
678{
679	# Test that after executing all the above configuration tests, a
680	# devlink reload can be performed without errors
681	RET=0
682
683	devlink dev reload "$DEVLINK_DEV"
684	check_err $? "devlink reload failed"
685
686	log_test "devlink reload - last test"
687
688	sleep 20
689}
690
691trap cleanup EXIT
692
693setup_prepare
694setup_wait
695
696tests_run
697
698exit $EXIT_STATUS
699