staging: rtl8192u: remove redundant assignment to pointer crypt
[linux/fpc-iii.git] / tools / testing / selftests / drivers / net / mlxsw / extack.sh
blobd72d8488a3b22748a2d268ddae45724aba568808
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0
4 # Test operations that we expect to report extended ack.
6 lib_dir=$(dirname $0)/../../../net/forwarding
8 ALL_TESTS="
9 netdev_pre_up_test
10 vxlan_vlan_add_test
11 port_vlan_add_test
13 NUM_NETIFS=2
14 source $lib_dir/lib.sh
16 setup_prepare()
18 swp1=${NETIFS[p1]}
19 swp2=${NETIFS[p2]}
21 ip link set dev $swp1 up
22 ip link set dev $swp2 up
25 cleanup()
27 pre_cleanup
29 ip link set dev $swp2 down
30 ip link set dev $swp1 down
33 netdev_pre_up_test()
35 RET=0
37 ip link add name br1 up type bridge vlan_filtering 0 mcast_snooping 0
38 ip link add name vx1 up type vxlan id 1000 \
39 local 192.0.2.17 remote 192.0.2.18 \
40 dstport 4789 nolearning noudpcsum tos inherit ttl 100
42 ip link set dev vx1 master br1
43 check_err $?
45 ip link set dev $swp1 master br1
46 check_err $?
48 ip link add name br2 up type bridge vlan_filtering 0 mcast_snooping 0
49 ip link add name vx2 up type vxlan id 2000 \
50 local 192.0.2.17 remote 192.0.2.18 \
51 dstport 4789 nolearning noudpcsum tos inherit ttl 100
53 ip link set dev vx2 master br2
54 check_err $?
56 ip link set dev $swp2 master br2
57 check_err $?
59 # Unsupported configuration: mlxsw demands that all offloaded VXLAN
60 # devices have the same TTL.
61 ip link set dev vx2 down
62 ip link set dev vx2 type vxlan ttl 200
64 ip link set dev vx2 up &>/dev/null
65 check_fail $?
67 ip link set dev vx2 up 2>&1 >/dev/null | grep -q mlxsw_spectrum
68 check_err $?
70 log_test "extack - NETDEV_PRE_UP"
72 ip link del dev vx2
73 ip link del dev br2
75 ip link del dev vx1
76 ip link del dev br1
79 vxlan_vlan_add_test()
81 RET=0
83 ip link add name br1 up type bridge vlan_filtering 1 mcast_snooping 0
85 # Unsupported configuration: mlxsw demands VXLAN with "noudpcsum".
86 ip link add name vx1 up type vxlan id 1000 \
87 local 192.0.2.17 remote 192.0.2.18 \
88 dstport 4789 tos inherit ttl 100
90 ip link set dev vx1 master br1
91 check_err $?
93 bridge vlan add dev vx1 vid 1
94 check_err $?
96 ip link set dev $swp1 master br1
97 check_err $?
99 bridge vlan add dev vx1 vid 1 pvid untagged 2>&1 >/dev/null \
100 | grep -q mlxsw_spectrum
101 check_err $?
103 log_test "extack - map VLAN at VXLAN device"
105 ip link del dev vx1
106 ip link del dev br1
109 port_vlan_add_test()
111 RET=0
113 ip link add name br1 up type bridge vlan_filtering 1 mcast_snooping 0
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
120 ip link set dev $swp1 master br1
121 check_err $?
123 bridge vlan del dev $swp1 vid 1
125 ip link set dev vx1 master br1
126 check_err $?
128 bridge vlan add dev $swp1 vid 1 pvid untagged 2>&1 >/dev/null \
129 | grep -q mlxsw_spectrum
130 check_err $?
132 log_test "extack - map VLAN at port"
134 ip link del dev vx1
135 ip link del dev br1
138 trap cleanup EXIT
140 setup_prepare
141 setup_wait
143 tests_run
145 exit $EXIT_STATUS