{"id":2231784,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2231784/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/patch/20260501122756.3081754-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":"<20260501122756.3081754-2-houminxi@gmail.com>","list_archive_url":null,"date":"2026-05-01T12:27:55","name":"[ovs-dev,1/2] selftests: openvswitch: add vlan() and encap() flow string parsing","commit_ref":null,"pull_url":null,"state":"superseded","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/20260501122756.3081754-2-houminxi@gmail.com/mbox/","series":[{"id":502450,"url":"http://patchwork.ozlabs.org/api/1.2/series/502450/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/list/?series=502450","date":"2026-05-01T12:27:54","name":"selftests: openvswitch: add pop_vlan test","version":1,"mbox":"http://patchwork.ozlabs.org/series/502450/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2231784/comments/","check":"fail","checks":"http://patchwork.ozlabs.org/api/patches/2231784/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=q6ST81Oy;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=140.211.166.136; helo=smtp3.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org)","smtp3.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=q6ST81Oy","smtp1.osuosl.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","smtp1.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=q6ST81Oy"],"Received":["from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136])\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 4g6Vgm4M9nz1xqf\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 22:28:20 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 7AC8C61B50;\n\tFri,  1 May 2026 12:28:18 +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 MsWnN8R_zoxd; Fri,  1 May 2026 12:28:17 +0000 (UTC)","from lists.linuxfoundation.org (lf-lists.osuosl.org\n [IPv6:2605:bc80:3010:104::8cd3:938])\n\tby smtp3.osuosl.org (Postfix) with ESMTPS id 58D5861BD4;\n\tFri,  1 May 2026 12:28:17 +0000 (UTC)","from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 2F936C04E7;\n\tFri,  1 May 2026 12:28:17 +0000 (UTC)","from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n by lists.linuxfoundation.org (Postfix) with ESMTP id E3E8DC04E7\n for <dev@openvswitch.org>; Fri,  1 May 2026 12:28:15 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n by smtp1.osuosl.org (Postfix) with ESMTP id C9FC785611\n for <dev@openvswitch.org>; Fri,  1 May 2026 12:28:15 +0000 (UTC)","from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id m72u-n3UYzHC for <dev@openvswitch.org>;\n Fri,  1 May 2026 12:28:15 +0000 (UTC)","from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com\n [IPv6:2607:f8b0:4864:20::62b])\n by smtp1.osuosl.org (Postfix) with ESMTPS id F41F8855E8\n for <dev@openvswitch.org>; Fri,  1 May 2026 12:28:14 +0000 (UTC)","by mail-pl1-x62b.google.com with SMTP id\n d9443c01a7336-2a871daa98fso10811195ad.1\n for <dev@openvswitch.org>; Fri, 01 May 2026 05:28:14 -0700 (PDT)","from houminxi ([38.207.130.223]) by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2b9ca953894sm23370395ad.0.2026.05.01.05.28.09\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 01 May 2026 05:28:13 -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 smtp3.osuosl.org 58D5861BD4","OpenDKIM Filter v2.11.0 smtp1.osuosl.org F41F8855E8"],"Received-SPF":"Pass (mailfrom) identity=mailfrom;\n client-ip=2607:f8b0:4864:20::62b; helo=mail-pl1-x62b.google.com;\n envelope-from=houminxi@gmail.com; receiver=<UNKNOWN>","DMARC-Filter":"OpenDMARC Filter v1.4.2 smtp1.osuosl.org F41F8855E8","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1777638494; x=1778243294; 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=JEYXiPSD8teEVjafPyld1dLG1JDxUCAY+nTRXNsUO0Y=;\n b=q6ST81OySWaJIMhHzdLUdT+ZF7QZluLvoJ3TPNKVOKTyKr6TzU4jhgkczToYc0h19/\n JoQAyGyBmq/FtxVT4A2KR7hMsrvG5rK6GIbZDFaxSsGnFmD9tNqeXDSE6uOqeTJsNUSe\n gMtke/LrbJWVdI//BRyLNeQGL4IUymSnMuntd6QOmitq+zXtO4FRPU6Ds6iDjVPy8aTT\n tzivoR2xVEzUF7LjeyFzTpBu/nF2pB62UTo5tjwahj9RU6sINfjPkryMQbrt5IrdLfTl\n shita4YHl+hvHuw32tW9yczK4uwYVx9ojtzbe7vUz6PJe7n5WZzA6UZajsesJbxt5gPa\n wjrg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777638494; x=1778243294;\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=JEYXiPSD8teEVjafPyld1dLG1JDxUCAY+nTRXNsUO0Y=;\n b=rjHLpwYykCipJkskCYu/xyOOT0BKx5srmtwJVwqP8KwpBEfMRMzdxB2K9CXVQOCXXR\n 5i6w/IKvIS50weG7d36c1bxquSUHlUMBIeujypQRDZzlpSJij+/CImuqob+zrhwVRZQo\n jjAoEhX6sox57qI1g/Ok9yv13+eDqlCtJm1KyePdVCqEdXq74klGy3uy/9lgBzZKe3NX\n 6CMySC4nl/7TLLwjZonGq9vMx1HPjz1hrmXiHAmcDH4fWGd0/tybtKbd2qQIbShn0aFz\n c1kHRTg2Vsnk/1ZrMbgm/qb5DtNo3howxyjd6kUpHrqXRHhMLZ6bRkJSiDNduEAFzQri\n DFrg==","X-Forwarded-Encrypted":"i=1;\n AFNElJ93Q10mFg5Db3x8nsAa3aBEqGNXrK6QtdyMszigsQXs4EjAi3afFm4fHEDqGny7npGPTzg=@openvswitch.org","X-Gm-Message-State":"AOJu0YxldwRfgbT/qb3iG6mpWVkl3jPi8d4RtqDjPaXOhhAZSAhQ3X1o\n Pzw9HVWNeRA+VyJ0VF1mXAvHFDSQA5V0eV8BtbB4Sl5BTgKyLwvopTqw","X-Gm-Gg":"AeBDieuSGoCaJaY5/anN41MFBKkTHAeRVVZvNS8TR8FjjmOM+xVqUkhxSRmzB3EeP2b\n +OisS1vOvij/mZZtKkNrTZIU53IdsPbDl7VQ/E8MaDsJ5FO+brXFLn9nydm7HN3y5e29mwOJcO3\n tTxVidLA3UCfWi/sHIKliQBowiQ8JXrRovntutuEt5AQ+jN3nv5TnFFwTe4sRKM3UPa3BqfDiUG\n tc/0nPz5dal4Gs5QnNa/T8EZJ1z1/8rA+HhUYN0XXoJoIgBQqCkZKv+W6J1cdZKvhp/dvXi+vR3\n bmA6TCTaNJvza1l/f6cFh4gtmbEN2idhwwDjKtEmLV1qb/a8zZA0/KTd5YtDNNKfTmDDN5FTMOd\n oklerbfsSPsDveSm1QsTmmxh566feD8YNzdS9Im0bZrbjummtqlN6BIlBN3BenYFnHs09jeitrn\n BQzAMcAkwuv07wIjSsYDws9+HeERY=","X-Received":"by 2002:a17:902:76ca:b0:2b0:ac1e:973a with SMTP id\n d9443c01a7336-2b9a2524332mr51585155ad.39.1777638493923;\n Fri, 01 May 2026 05:28:13 -0700 (PDT)","From":"Minxi Hou <houminxi@gmail.com>","To":"netdev@vger.kernel.org","Date":"Fri,  1 May 2026 20:27:55 +0800","Message-ID":"<20260501122756.3081754-2-houminxi@gmail.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260501122756.3081754-1-houminxi@gmail.com>","References":"<20260501122756.3081754-1-houminxi@gmail.com>","MIME-Version":"1.0","Subject":"[ovs-dev] [PATCH 1/2] selftests: openvswitch: add vlan() and\n 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---\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","1/2"]}