{"id":2231879,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2231879/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/patch/20260501133924.3100680-2-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":"<20260501133924.3100680-2-houminxi@gmail.com>","list_archive_url":null,"date":"2026-05-01T13:39:22","name":"[ovs-dev,net-next,v2,1/2] selftests: openvswitch: add vlan() and encap() flow string parsing","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"c40be7d16bad05016bbd92e41d86278949bab6ad","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/20260501133924.3100680-2-houminxi@gmail.com/mbox/","series":[{"id":502459,"url":"http://patchwork.ozlabs.org/api/1.2/series/502459/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/list/?series=502459","date":"2026-05-01T13:39:21","name":"selftests: openvswitch: add pop_vlan test","version":2,"mbox":"http://patchwork.ozlabs.org/series/502459/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2231879/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2231879/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=IFNcmAKc;\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=IFNcmAKc","smtp3.osuosl.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","smtp3.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=IFNcmAKc"],"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 4g6XGG0Hrzz1y04\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 23:39:49 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id 43A814268D;\n\tFri,  1 May 2026 13:39:48 +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 XYEz0u64cYx7; Fri,  1 May 2026 13:39:46 +0000 (UTC)","from lists.linuxfoundation.org (lf-lists.osuosl.org\n [IPv6:2605:bc80:3010:104::8cd3:938])\n\tby smtp4.osuosl.org (Postfix) with ESMTPS id D94CC4267B;\n\tFri,  1 May 2026 13:39:44 +0000 (UTC)","from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id A8F98C04E8;\n\tFri,  1 May 2026 13:39:44 +0000 (UTC)","from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 2EE46C04E7\n for <dev@openvswitch.org>; Fri,  1 May 2026 13:39:43 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n by smtp3.osuosl.org (Postfix) with ESMTP id 20FA4613CB\n for <dev@openvswitch.org>; Fri,  1 May 2026 13:39:43 +0000 (UTC)","from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id PdryWmD43Mra for <dev@openvswitch.org>;\n Fri,  1 May 2026 13:39:42 +0000 (UTC)","from mail-pf1-x434.google.com (mail-pf1-x434.google.com\n [IPv6:2607:f8b0:4864:20::434])\n by smtp3.osuosl.org (Postfix) with ESMTPS id 4C80F61098\n for <dev@openvswitch.org>; Fri,  1 May 2026 13:39:42 +0000 (UTC)","by mail-pf1-x434.google.com with SMTP id\n d2e1a72fcca58-83178c0f29cso1325362b3a.0\n for <dev@openvswitch.org>; Fri, 01 May 2026 06:39:42 -0700 (PDT)","from houminxi ([38.207.130.223]) by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-835158aa1ffsm2548386b3a.22.2026.05.01.06.39.37\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 01 May 2026 06:39:40 -0700 (PDT)"],"X-Virus-Scanned":["amavis at osuosl.org","amavis at osuosl.org"],"X-Comment":"SPF check N/A for local connections -\n client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN> ","DKIM-Filter":["OpenDKIM Filter v2.11.0 smtp4.osuosl.org D94CC4267B","OpenDKIM Filter v2.11.0 smtp3.osuosl.org 4C80F61098"],"Received-SPF":"Pass (mailfrom) identity=mailfrom;\n client-ip=2607:f8b0:4864:20::434; helo=mail-pf1-x434.google.com;\n envelope-from=houminxi@gmail.com; receiver=<UNKNOWN>","DMARC-Filter":"OpenDMARC Filter v1.4.2 smtp3.osuosl.org 4C80F61098","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1777642781; x=1778247581; 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=RBUdc3yx6OeZeNgFbIeAinqkyWh6EhE9Q31G7NtAQnk=;\n b=IFNcmAKcwS0T7myrd2wnFfEW9K+6Q9NY93j2AoEImVNgkB6RoRk7ZaPekvA4/1V71w\n kR1r1i7zQY5vHuCNZw+ieRecClDh3dydZnDyk7uhBWy81ZIsIwFeGU59it06Z5jsQU5P\n KJrEaDlKnjkpxOq8MHg9s9qKWsft1FAJtIQjFKXQROClRRRnSG7rCNUyMUYz6DW4Qq7L\n hRvWyEQvyr77gmsvFhrns9s5LHNSMcyj8Ro75vFaWU3n9qxS8ImXpvddH9vfG26eCYfl\n +xqJUgj2sddtlE0OoPSN2t4S9LzcaI0qK41+vji6wa50o/m6rGKyc2Lzgm9h6qfznXXD\n xeow==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777642781; x=1778247581;\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=RBUdc3yx6OeZeNgFbIeAinqkyWh6EhE9Q31G7NtAQnk=;\n b=ThHpBbJopODkajYJ2uOrhHr/q1pqqa8TKg3Ks7lsiCK7sztqgJQTnVzyuGdl+OmwzG\n ytp2ztWB16UQTE3qVJz0M3g6jEhHoVN0MNIwLSp7+CgHqVF1QHmENsyaeer4+C5Sz0cI\n kO71JDjSVBtg3ajE1G/4iLXkgak76G48PgymUS7Rmn7VnVJ9FMWBxXN/6KAgvcsBAiFZ\n W0SSkHRwJFOwV2gJ3cHQHv7jppB9sNaqBPtod4bL0GDNNCd7NOTpAYp2SUc523eluZ69\n JeXjncEDeKSeokllXRr6xBcrJbkjnMIvVOy9s2b3IZlN1OpcmpjM2MExx3AjErr4O0+t\n K6EQ==","X-Forwarded-Encrypted":"i=1;\n AFNElJ/WMyj+I6Jk+dvhv0K4SN7h1gF/L0N78X/6S+8yEWko2GgP886PzdBfzETDl62jE6mWQAg=@openvswitch.org","X-Gm-Message-State":"AOJu0YzFuRlj/w0W7KbBgXotEw77hLUfOIqpoSlxGP6oVSkdlZPOYgFX\n h/GMFnx+mvJ5nRYRRnlFse5iSS0LwKwc3ong5XN7WQKI5lm3Z1yxi6pH","X-Gm-Gg":"AeBDietKittX/wfoSikUqCPyTc51PTybdY5ZonTfHMkfMMHS2BPQ9kBuGguAr+rAfHG\n vMoJdK3k80N7sZZX103zFqJGlgdwKd7JwOH+5dgdxSnMfwh9ondrZl7bpIAPL5mKkqgSHVWX+0J\n 0Re89LensZ2/DVCHuJFQR/AwFsv0n7b5tLsRu6gAcpyoocfSg0Bqht/hVtGLbXAk5YbuzKpre0M\n ALqYCi6L7aP7Q/AKCw33mQjTRVA3k2sEzoJf0OwegzTwUmNnhGHq64dURDyY2RtHby5UXuCN6SV\n tonyfAgNZiYMYe33473TdR1I0cLGqzurASRbt2J5KUramvWVt84q+9qz9GkGoduMNfUDyNFpvHI\n PxGPdNF5YC0hn7UKP5DWa+5kHmtM8pN0/PgrtRiR7PxLsckqp13tcu+OdXMn98pDNaN7utexksh\n walZ4CW2+FSqtjE44ugfAjlLyW2K0=","X-Received":"by 2002:a05:6a00:f8d:b0:82c:77cd:50e8 with SMTP id\n d2e1a72fcca58-834fdbeae25mr9005825b3a.27.1777642781380;\n Fri, 01 May 2026 06:39:41 -0700 (PDT)","From":"Minxi Hou <houminxi@gmail.com>","To":"netdev@vger.kernel.org","Date":"Fri,  1 May 2026 21:39:22 +0800","Message-ID":"<20260501133924.3100680-2-houminxi@gmail.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260501133924.3100680-1-houminxi@gmail.com>","References":"<20260501133924.3100680-1-houminxi@gmail.com>","MIME-Version":"1.0","Subject":"[ovs-dev] [PATCH net-next v2 1/2] selftests: openvswitch: add\n vlan() and encap() flow string parsing","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, Simon Horman <horms@kernel.org>,\n Minxi Hou <houminxi@gmail.com>, linux-kernel@vger.kernel.org,\n Ilya Maximets <i.maximets@ovn.org>, Eric Dumazet <edumazet@google.com>,\n linux-kselftest@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,\n Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>,\n \"David S. Miller\" <davem@davemloft.net>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"ovs-dev-bounces@openvswitch.org","Sender":"\"dev\" <ovs-dev-bounces@openvswitch.org>"},"content":"Extend the ovs-dpctl.py flow parser to support vlan() and encap()\nmatch strings.  vlan() accepts tci=, vid=, pcp=, and cfi=\nparameters and generates the OVS_KEY_ATTR_VLAN attribute with a TCI\nvalue in network byte order.  encap() parses nested flow strings\nand returns OVS_KEY_ATTR_ENCAP with inner key attributes as a\nrecursive NLA container.\n\nThe encap nla_map type is changed from \"none\" to \"nested\" so that\npyroute2 recursively encodes the inner flow key attributes.  The\nVLAN nla_map type is changed from \"uint16\" to \"be16\" to match the\nkernel's big-endian wire format.\n\nSigned-off-by: Minxi Hou <houminxi@gmail.com>\n---\nv1 -> v2: rebase to latest net-next/main, drop --base=auto\n\n .../selftests/net/openvswitch/ovs-dpctl.py    | 190 +++++++++++++++++-\n 1 file changed, 188 insertions(+), 2 deletions(-)","diff":"diff --git a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py\nindex 848f61fdcee0..317be7878937 100644\n--- a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py\n+++ b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py\n@@ -901,11 +901,11 @@ class ovskey(nla):\n     nla_flags = NLA_F_NESTED\n     nla_map = (\n         (\"OVS_KEY_ATTR_UNSPEC\", \"none\"),\n-        (\"OVS_KEY_ATTR_ENCAP\", \"none\"),\n+        (\"OVS_KEY_ATTR_ENCAP\", \"nested\"),\n         (\"OVS_KEY_ATTR_PRIORITY\", \"uint32\"),\n         (\"OVS_KEY_ATTR_IN_PORT\", \"uint32\"),\n         (\"OVS_KEY_ATTR_ETHERNET\", \"ethaddr\"),\n-        (\"OVS_KEY_ATTR_VLAN\", \"uint16\"),\n+        (\"OVS_KEY_ATTR_VLAN\", \"be16\"),\n         (\"OVS_KEY_ATTR_ETHERTYPE\", \"be16\"),\n         (\"OVS_KEY_ATTR_IPV4\", \"ovs_key_ipv4\"),\n         (\"OVS_KEY_ATTR_IPV6\", \"ovs_key_ipv6\"),\n@@ -1636,6 +1636,180 @@ class ovskey(nla):\n     class ovs_key_mpls(nla):\n         fields = ((\"lse\", \">I\"),)\n \n+    # 802.1Q CFI (Canonical Format Indicator) bit, always set for Ethernet\n+    _VLAN_CFI_MASK = 0x1000\n+    _MAX_ENCAP_DEPTH = 4\n+    _encap_depth = 0  # single-threaded usage assumed\n+\n+    @staticmethod\n+    def _parse_vlan_from_flowstr(flowstr):\n+        \"\"\"Parse vlan(tci=X) or vlan(vid=X[,pcp=Y,cfi=Z]) from flowstr.\n+\n+        Returns (remaining_flowstr, key_tci, mask_tci).\n+        TCI values use standard bit layout (VID bits 0-11,\n+        CFI bit 12, PCP bits 13-15); byte order conversion to\n+        big-endian happens in pyroute2 be16 NLA serialization.\n+        The mask covers only the fields the caller specified:\n+        vid -> 0x0FFF, pcp -> 0xE000, cfi -> 0x1000, tci -> 0xFFFF.\n+\n+        The tci= key sets the raw TCI bitfield (no CFI validation) to allow\n+        non-Ethernet use cases.  Use cfi=1 for standard Ethernet VLAN matching.\n+        \"\"\"\n+        tci = 0\n+        mask = 0\n+        has_tci = False\n+        has_vid = has_pcp = has_cfi = False\n+        _tci_mix_err = \"vlan(): 'tci' cannot be mixed \" \\\n+                       \"with 'vid'/'pcp'/'cfi'\"\n+        first = True\n+        while True:\n+            flowstr = flowstr.lstrip()\n+            if not flowstr:\n+                raise ValueError(\"vlan(): missing ')'\")\n+            if flowstr[0] == ')':\n+                break\n+            if not first:\n+                flowstr = flowstr[1:]  # skip ','\n+                if not flowstr:\n+                    raise ValueError(\"vlan(): missing ')' after trailing comma\")\n+                flowstr = flowstr.lstrip()\n+                if flowstr and flowstr[0] == ')':\n+                    break\n+                if flowstr and flowstr[0] == ',':\n+                    raise ValueError(\n+                        \"vlan(): empty or extra comma in field list\")\n+            first = False\n+\n+            eq = flowstr.find('=')\n+            if eq == -1:\n+                raise ValueError(\"vlan(): expected key=value, got '%s'\" % flowstr)\n+            key = flowstr[:eq].strip()\n+            flowstr = flowstr[eq + 1:]\n+\n+            end = flowstr.find(',')\n+            end2 = flowstr.find(')')\n+            if end == -1 or (end2 != -1 and end2 < end):\n+                end = end2\n+            val = flowstr[:end].strip()\n+            flowstr = flowstr[end:]\n+\n+            if not val:\n+                raise ValueError(\"vlan(): empty value for key '%s'\" % key)\n+            try:\n+                v = int(val, 16) if val.startswith(('0x', '0X')) else int(val)\n+            except ValueError:\n+                raise ValueError(\"vlan(): invalid value '%s' for key '%s'\" %\n+                                 (val, key))\n+\n+            if key == 'tci':\n+                if has_tci:\n+                    raise ValueError(\"vlan(): duplicate 'tci'\")\n+                if has_vid or has_pcp or has_cfi:\n+                    raise ValueError(_tci_mix_err)\n+                if v > 0xFFFF or v < 0:\n+                    raise ValueError(\"vlan(): tci=0x%x out of range\" % v)\n+                tci = v\n+                mask = 0xFFFF\n+                has_tci = True\n+            elif key == 'vid':\n+                if has_tci:\n+                    raise ValueError(_tci_mix_err)\n+                if has_vid:\n+                    raise ValueError(\"vlan(): duplicate 'vid'\")\n+                if v < 0 or v > 0xFFF:\n+                    raise ValueError(\"vlan(): vid=%d out of range (0-4095)\" % v)\n+                tci |= v\n+                mask |= 0x0FFF\n+                has_vid = True\n+            elif key == 'pcp':\n+                if has_tci:\n+                    raise ValueError(_tci_mix_err)\n+                if has_pcp:\n+                    raise ValueError(\"vlan(): duplicate 'pcp'\")\n+                if v < 0 or v > 7:\n+                    raise ValueError(\"vlan(): pcp=%d out of range (0-7)\" % v)\n+                tci |= (v & 0x7) << 13\n+                mask |= 0xE000\n+                has_pcp = True\n+            elif key == 'cfi':\n+                if has_tci:\n+                    raise ValueError(_tci_mix_err)\n+                if has_cfi:\n+                    raise ValueError(\"vlan(): duplicate 'cfi'\")\n+                if v != 1:\n+                    raise ValueError(\"vlan(): cfi must be 1 for Ethernet\")\n+                tci |= ovskey._VLAN_CFI_MASK\n+                mask |= ovskey._VLAN_CFI_MASK\n+                has_cfi = True\n+            else:\n+                raise ValueError(\"vlan(): unknown key '%s'\" % key)\n+\n+        flowstr = flowstr[1:]  # skip ')'\n+        # Catch immediate '))' (user error).  A ')' after ',' is consumed\n+        # by parse()'s strspn(flowstr, \"), \") inter-field separator stripping.\n+        if flowstr.lstrip().startswith(')'):\n+            raise ValueError(\"vlan(): unmatched ')'\")\n+        # parse() strips trailing ',', ')', ' ' as inter-field separators,\n+        # so we do not need to call strspn here.\n+\n+        if mask == 0:\n+            raise ValueError(\"vlan(): no fields specified, \"\n+                             \"use vlan(vid=X[,pcp=Y,cfi=Z]) or vlan(tci=X)\")\n+        if not has_tci:\n+            tci |= ovskey._VLAN_CFI_MASK\n+            mask |= ovskey._VLAN_CFI_MASK\n+        return flowstr, tci, mask\n+\n+    @staticmethod\n+    def _parse_encap_from_flowstr(flowstr):\n+        \"\"\"Parse encap(inner_flow) from flowstr.\n+\n+        Returns (remaining_flowstr, inner_key_dict, inner_mask_dict)\n+        where each dict has an 'attrs' key for recursive NLA encoding.\n+        Parenthesis-depth tracking handles nested encap() calls but not\n+        quoted strings containing literal parentheses.\n+        \"\"\"\n+        if ovskey._encap_depth >= ovskey._MAX_ENCAP_DEPTH:\n+            raise ValueError(\"encap(): max nesting depth %d exceeded\" %\n+                             ovskey._MAX_ENCAP_DEPTH)\n+        try:\n+            ovskey._encap_depth += 1\n+            depth = 1\n+            end = -1\n+            for i, c in enumerate(flowstr):\n+                if c == '(':\n+                    depth += 1\n+                elif c == ')':\n+                    depth -= 1\n+                    if depth < 0:\n+                        raise ValueError(\"encap(): unmatched ')' at position %d\" % i)\n+                    if depth == 0:\n+                        end = i\n+                        break\n+\n+            if end == -1:\n+                if depth > 1:\n+                    raise ValueError(\"encap(): missing ')' at end\")\n+                raise ValueError(\"encap(): missing closing ')'\")\n+\n+            inner_str = flowstr[:end].strip()\n+            if not inner_str:\n+                raise ValueError(\"encap(): empty inner flow\")\n+\n+            flowstr = flowstr[end + 1:]\n+            if flowstr.lstrip().startswith(')'):\n+                raise ValueError(\"encap(): unmatched ')' after encap()\")\n+            # parse() strips trailing ',', ')', ' ' as inter-field separators,\n+            # so we do not need to call strspn here.\n+\n+            inner_key = ovskey()\n+            inner_mask = ovskey()\n+            inner_key.parse(inner_str, inner_mask)\n+\n+            return flowstr, inner_key, inner_mask\n+        finally:\n+            ovskey._encap_depth -= 1\n+\n     def parse(self, flowstr, mask=None):\n         for field in (\n             (\"OVS_KEY_ATTR_PRIORITY\", \"skb_priority\", intparse),\n@@ -1657,6 +1831,16 @@ class ovskey(nla):\n                 \"eth_type\",\n                 lambda x: intparse(x, \"0xffff\"),\n             ),\n+            (\n+                \"OVS_KEY_ATTR_VLAN\",\n+                \"vlan\",\n+                ovskey._parse_vlan_from_flowstr,\n+            ),\n+            (\n+                \"OVS_KEY_ATTR_ENCAP\",\n+                \"encap\",\n+                ovskey._parse_encap_from_flowstr,\n+            ),\n             (\n                 \"OVS_KEY_ATTR_IPV4\",\n                 \"ipv4\",\n@@ -1794,6 +1978,8 @@ class ovskey(nla):\n                 True,\n             ),\n             (\"OVS_KEY_ATTR_ETHERNET\", None, None, False, False),\n+            (\"OVS_KEY_ATTR_VLAN\", \"vlan\", \"0x%04x\", lambda x: False, True),\n+            (\"OVS_KEY_ATTR_ENCAP\", None, None, False, False),\n             (\n                 \"OVS_KEY_ATTR_ETHERTYPE\",\n                 \"eth_type\",\n","prefixes":["ovs-dev","net-next","v2","1/2"]}