2 # SPDX-License-Identifier: GPL-2.0
4 # Test generic devlink-trap functionality over mlxsw. These tests are not
5 # specific to a single trap, but do not check the devlink-trap common
6 # infrastructure either.
8 lib_dir
=$
(dirname $0)/..
/..
/..
/net
/forwarding
14 source $lib_dir/tc_common.sh
15 source $lib_dir/lib.sh
16 source $lib_dir/devlink_lib.sh
40 ip link add dev br0
type bridge vlan_filtering
1 mcast_snooping
0
42 ip link
set dev
$swp1 master br0
43 ip link
set dev
$swp2 master br0
45 ip link
set dev br0 up
46 ip link
set dev
$swp1 up
47 ip link
set dev
$swp2 up
52 ip link
set dev
$swp2 down
53 ip link
set dev
$swp1 down
88 local trap_name
="source_mac_is_multicast"
89 local smac
=01:02:03:04:05:06
94 $MZ $h1 -c 0 -p 100 -a $smac -b bcast
-t ip
-q &
97 # The purpose of this test is to make sure we correctly dismantle a
98 # port while packets are trapped from it. This is done by reloading the
99 # the driver while the 'ingress_smac_mc_drop' trap is triggered.
102 for i
in $
(seq 1 $num_iter); do
103 log_info
"Iteration $i / $num_iter"
105 devlink_trap_action_set
$trap_name "trap"
109 # Allow netdevices to be re-created following the reload
117 log_test
"Device delete"
119 kill $mz_pid && wait $mz_pid &> /dev
/null