Skip to content

Commit 06a2fc8

Browse files
pmachatadavem330
authored andcommitted
selftests: mlxsw: extack: Test VLAN add on a port device
Test mapping a VLAN at a port device such that on the same VLAN, there already is an unoffloadable VXLAN device. Signed-off-by: Petr Machata <[email protected]> Acked-by: Jiri Pirko <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b498dc7 commit 06a2fc8

File tree

1 file changed

+30
-0
lines changed
  • tools/testing/selftests/drivers/net/mlxsw

1 file changed

+30
-0
lines changed

tools/testing/selftests/drivers/net/mlxsw/extack.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ lib_dir=$(dirname $0)/../../../net/forwarding
88
ALL_TESTS="
99
netdev_pre_up_test
1010
vxlan_vlan_add_test
11+
port_vlan_add_test
1112
"
1213
NUM_NETIFS=2
1314
source $lib_dir/lib.sh
@@ -105,6 +106,35 @@ vxlan_vlan_add_test()
105106
ip link del dev br1
106107
}
107108

109+
port_vlan_add_test()
110+
{
111+
RET=0
112+
113+
ip link add name br1 up type bridge vlan_filtering 1 mcast_snooping 0
114+
115+
# Unsupported configuration: mlxsw demands VXLAN with "noudpcsum".
116+
ip link add name vx1 up type vxlan id 1000 \
117+
local 192.0.2.17 remote 192.0.2.18 \
118+
dstport 4789 tos inherit ttl 100
119+
120+
ip link set dev $swp1 master br1
121+
check_err $?
122+
123+
bridge vlan del dev $swp1 vid 1
124+
125+
ip link set dev vx1 master br1
126+
check_err $?
127+
128+
bridge vlan add dev $swp1 vid 1 pvid untagged 2>&1 >/dev/null \
129+
| grep -q mlxsw_spectrum
130+
check_err $?
131+
132+
log_test "extack - map VLAN at port"
133+
134+
ip link del dev vx1
135+
ip link del dev br1
136+
}
137+
108138
trap cleanup EXIT
109139

110140
setup_prepare

0 commit comments

Comments
 (0)