2 # SPDX-License-Identifier: GPL-2.0
4 # Test vetoing of FDB entries that mlxsw can not offload. This exercises several
5 # different veto vectors to test various rollback scenarios in the vxlan driver.
7 lib_dir
=$
(dirname $0)/..
/..
/..
/net
/forwarding
13 fdb_changelink_veto_test
16 source $lib_dir/lib.sh
23 ip link add dev br0
type bridge mcast_snooping
0
25 ip link
set dev
$swp1 up
26 ip link
set dev
$swp1 master br0
27 ip link
set dev
$swp2 up
29 ip link add name vxlan0 up
type vxlan id
10 nolearning noudpcsum \
30 ttl
20 tos inherit
local 198.51.100.1 dstport
4789
31 ip link
set dev vxlan0 master br0
38 ip link
set dev vxlan0 nomaster
39 ip link del dev vxlan0
41 ip link
set dev
$swp2 down
42 ip link
set dev
$swp1 nomaster
43 ip link
set dev
$swp1 down
48 fdb_create_veto_test
()
52 bridge fdb add
01:02:03:04:05:06 dev vxlan0 self static \
53 dst
198.51.100.2 2>/dev
/null
54 check_fail $?
"multicast MAC not rejected"
56 bridge fdb add
01:02:03:04:05:06 dev vxlan0 self static \
57 dst
198.51.100.2 2>&1 >/dev
/null |
grep -q mlxsw_spectrum
58 check_err $?
"multicast MAC rejected without extack"
60 log_test
"vxlan FDB veto - create"
63 fdb_replace_veto_test
()
67 bridge fdb add
00:01:02:03:04:05 dev vxlan0 self static \
69 check_err $?
"valid FDB rejected"
71 bridge fdb replace
00:01:02:03:04:05 dev vxlan0 self static \
72 dst
198.51.100.2 port
1234 2>/dev
/null
73 check_fail $?
"FDB with an explicit port not rejected"
75 bridge fdb replace
00:01:02:03:04:05 dev vxlan0 self static \
76 dst
198.51.100.2 port
1234 2>&1 >/dev
/null \
77 |
grep -q mlxsw_spectrum
78 check_err $?
"FDB with an explicit port rejected without extack"
80 log_test
"vxlan FDB veto - replace"
83 fdb_append_veto_test
()
87 bridge fdb add
00:00:00:00:00:00 dev vxlan0 self static \
89 check_err $?
"valid FDB rejected"
91 bridge fdb append
00:00:00:00:00:00 dev vxlan0 self static \
92 dst
198.51.100.3 port
1234 2>/dev
/null
93 check_fail $?
"FDB with an explicit port not rejected"
95 bridge fdb append
00:00:00:00:00:00 dev vxlan0 self static \
96 dst
198.51.100.3 port
1234 2>&1 >/dev
/null \
97 |
grep -q mlxsw_spectrum
98 check_err $?
"FDB with an explicit port rejected without extack"
100 log_test
"vxlan FDB veto - append"
103 fdb_changelink_veto_test
()
107 ip link
set dev vxlan0
type vxlan \
108 group
224.0.0.1 dev lo
2>/dev
/null
109 check_fail $?
"FDB with a multicast IP not rejected"
111 ip link
set dev vxlan0
type vxlan \
112 group
224.0.0.1 dev lo
2>&1 >/dev
/null \
113 |
grep -q mlxsw_spectrum
114 check_err $?
"FDB with a multicast IP rejected without extack"
116 log_test
"vxlan FDB veto - changelink"