Skip to content

Commit 59c330e

Browse files
Boris SukholitkoPaolo Abeni
Boris Sukholitko
authored and
Paolo Abeni
committed
selftests: tc_actions: test ingress 2nd vlan push
Add new test checking the correctness of inner vlan flushing to the skb data when outer vlan tag is added through act_vlan on ingress. Signed-off-by: Boris Sukholitko <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 9388637 commit 59c330e

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

tools/testing/selftests/net/forwarding/tc_actions.sh

+22-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
ALL_TESTS="gact_drop_and_ok_test mirred_egress_redirect_test \
55
mirred_egress_mirror_test matchall_mirred_egress_mirror_test \
66
gact_trap_test mirred_egress_to_ingress_test \
7-
mirred_egress_to_ingress_tcp_test"
7+
mirred_egress_to_ingress_tcp_test ingress_2nd_vlan_push"
88
NUM_NETIFS=4
99
source tc_common.sh
1010
source lib.sh
@@ -244,6 +244,27 @@ mirred_egress_to_ingress_tcp_test()
244244
log_test "mirred_egress_to_ingress_tcp ($tcflags)"
245245
}
246246

247+
ingress_2nd_vlan_push()
248+
{
249+
tc filter add dev $swp1 ingress pref 20 chain 0 handle 20 flower \
250+
$tcflags num_of_vlans 1 \
251+
action vlan push id 100 protocol 0x8100 action goto chain 5
252+
tc filter add dev $swp1 ingress pref 30 chain 5 handle 30 flower \
253+
$tcflags num_of_vlans 2 \
254+
cvlan_ethtype 0x800 action pass
255+
256+
$MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
257+
-t ip -Q 10 -q
258+
259+
tc_check_packets "dev $swp1 ingress" 30 1
260+
check_err $? "No double-vlan packets received"
261+
262+
tc filter del dev $swp1 ingress pref 20 chain 0 handle 20 flower
263+
tc filter del dev $swp1 ingress pref 30 chain 5 handle 30 flower
264+
265+
log_test "ingress_2nd_vlan_push ($tcflags)"
266+
}
267+
247268
setup_prepare()
248269
{
249270
h1=${NETIFS[p1]}

0 commit comments

Comments
 (0)