|
4 | 4 | ALL_TESTS="gact_drop_and_ok_test mirred_egress_redirect_test \
|
5 | 5 | mirred_egress_mirror_test matchall_mirred_egress_mirror_test \
|
6 | 6 | gact_trap_test mirred_egress_to_ingress_test \
|
7 |
| - mirred_egress_to_ingress_tcp_test" |
| 7 | + mirred_egress_to_ingress_tcp_test \ |
| 8 | + ingress_2nd_vlan_push egress_2nd_vlan_push" |
8 | 9 | NUM_NETIFS=4
|
9 | 10 | source tc_common.sh
|
10 | 11 | source lib.sh
|
@@ -244,6 +245,49 @@ mirred_egress_to_ingress_tcp_test()
|
244 | 245 | log_test "mirred_egress_to_ingress_tcp ($tcflags)"
|
245 | 246 | }
|
246 | 247 |
|
| 248 | +ingress_2nd_vlan_push() |
| 249 | +{ |
| 250 | + tc filter add dev $swp1 ingress pref 20 chain 0 handle 20 flower \ |
| 251 | + $tcflags num_of_vlans 1 \ |
| 252 | + action vlan push id 100 protocol 0x8100 action goto chain 5 |
| 253 | + tc filter add dev $swp1 ingress pref 30 chain 5 handle 30 flower \ |
| 254 | + $tcflags num_of_vlans 2 \ |
| 255 | + cvlan_ethtype 0x800 action pass |
| 256 | + |
| 257 | + $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \ |
| 258 | + -t ip -Q 10 -q |
| 259 | + |
| 260 | + tc_check_packets "dev $swp1 ingress" 30 1 |
| 261 | + check_err $? "No double-vlan packets received" |
| 262 | + |
| 263 | + tc filter del dev $swp1 ingress pref 20 chain 0 handle 20 flower |
| 264 | + tc filter del dev $swp1 ingress pref 30 chain 5 handle 30 flower |
| 265 | + |
| 266 | + log_test "ingress_2nd_vlan_push ($tcflags)" |
| 267 | +} |
| 268 | + |
| 269 | +egress_2nd_vlan_push() |
| 270 | +{ |
| 271 | + tc filter add dev $h1 egress pref 20 chain 0 handle 20 flower \ |
| 272 | + $tcflags num_of_vlans 0 \ |
| 273 | + action vlan push id 10 protocol 0x8100 \ |
| 274 | + pipe action vlan push id 100 protocol 0x8100 action goto chain 5 |
| 275 | + tc filter add dev $h1 egress pref 30 chain 5 handle 30 flower \ |
| 276 | + $tcflags num_of_vlans 2 \ |
| 277 | + cvlan_ethtype 0x800 action pass |
| 278 | + |
| 279 | + $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \ |
| 280 | + -t ip -q |
| 281 | + |
| 282 | + tc_check_packets "dev $h1 egress" 30 1 |
| 283 | + check_err $? "No double-vlan packets received" |
| 284 | + |
| 285 | + tc filter del dev $h1 egress pref 20 chain 0 handle 20 flower |
| 286 | + tc filter del dev $h1 egress pref 30 chain 5 handle 30 flower |
| 287 | + |
| 288 | + log_test "egress_2nd_vlan_push ($tcflags)" |
| 289 | +} |
| 290 | + |
247 | 291 | setup_prepare()
|
248 | 292 | {
|
249 | 293 | h1=${NETIFS[p1]}
|
|
0 commit comments