{"id":2233001,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2233001/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/patch/20260505124957.1239812-3-houminxi@gmail.com/","project":{"id":47,"url":"http://patchwork.ozlabs.org/api/1.2/projects/47/?format=json","name":"Open vSwitch","link_name":"openvswitch","list_id":"ovs-dev.openvswitch.org","list_email":"ovs-dev@openvswitch.org","web_url":"http://openvswitch.org/","scm_url":"git@github.com:openvswitch/ovs.git","webscm_url":"https://github.com/openvswitch/ovs","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260505124957.1239812-3-houminxi@gmail.com>","list_archive_url":null,"date":"2026-05-05T12:49:57","name":"[ovs-dev,net-next,v5,2/2] selftests: openvswitch: add pop_vlan test","commit_ref":null,"pull_url":null,"state":"handled-elsewhere","archived":false,"hash":"c66da7ccbc18e46c18b533c35bff679710824995","submitter":{"id":93141,"url":"http://patchwork.ozlabs.org/api/1.2/people/93141/?format=json","name":"Minxi Hou","email":"houminxi@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/openvswitch/patch/20260505124957.1239812-3-houminxi@gmail.com/mbox/","series":[{"id":502837,"url":"http://patchwork.ozlabs.org/api/1.2/series/502837/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/list/?series=502837","date":"2026-05-05T12:49:55","name":"selftests: openvswitch: add pop_vlan test","version":5,"mbox":"http://patchwork.ozlabs.org/series/502837/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2233001/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2233001/checks/","tags":{},"related":[],"headers":{"Return-Path":"<ovs-dev-bounces@openvswitch.org>","X-Original-To":["incoming@patchwork.ozlabs.org","dev@openvswitch.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ovs-dev@lists.linuxfoundation.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=jyWbS3x0;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org)","smtp4.osuosl.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key)\n header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104\n header.b=jyWbS3x0","smtp2.osuosl.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","smtp2.osuosl.org;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.a=rsa-sha256 header.s=20251104 header.b=jyWbS3x0"],"Received":["from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g8yzm3DVdz1yJV\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 05 May 2026 22:50:44 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id CFB1D40992;\n\tTue,  5 May 2026 12:50:42 +0000 (UTC)","from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id SSVSpX9MG7m2; Tue,  5 May 2026 12:50:42 +0000 (UTC)","from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp4.osuosl.org (Postfix) with ESMTPS id EE30640506;\n\tTue,  5 May 2026 12:50:41 +0000 (UTC)","from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id C269DC04EA;\n\tTue,  5 May 2026 12:50:41 +0000 (UTC)","from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 94739C04E9\n for <dev@openvswitch.org>; Tue,  5 May 2026 12:50:40 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n by smtp2.osuosl.org (Postfix) with ESMTP id C7E8040268\n for <dev@openvswitch.org>; Tue,  5 May 2026 12:50:28 +0000 (UTC)","from smtp2.osuosl.org ([127.0.0.1])\n by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id LY2NdyOMqHbl for <dev@openvswitch.org>;\n Tue,  5 May 2026 12:50:28 +0000 (UTC)","from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com\n [IPv6:2607:f8b0:4864:20::32b])\n by smtp2.osuosl.org (Postfix) with ESMTPS id E4BEA40258\n for <dev@openvswitch.org>; Tue,  5 May 2026 12:50:27 +0000 (UTC)","by mail-ot1-x32b.google.com with SMTP id\n 46e09a7af769-7dbe437b072so3214675a34.2\n for <dev@openvswitch.org>; Tue, 05 May 2026 05:50:27 -0700 (PDT)","from houminxi ([72.244.37.221]) by smtp.gmail.com with ESMTPSA id\n 46e09a7af769-7deca7a5e75sm9884812a34.2.2026.05.05.05.50.20\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 05 May 2026 05:50:26 -0700 (PDT)"],"X-Virus-Scanned":["amavis at osuosl.org","amavis at osuosl.org"],"X-Comment":"SPF check N/A for local connections - client-ip=140.211.9.56;\n helo=lists.linuxfoundation.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN> ","DKIM-Filter":["OpenDKIM Filter v2.11.0 smtp4.osuosl.org EE30640506","OpenDKIM Filter v2.11.0 smtp2.osuosl.org E4BEA40258"],"Received-SPF":"Pass (mailfrom) identity=mailfrom;\n client-ip=2607:f8b0:4864:20::32b; helo=mail-ot1-x32b.google.com;\n envelope-from=houminxi@gmail.com; receiver=<UNKNOWN>","DMARC-Filter":"OpenDMARC Filter v1.4.2 smtp2.osuosl.org E4BEA40258","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1777985427; x=1778590227; darn=openvswitch.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=HGEfb93ktgl3f/5UYg0ZpYbUgmiWQzqYOfMzkPyrudk=;\n b=jyWbS3x0i9ut/b3Pv4ixL2bB8NVhsVBe8D0tkPnghdo9GQnDsR5dwcQeB+pyA1fqSX\n C01nsJyR8OGXTQYPNKnXNMrE+TxyNlKQQ0o6RXn7EpfW/yDLfCwpXZAS9U+jpP6Evs0k\n KdPCZjPZODTmLrUR/x1Hr9GkiT1noK5zjxNyZAfuWVf5vxT7hEFrnB4Qy+BvoqHXVMla\n 3nCZnfkl9M3bhVlBQvKczAB2bii56dmZPHs7b7AYE4UD4qSsHWPu7Uody0eZhRKxdD2i\n KxVWcZ/oIPbhj0JbZ07IZnugRsyG73VekOmGuMS+CiSNDFx2lzooCcU43rqq6JjwjZ3D\n Hg2g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777985427; x=1778590227;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=HGEfb93ktgl3f/5UYg0ZpYbUgmiWQzqYOfMzkPyrudk=;\n b=aVmvPjSrt2/3T5zQ3kuHkG3XmRdQ9pDoI+ntLlecFrS7fSHAGezSwx4Z415YCOfc/I\n rBkDgYnb1uAvPeYwsxaSCaPc7CA9T4UeNQOwS1mUrhz7KY5dQ3S9UB6zaeL0+eYaaFsa\n KfzN1CK9AjFVszdVEiXB+MqdOp6Y99XDR4V1k4Zf1jKmX+k+WAPwPNETcSKJCaLtFhE/\n ZHlRGmcKT0HxJmUbnx4WsFNCpZ52MZvw5ysviCiin8zjNh1N/XA/BnwCm7/cfdJXgXAK\n k6bXbEeb/B7eRFE5KBeg5/UFHrYx3pxkjva8mvgZs2XZ2P8IOQdw5dH024lZ+ybrCNrS\n VB1g==","X-Forwarded-Encrypted":"i=1;\n AFNElJ8YmwC8s+l1ww+ov723vKYf9H9xc12oBNRQfPsQWMICuGBndgwej9Kk7uNMj/MobjrOanY=@openvswitch.org","X-Gm-Message-State":"AOJu0YycAfUKjTlxxPJaW4MBqNpMmOBCq2bmVWE3IMaGZOGGdm47HQXF\n tM43Ld+QEYsJ/xBcM7PsFUmDvkpHCwgOCDYlMNhB64liDfoq9/aNGFF+","X-Gm-Gg":"AeBDiesRYdc8AjSGZFJkHBqDtKmS3It0E/xrpOl4TcBQFzgG3jY8+B0dhEnp4ZnvF0K\n LSnsJ4yDusS6wJO7YvEoP2/JxpxG1CrVCrH9LIsd25WqeTPvv6HdKbPEA/yooDUzZE/m5WJ5Rg1\n 2yUsAsN7v1Ee/dIGwkV6G4oBzt3fOkl+nwjt4aDEacCsMyriAqiniOb9HybLVMfBddjmxjBKQoL\n 5rBxWEkiQneM89mEOk1vz20w0q3clar8LqlVa6SUFxBoEGFEMtKVVGt7Wr6LgFiuMk7E6YVc4fV\n ze/rTZzkXoZRqqx46GxcI658x7dN+G3BlkiMMhD8SvrYtSRI87TGiXmIJHuTu2vLDb2LeoHbWXm\n c6jIfzZyVN890cUlmhXh0g/foW3zs+epADOPXGU0HpPbUtu0Un9lhKpfAvl9iOFjZb8t13TcWjV\n jqsQwjmSoCR6IXu5W5lXpFw5ybrA==","X-Received":"by 2002:a05:6830:920:b0:7dc:c43b:9599 with SMTP id\n 46e09a7af769-7e174a06448mr1554947a34.7.1777985426718;\n Tue, 05 May 2026 05:50:26 -0700 (PDT)","From":"Minxi Hou <houminxi@gmail.com>","To":"netdev@vger.kernel.org","Date":"Tue,  5 May 2026 20:49:57 +0800","Message-ID":"<20260505124957.1239812-3-houminxi@gmail.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260505124957.1239812-1-houminxi@gmail.com>","References":"<20260505124957.1239812-1-houminxi@gmail.com>","MIME-Version":"1.0","Subject":"[ovs-dev] [PATCH net-next v5 2/2] selftests: openvswitch: add\n pop_vlan test","X-BeenThere":"ovs-dev@openvswitch.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"<ovs-dev.openvswitch.org>","List-Unsubscribe":"<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>","List-Archive":"<http://mail.openvswitch.org/pipermail/ovs-dev/>","List-Post":"<mailto:ovs-dev@openvswitch.org>","List-Help":"<mailto:ovs-dev-request@openvswitch.org?subject=help>","List-Subscribe":"<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=subscribe>","Cc":"dev@openvswitch.org, linux-kselftest@vger.kernel.org,\n Minxi Hou <houminxi@gmail.com>, linux-kernel@vger.kernel.org,\n i.maximets@ovn.org, edumazet@google.com, horms@kernel.org, kuba@kernel.org,\n pabeni@redhat.com, shuah@kernel.org, davem@davemloft.net","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"ovs-dev-bounces@openvswitch.org","Sender":"\"dev\" <ovs-dev-bounces@openvswitch.org>"},"content":"Add test_pop_vlan() to verify OVS kernel datapath pop_vlan action\ncorrectly strips 802.1Q VLAN tags from frames.\n\nTest structure:\n- Baseline: untagged forwarding validates basic connectivity.\n- Negative: forward without pop_vlan, tagged frame is invisible\n  to ns2 (no VLAN sub-interface), ping fails.\n- Positive: pop_vlan strips tag on forward path, push_vlan\n  restores tag on return path, ping succeeds.\n\nUse static ARP entries to avoid VLAN-tagged ARP complexity.\nRely on ping success/failure for verification — no tcpdump or\npcap files needed.\n\nSigned-off-by: Minxi Hou <houminxi@gmail.com>\n---\n .../selftests/net/openvswitch/openvswitch.sh  | 77 +++++++++++++++++++\n 1 file changed, 77 insertions(+)","diff":"diff --git a/tools/testing/selftests/net/openvswitch/openvswitch.sh b/tools/testing/selftests/net/openvswitch/openvswitch.sh\nindex b327d3061ed5..a64f4d515e83 100755\n--- a/tools/testing/selftests/net/openvswitch/openvswitch.sh\n+++ b/tools/testing/selftests/net/openvswitch/openvswitch.sh\n@@ -27,6 +27,7 @@ tests=\"\n \tupcall_interfaces\t\t\tovs: test the upcall interfaces\n \ttunnel_metadata\t\t\t\tovs: test extraction of tunnel metadata\n \tdrop_reason\t\t\t\tdrop: test drop reasons are emitted\n+\tpop_vlan\t\t\t\tvlan: POP_VLAN action strips tag\n \tpsample\t\t\t\t\tpsample: Sampling packets with psample\"\n \n info() {\n@@ -830,6 +831,82 @@ test_tunnel_metadata() {\n \treturn 0\n }\n \n+test_pop_vlan() {\n+\tmodprobe -q 8021q 2>/dev/null || true\n+\t[ -d /sys/module/8021q ] || \\\n+\t\t{ info \"CONFIG_VLAN_8021Q missing\"; return $ksft_skip; }\n+\n+\tlocal sbx=\"test_pop_vlan\"\n+\tsbx_add \"$sbx\" || return $?\n+\tovs_add_dp \"$sbx\" vlandp || return 1\n+\n+\tovs_add_netns_and_veths \"$sbx\" vlandp \\\n+\t\tns1 veth1 ns1veth 192.0.2.1/24 || return 1\n+\tovs_add_netns_and_veths \"$sbx\" vlandp \\\n+\t\tns2 veth2 ns2veth 192.0.2.2/24 || return 1\n+\n+\t# Baseline: untagged bidirectional forwarding\n+\tovs_add_flow \"$sbx\" vlandp \\\n+\t\t'in_port(1),eth(),eth_type(0x0806),arp()' '2' || return 1\n+\tovs_add_flow \"$sbx\" vlandp \\\n+\t\t'in_port(2),eth(),eth_type(0x0806),arp()' '1' || return 1\n+\tovs_add_flow \"$sbx\" vlandp \\\n+\t\t'in_port(1),eth(),eth_type(0x0800),ipv4()' '2' || return 1\n+\tovs_add_flow \"$sbx\" vlandp \\\n+\t\t'in_port(2),eth(),eth_type(0x0800),ipv4()' '1' || return 1\n+\tovs_sbx \"$sbx\" ip netns exec ns1 ping -c 3 -W 2 \\\n+\t\t192.0.2.2 || return 1\n+\n+\t# VLAN topology: ns1 uses VLAN sub-interface, ns2 is plain\n+\tip -n ns1 link add link ns1veth name ns1veth.10 \\\n+\t\ttype vlan id 10 || return 1\n+\ton_exit \"ip -n ns1 link del ns1veth.10 2>/dev/null\"\n+\tip -n ns1 addr add 198.51.100.1/24 dev ns1veth.10 || return 1\n+\tip -n ns1 link set ns1veth.10 up || return 1\n+\tip -n ns2 addr add 198.51.100.2/24 dev ns2veth || return 1\n+\n+\tovs_del_flows \"$sbx\" vlandp\n+\n+\t# Static ARP: avoids VLAN-tagged ARP complexity\n+\tlocal ns1veth10mac ns2mac\n+\tns1veth10mac=$(ip -n ns1 link show ns1veth.10 \\\n+\t\t| awk '/link\\/ether/ {print $2}')\n+\tns2mac=$(ip -n ns2 link show ns2veth \\\n+\t\t| awk '/link\\/ether/ {print $2}')\n+\tip -n ns1 neigh replace 198.51.100.2 lladdr \"$ns2mac\" \\\n+\t\tdev ns1veth.10 nud permanent || return 1\n+\tip -n ns2 neigh replace 198.51.100.1 \\\n+\t\tlladdr \"$ns1veth10mac\" \\\n+\t\tdev ns2veth nud permanent || return 1\n+\n+\tlocal vlan_match='in_port(1),eth(),eth_type(0x8100),'\n+\tvlan_match+='vlan(vid=10),'\n+\tvlan_match+='encap(eth_type(0x0800),'\n+\tvlan_match+='ipv4(src=198.51.100.1,proto=1),icmp())'\n+\n+\t# Negative: forward without pop_vlan — tagged frame\n+\t# is invisible to ns2 (no VLAN sub-interface), ping fails\n+\tovs_add_flow \"$sbx\" vlandp \"$vlan_match\" '2' || return 1\n+\tovs_sbx \"$sbx\" ip netns exec ns1 ping -I ns1veth.10 \\\n+\t\t-c 3 -W 1 198.51.100.2 >/dev/null 2>&1 \\\n+\t\t&& { info \"FAIL: ping should fail without pop_vlan\"\n+\t\t     return 1; }\n+\n+\tovs_del_flows \"$sbx\" vlandp\n+\n+\t# Positive: pop_vlan strips tag on forward path,\n+\t# push_vlan restores tag on return path — ping succeeds\n+\tovs_add_flow \"$sbx\" vlandp \\\n+\t\t\"$vlan_match\" 'pop_vlan,2' || return 1\n+\tovs_add_flow \"$sbx\" vlandp \\\n+\t\t'in_port(2),eth(),eth_type(0x0800),ipv4()' \\\n+\t\t'push_vlan(vid=10,pcp=0,tpid=0x8100),1' || return 1\n+\tovs_sbx \"$sbx\" ip netns exec ns1 ping -I ns1veth.10 \\\n+\t\t-c 3 -W 2 198.51.100.2 || return 1\n+\n+\treturn 0\n+}\n+\n run_test() {\n \t(\n \ttname=\"$1\"\n","prefixes":["ovs-dev","net-next","v5","2/2"]}