Skip to content

Commit 2da4470

Browse files
Boris SukholitkoPaolo Abeni
Boris Sukholitko
authored and
Paolo Abeni
committed
selftests: tc_actions: test egress 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 egress. Signed-off-by: Boris Sukholitko <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 59c330e commit 2da4470

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

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

+24-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
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 ingress_2nd_vlan_push"
7+
mirred_egress_to_ingress_tcp_test \
8+
ingress_2nd_vlan_push egress_2nd_vlan_push"
89
NUM_NETIFS=4
910
source tc_common.sh
1011
source lib.sh
@@ -265,6 +266,28 @@ ingress_2nd_vlan_push()
265266
log_test "ingress_2nd_vlan_push ($tcflags)"
266267
}
267268

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+
268291
setup_prepare()
269292
{
270293
h1=${NETIFS[p1]}

0 commit comments

Comments
 (0)