get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/86138/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 86138,
    "url": "https://patches.dpdk.org/api/patches/86138/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210108021208.225419-2-qi.z.zhang@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20210108021208.225419-2-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210108021208.225419-2-qi.z.zhang@intel.com",
    "date": "2021-01-08T02:12:06",
    "name": "[1/3] common/iavf: add support for new VLAN capabilities",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ef76e81d6c42c246bcd3f5a2eb7d9315e6b5d658",
    "submitter": {
        "id": 504,
        "url": "https://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "https://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210108021208.225419-2-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 14586,
            "url": "https://patches.dpdk.org/api/series/14586/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14586",
            "date": "2021-01-08T02:12:05",
            "name": "update iavf base code",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/14586/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/86138/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/86138/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 51017A0524;\n\tFri,  8 Jan 2021 03:08:25 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 52B9A140DCF;\n\tFri,  8 Jan 2021 03:08:21 +0100 (CET)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id A09E4140DBC\n for <dev@dpdk.org>; Fri,  8 Jan 2021 03:08:18 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 07 Jan 2021 18:08:18 -0800",
            "from dpdk51.sh.intel.com ([10.67.111.142])\n by FMSMGA003.fm.intel.com with ESMTP; 07 Jan 2021 18:08:16 -0800"
        ],
        "IronPort-SDR": [
            "\n vMm3P2mzO157HiDpmY9/QJZaLRF2he7MZzJkBoYzWaDb8QvJgjjToA9dQ9IqZCGNtUPWgDka+Z\n EJjRozA+6GHw==",
            "\n rPSWbRLk55X+xWt2e6GCpUN8PLXbWxtw/c0V3+YDXSaGqn6cfFxJEI66fsuZhfV4umEJn18Drs\n +UqMFrrdh3Yg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9857\"; a=\"174018227\"",
            "E=Sophos;i=\"5.79,330,1602572400\"; d=\"scan'208\";a=\"174018227\"",
            "E=Sophos;i=\"5.79,330,1602572400\"; d=\"scan'208\";a=\"403224969\""
        ],
        "X-ExtLoop1": "1",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "beilei.xing@intel.com,\n\thaiyue.wang@intel.com",
        "Cc": "jingjing.wu@intel.com, dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>,\n Brett Creeley <brett.creeley@intel.com>",
        "Date": "Fri,  8 Jan 2021 10:12:06 +0800",
        "Message-Id": "<20210108021208.225419-2-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.26.2",
        "In-Reply-To": "<20210108021208.225419-1-qi.z.zhang@intel.com>",
        "References": "<20210108021208.225419-1-qi.z.zhang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 1/3] common/iavf: add support for new VLAN\n capabilities",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Currently VIRTCHNL only allows for VLAN filtering and offloads to happen\non a single 802.1Q VLAN. Add support to filter and offload on inner,\nouter, and/or inner + outer VLANs.\n\nThis is done by introducing the new capability\nVIRTCHNL_VF_OFFLOAD_VLAN_V2. The flow to negotiate this new capability\nis shown below.\n\n1. VF - sets the VIRTCHNL_VF_OFFLOAD_VLAN_V2 bit in the\n   virtchnl_vf_resource.vf_caps_flags during the\n   VIRTCHNL_OP_GET_VF_RESOURCES request message. The VF should also set\n   the VIRTCHNL_VF_OFFLOAD_VLAN bit in case the PF driver doesn't support\n   the new capability.\n\n2. PF - sets the VLAN capability bit it supports in the\n   VIRTCHNL_OP_GET_VF_RESOURCES response message. This will either be\n   VIRTCHNL_VF_OFFLOAD_VLAN_V2, VIRTCHNL_VF_OFFLOAD_VLAN, or none.\n\n3. VF - If the VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability was ACK'd by the\n   PF, then the VF needs to request the VLAN capabilities of the\n   PF/Device by issuing a VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS request.\n   If the VIRTCHNL_VF_OFFLOAD_VLAN capability was ACK'd then the VF\n   knows only single 802.1Q VLAN filtering/offloads are supported. If no\n   VLAN capability is ACK'd then the PF/Device doesn't support hardware\n   VLAN filtering/offloads for this VF.\n\n4. PF - Populates the virtchnl_vlan_caps structure based on what it\n   allows/supports for that VF and sends that response via\n   VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS.\n\nAfter VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS is successfully negotiated\nthe VF driver needs to interpret the capabilities supported by the\nunderlying PF/Device. The VF will be allowed to filter/offload the\ninner 802.1Q, outer (various ethertype), inner 802.1Q + outer\n(various ethertypes), or none based on which fields are set.\n\nThe VF will also need to interpret where the VLAN tag should be inserted\nand/or stripped based on the negotiated capabilities.\n\nAlso, update the virtchnl_op_str() function to support the added opcodes.\n\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/common/iavf/virtchnl.h | 364 +++++++++++++++++++++++++++++++++\n 1 file changed, 364 insertions(+)",
    "diff": "diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h\nindex fcbaa31fa8..ca18f8da82 100644\n--- a/drivers/common/iavf/virtchnl.h\n+++ b/drivers/common/iavf/virtchnl.h\n@@ -141,12 +141,129 @@ enum virtchnl_ops {\n \tVIRTCHNL_OP_DEL_FDIR_FILTER = 48,\n \tVIRTCHNL_OP_QUERY_FDIR_FILTER = 49,\n \tVIRTCHNL_OP_GET_MAX_RSS_QREGION = 50,\n+\tVIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS = 51,\n+\tVIRTCHNL_OP_ADD_VLAN_V2 = 52,\n+\tVIRTCHNL_OP_DEL_VLAN_V2 = 53,\n+\tVIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2 = 54,\n+\tVIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2 = 55,\n+\tVIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2 = 56,\n+\tVIRTCHNL_OP_DISABLE_VLAN_INSERTION_V2 = 57,\n \tVIRTCHNL_OP_ENABLE_QUEUES_V2 = 107,\n \tVIRTCHNL_OP_DISABLE_QUEUES_V2 = 108,\n \tVIRTCHNL_OP_MAP_QUEUE_VECTOR = 111,\n \tVIRTCHNL_OP_MAX,\n };\n \n+static inline const char *virtchnl_op_str(enum virtchnl_ops v_opcode)\n+{\n+\tswitch (v_opcode) {\n+\tcase VIRTCHNL_OP_UNKNOWN:\n+\t\treturn \"VIRTCHNL_OP_UNKNOWN\";\n+\tcase VIRTCHNL_OP_VERSION:\n+\t\treturn \"VIRTCHNL_OP_VERSION\";\n+\tcase VIRTCHNL_OP_RESET_VF:\n+\t\treturn \"VIRTCHNL_OP_RESET_VF\";\n+\tcase VIRTCHNL_OP_GET_VF_RESOURCES:\n+\t\treturn \"VIRTCHNL_OP_GET_VF_RESOURCES\";\n+\tcase VIRTCHNL_OP_CONFIG_TX_QUEUE:\n+\t\treturn \"VIRTCHNL_OP_CONFIG_TX_QUEUE\";\n+\tcase VIRTCHNL_OP_CONFIG_RX_QUEUE:\n+\t\treturn \"VIRTCHNL_OP_CONFIG_RX_QUEUE\";\n+\tcase VIRTCHNL_OP_CONFIG_VSI_QUEUES:\n+\t\treturn \"VIRTCHNL_OP_CONFIG_VSI_QUEUES\";\n+\tcase VIRTCHNL_OP_CONFIG_IRQ_MAP:\n+\t\treturn \"VIRTCHNL_OP_CONFIG_IRQ_MAP\";\n+\tcase VIRTCHNL_OP_ENABLE_QUEUES:\n+\t\treturn \"VIRTCHNL_OP_ENABLE_QUEUES\";\n+\tcase VIRTCHNL_OP_DISABLE_QUEUES:\n+\t\treturn \"VIRTCHNL_OP_DISABLE_QUEUES\";\n+\tcase VIRTCHNL_OP_ADD_ETH_ADDR:\n+\t\treturn \"VIRTCHNL_OP_ADD_ETH_ADDR\";\n+\tcase VIRTCHNL_OP_DEL_ETH_ADDR:\n+\t\treturn \"VIRTCHNL_OP_DEL_ETH_ADDR\";\n+\tcase VIRTCHNL_OP_ADD_VLAN:\n+\t\treturn \"VIRTCHNL_OP_ADD_VLAN\";\n+\tcase VIRTCHNL_OP_DEL_VLAN:\n+\t\treturn \"VIRTCHNL_OP_DEL_VLAN\";\n+\tcase VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE:\n+\t\treturn \"VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE\";\n+\tcase VIRTCHNL_OP_GET_STATS:\n+\t\treturn \"VIRTCHNL_OP_GET_STATS\";\n+\tcase VIRTCHNL_OP_RSVD:\n+\t\treturn \"VIRTCHNL_OP_RSVD\";\n+\tcase VIRTCHNL_OP_EVENT:\n+\t\treturn \"VIRTCHNL_OP_EVENT\";\n+\tcase VIRTCHNL_OP_CONFIG_RSS_KEY:\n+\t\treturn \"VIRTCHNL_OP_CONFIG_RSS_KEY\";\n+\tcase VIRTCHNL_OP_CONFIG_RSS_LUT:\n+\t\treturn \"VIRTCHNL_OP_CONFIG_RSS_LUT\";\n+\tcase VIRTCHNL_OP_GET_RSS_HENA_CAPS:\n+\t\treturn \"VIRTCHNL_OP_GET_RSS_HENA_CAPS\";\n+\tcase VIRTCHNL_OP_SET_RSS_HENA:\n+\t\treturn \"VIRTCHNL_OP_SET_RSS_HENA\";\n+\tcase VIRTCHNL_OP_ENABLE_VLAN_STRIPPING:\n+\t\treturn \"VIRTCHNL_OP_ENABLE_VLAN_STRIPPING\";\n+\tcase VIRTCHNL_OP_DISABLE_VLAN_STRIPPING:\n+\t\treturn \"VIRTCHNL_OP_DISABLE_VLAN_STRIPPING\";\n+\tcase VIRTCHNL_OP_REQUEST_QUEUES:\n+\t\treturn \"VIRTCHNL_OP_REQUEST_QUEUES\";\n+\tcase VIRTCHNL_OP_ENABLE_CHANNELS:\n+\t\treturn \"VIRTCHNL_OP_ENABLE_CHANNELS\";\n+\tcase VIRTCHNL_OP_DISABLE_CHANNELS:\n+\t\treturn \"VIRTCHNL_OP_DISABLE_CHANNELS\";\n+\tcase VIRTCHNL_OP_ADD_CLOUD_FILTER:\n+\t\treturn \"VIRTCHNL_OP_ADD_CLOUD_FILTER\";\n+\tcase VIRTCHNL_OP_DEL_CLOUD_FILTER:\n+\t\treturn \"VIRTCHNL_OP_DEL_CLOUD_FILTER\";\n+\tcase VIRTCHNL_OP_DCF_CMD_DESC:\n+\t\treturn \"VIRTCHNL_OP_DCF_CMD_DESC\";\n+\tcase VIRTCHNL_OP_DCF_CMD_BUFF:\n+\t\treturn \"VIRTCHHNL_OP_DCF_CMD_BUFF\";\n+\tcase VIRTCHNL_OP_DCF_DISABLE:\n+\t\treturn \"VIRTCHNL_OP_DCF_DISABLE\";\n+\tcase VIRTCHNL_OP_DCF_GET_VSI_MAP:\n+\t\treturn \"VIRTCHNL_OP_DCF_GET_VSI_MAP\";\n+\tcase VIRTCHNL_OP_GET_SUPPORTED_RXDIDS:\n+\t\treturn \"VIRTCHNL_OP_GET_SUPPORTED_RXDIDS\";\n+\tcase VIRTCHNL_OP_ADD_RSS_CFG:\n+\t\treturn \"VIRTCHNL_OP_ADD_RSS_CFG\";\n+\tcase VIRTCHNL_OP_DEL_RSS_CFG:\n+\t\treturn \"VIRTCHNL_OP_DEL_RSS_CFG\";\n+\tcase VIRTCHNL_OP_ADD_FDIR_FILTER:\n+\t\treturn \"VIRTCHNL_OP_ADD_FDIR_FILTER\";\n+\tcase VIRTCHNL_OP_DEL_FDIR_FILTER:\n+\t\treturn \"VIRTCHNL_OP_DEL_FDIR_FILTER\";\n+\tcase VIRTCHNL_OP_QUERY_FDIR_FILTER:\n+\t\treturn \"VIRTCHNL_OP_QUERY_FDIR_FILTER\";\n+\tcase VIRTCHNL_OP_GET_MAX_RSS_QREGION:\n+\t\treturn \"VIRTCHNL_OP_GET_MAX_RSS_QREGION\";\n+\tcase VIRTCHNL_OP_ENABLE_QUEUES_V2:\n+\t\treturn \"VIRTCHNL_OP_ENABLE_QUEUES_V2\";\n+\tcase VIRTCHNL_OP_DISABLE_QUEUES_V2:\n+\t\treturn \"VIRTCHNL_OP_DISABLE_QUEUES_V2\";\n+\tcase VIRTCHNL_OP_MAP_QUEUE_VECTOR:\n+\t\treturn \"VIRTCHNL_OP_MAP_QUEUE_VECTOR\";\n+\tcase VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS:\n+\t\treturn \"VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS\";\n+\tcase VIRTCHNL_OP_ADD_VLAN_V2:\n+\t\treturn \"VIRTCHNL_OP_ADD_VLAN_V2\";\n+\tcase VIRTCHNL_OP_DEL_VLAN_V2:\n+\t\treturn \"VIRTCHNL_OP_DEL_VLAN_V2\";\n+\tcase VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2:\n+\t\treturn \"VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2\";\n+\tcase VIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2:\n+\t\treturn \"VIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2\";\n+\tcase VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2:\n+\t\treturn \"VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2\";\n+\tcase VIRTCHNL_OP_DISABLE_VLAN_INSERTION_V2:\n+\t\treturn \"VIRTCHNL_OP_DISABLE_VLAN_INSERTION_V2\";\n+\tcase VIRTCHNL_OP_MAX:\n+\t\treturn \"VIRTCHNL_OP_MAX\";\n+\tdefault:\n+\t\treturn \"Unsupported (update virtchnl.h)\";\n+\t}\n+}\n+\n /* These macros are used to generate compilation errors if a structure/union\n  * is not exactly the correct length. It gives a divide by zero error if the\n  * structure/union is not of the correct size, otherwise it creates an enum\n@@ -251,6 +368,7 @@ VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vsi_resource);\n #define VIRTCHNL_VF_OFFLOAD_CRC\t\t\t0x00000080\n \t/* 0X00000100 is reserved */\n #define VIRTCHNL_VF_LARGE_NUM_QPAIRS\t\t0x00000200\n+#define VIRTCHNL_VF_OFFLOAD_VLAN_V2\t\t0x00008000\n #define VIRTCHNL_VF_OFFLOAD_VLAN\t\t0x00010000\n #define VIRTCHNL_VF_OFFLOAD_RX_POLLING\t\t0x00020000\n #define VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2\t0x00040000\n@@ -536,6 +654,223 @@ struct virtchnl_vlan_filter_list {\n \n VIRTCHNL_CHECK_STRUCT_LEN(6, virtchnl_vlan_filter_list);\n \n+/* This enum is used for all of the VIRTCHNL_VF_OFFLOAD_VLAN_V2_CAPS related\n+ * structures and opcodes.\n+ *\n+ * VIRTCHNL_VLAN_UNSUPPORTED - This field is not supported and if a VF driver\n+ * populates it the PF should return VIRTCHNL_STATUS_ERR_NOT_SUPPORTED.\n+ *\n+ * VIRTCHNL_VLAN_ETHERTYPE_8100 - This field supports 0x8100 ethertype.\n+ * VIRTCHNL_VLAN_ETHERTYPE_88A8 - This field supports 0x88A8 ethertype.\n+ * VIRTCHNL_VLAN_ETHERTYPE_9100 - This field supports 0x9100 ethertype.\n+ *\n+ * VIRTCHNL_VLAN_ETHERTYPE_AND - Used when multiple ethertypes can be supported\n+ * by the PF concurrently. For example, if the PF can support\n+ * VIRTCHNL_VLAN_ETHERTYPE_8100 AND VIRTCHNL_VLAN_ETHERTYPE_88A8 filters it\n+ * would OR the following bits:\n+ *\n+ *\tVIRTHCNL_VLAN_ETHERTYPE_8100 |\n+ *\tVIRTCHNL_VLAN_ETHERTYPE_88A8 |\n+ *\tVIRTCHNL_VLAN_ETHERTYPE_AND;\n+ *\n+ * The VF would interpret this as VLAN filtering can be supported on both 0x8100\n+ * and 0x88A8 VLAN ethertypes.\n+ *\n+ * VIRTCHNL_ETHERTYPE_XOR - Used when only a single ethertype can be supported\n+ * by the PF concurrently. For example if the PF can support\n+ * VIRTCHNL_VLAN_ETHERTYPE_8100 XOR VIRTCHNL_VLAN_ETHERTYPE_88A8 stripping\n+ * offload it would OR the following bits:\n+ *\n+ *\tVIRTCHNL_VLAN_ETHERTYPE_8100 |\n+ *\tVIRTCHNL_VLAN_ETHERTYPE_88A8 |\n+ *\tVIRTCHNL_VLAN_ETHERTYPE_XOR;\n+ *\n+ * The VF would interpret this as VLAN stripping can be supported on either\n+ * 0x8100 or 0x88a8 VLAN ethertypes. So when requesting VLAN stripping via\n+ * VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2 the specified ethertype will override\n+ * the previously set value.\n+ *\n+ * VIRTCHNL_VLAN_TAG_LOCATION_L2TAG1 - Used to tell the VF to insert and/or\n+ * strip the VLAN tag using the L2TAG1 field of the Tx/Rx descriptors.\n+ *\n+ * VIRTCHNL_VLAN_TAG_LOCATION_L2TAG2 - Used to tell the VF to insert hardware\n+ * offloaded VLAN tags using the L2TAG2 field of the Tx descriptor.\n+ *\n+ * VIRTCHNL_VLAN_TAG_LOCATION_L2TAG2 - Used to tell the VF to strip hardware\n+ * offloaded VLAN tags using the L2TAG2_2 field of the Rx descriptor.\n+ *\n+ * VIRTCHNL_VLAN_PRIO - This field supports VLAN priority bits. This is used for\n+ * VLAN filtering if the underlying PF supports it.\n+ *\n+ * VIRTCHNL_VLAN_TOGGLE_ALLOWED - This field is used to say whether a\n+ * certain VLAN capability can be toggled. For example if the underlying PF/CP\n+ * allows the VF to toggle VLAN filtering, stripping, and/or insertion it should\n+ * set this bit along with the supported ethertypes.\n+ */\n+enum virtchnl_vlan_support {\n+\tVIRTCHNL_VLAN_UNSUPPORTED =\t\t0,\n+\tVIRTCHNL_VLAN_ETHERTYPE_8100 =\t\t0x00000001,\n+\tVIRTCHNL_VLAN_ETHERTYPE_88A8 =\t\t0x00000002,\n+\tVIRTCHNL_VLAN_ETHERTYPE_9100 =\t\t0x00000004,\n+\tVIRTCHNL_VLAN_TAG_LOCATION_L2TAG1 =\t0x00000100,\n+\tVIRTCHNL_VLAN_TAG_LOCATION_L2TAG2 =\t0x00000200,\n+\tVIRTCHNL_VLAN_TAG_LOCATION_L2TAG2_2 =\t0x00000400,\n+\tVIRTCHNL_VLAN_PRIO =\t\t\t0x01000000,\n+\tVIRTCHNL_VLAN_FILTER_MASK =\t\t0x10000000,\n+\tVIRTCHNL_VLAN_ETHERTYPE_AND =\t\t0x20000000,\n+\tVIRTCHNL_VLAN_ETHERTYPE_XOR =\t\t0x40000000,\n+\tVIRTCHNL_VLAN_TOGGLE =\t\t\t0x80000000\n+};\n+\n+struct virtchnl_vlan_supported_caps {\n+\tu32 outer;\n+\tu32 inner;\n+};\n+\n+/* The PF populates these fields based on the supported VLAN filtering. If a\n+ * field is VIRTCHNL_VLAN_UNSUPPORTED then it's not supported and the PF will\n+ * reject any VIRTCHNL_OP_ADD_VLAN_V2 or VIRTCHNL_OP_DEL_VLAN_V2 messages using\n+ * the unsupported fields.\n+ *\n+ * Also, a VF is only allowed to toggle its VLAN filtering setting if the\n+ * VIRTCHNL_VLAN_TOGGLE_ALLOWED bit is set.\n+ *\n+ * The max_filters field tells the VF how many VLAN filters it's allowed to have\n+ * at any one time. If it exceeds this amount and tries to add another filter,\n+ * then the request will be rejected by the PF.\n+ */\n+struct virtchnl_vlan_filtering_caps {\n+\tstruct virtchnl_vlan_supported_caps filtering_support;\n+\tu32 ethertype_init;\n+\tu16 max_filters;\n+\tu8 pad[2];\n+};\n+\n+VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vlan_filtering_caps);\n+\n+/* This enum is used for the virtchnl_vlan_offload_caps structure to specify\n+ * if the PF supports a different ethertype for stripping and insertion.\n+ *\n+ * VIRTCHNL_ETHERTYPE_STRIPPING_MATCHES_INSERTION - The ethertype(s) specified\n+ * for stripping affect the ethertype(s) sepcified for insertion and visa versa\n+ * as well. If the VF tries to configure VLAN stripping via\n+ * VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2 with VIRTCHNL_VLAN_ETHERTYPE_8100 then\n+ * that will be the ethertype for both stripping and insertion.\n+ *\n+ * VIRTCHNL_ETHERTYPE_MATCH_NOT_REQUIRED - The ethertype(s) specified for\n+ * stripping do not affect the ethertype(s) specified for insertion and visa\n+ * versa.\n+ */\n+enum virtchnl_vlan_ethertype_match {\n+\tVIRTCHNL_ETHERTYPE_STRIPPING_MATCHES_INSERTION = 0,\n+\tVIRTCHNL_ETHERTYPE_MATCH_NOT_REQUIRED = 1,\n+};\n+\n+/* The PF populates these fields based on the supported VLAN offloads. If a\n+ * field is VIRTCHNL_VLAN_UNSUPPORTED then it's not supported and the PF will\n+ * reject any VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2 or\n+ * VIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2 messages using the unsupported fields.\n+ *\n+ * Also, a VF is only allowed to toggle its VLAN offload setting if the\n+ * VIRTCHNL_VLAN_TOGGLE_ALLOWED bit is set.\n+ *\n+ * The VF driver needs to be aware of how the tags are stipped by hardware and\n+ * inserted by the VF driver based on the level of offload support.\n+ *\n+ * stripping.outer supported - VLAN tag stripped into L2TAG2 field by hardware\n+ * insertion.outer supported - VLAN tag inserted into L2TAG2 field by VF driver\n+ *\n+ * stripping.inner supported - VLAN tag stripped into L2TAG1 field by hardware\n+ * insertion.inner supported - VLAN tag inserted into L2TAG1 field by VF driver\n+ */\n+struct virtchnl_vlan_offload_caps {\n+\tstruct virtchnl_vlan_supported_caps stripping_support;\n+\tstruct virtchnl_vlan_supported_caps insertion_support;\n+\tu32 ethertype_init;\n+\tu8 ethertype_match;\n+\tu8 pad[3];\n+};\n+\n+VIRTCHNL_CHECK_STRUCT_LEN(24, virtchnl_vlan_offload_caps);\n+\n+/* VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS\n+ * VF sends this message to determine its VLAN capabilities.\n+ *\n+ * PF will mark which capabilities it supports based on hardware support and\n+ * current configuration. For example, if a port VLAN is configured the PF will\n+ * not allow outer VLAN filtering, stripping, or insertion to be configured so\n+ * it will block these features from the VF.\n+ *\n+ * The VF will need to cross reference its capabilities with the PFs\n+ * capabilities in the response message from the PF to determine the VLAN\n+ * support.\n+ */\n+struct virtchnl_vlan_caps {\n+\tstruct virtchnl_vlan_filtering_caps filtering;\n+\tstruct virtchnl_vlan_offload_caps offloads;\n+};\n+\n+VIRTCHNL_CHECK_STRUCT_LEN(40, virtchnl_vlan_caps);\n+\n+struct virtchnl_vlan {\n+\tu16 tci;\t/* tci[15:13] = PCP and tci[11:0] = VID */\n+\tu16 tci_mask;\t/* only valid if VIRTCHNL_VLAN_FILTER_MASK set in filtering caps */\n+\tu16 tpid;\t/* 0x8100, 0x88a8, etc. and only type(s) set in filtering caps */\n+\tu8 pad[2];\n+};\n+\n+VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_vlan);\n+\n+struct virtchnl_vlan_filter {\n+\tstruct virtchnl_vlan inner;\n+\tstruct virtchnl_vlan outer;\n+\tu8 pad[16];\n+};\n+\n+VIRTCHNL_CHECK_STRUCT_LEN(32, virtchnl_vlan_filter);\n+\n+/* VIRTCHNL_OP_ADD_VLAN_V2\n+ * VIRTCHNL_OP_DEL_VLAN_V2\n+ *\n+ * VF sends these messages to add/del one or more VLAN tag filters for Rx traffic.\n+ *\n+ * The PF/CP attempts to add the filters and returns status.\n+ *\n+ * The VF should only ever attempt to add/del virtchnl_vlan_filter(s) using the\n+ * supported fields negotiated via VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS.\n+ */\n+struct virtchnl_vlan_filter_list_v2 {\n+\tu16 vport_id;\n+\tu16 num_elements;\n+\tu8 pad[4];\n+\tstruct virtchnl_vlan_filter filters[1];\n+};\n+\n+VIRTCHNL_CHECK_STRUCT_LEN(40, virtchnl_vlan_filter_list_v2);\n+\n+/* VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2\n+ * VIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2\n+ * VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2\n+ * VIRTCHNL_OP_DISABLE_VLAN_INSERTION_V2\n+ *\n+ * VF sends this message to enable or disable VLAN stripping or insertion. It\n+ * also needs to specify an ethertype. The VF knows which VLAN ethertypes are\n+ * allowed and whether or not it's allowed to enable/disable the specific\n+ * offload via the VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS message.\n+ *\n+ * For example, to enable or disable outer 0x8100 VLAN stripping or insertion\n+ * the VF would set outer_ethertype_setting to VIRTCHNL_VLAN_ETHERTYPE_8100 and\n+ * send one of the opcodes listed above.\n+ */\n+struct virtchnl_vlan_offload {\n+\tu16 vport_id;\n+\tu16 outer_ethertype_setting;\n+\tu16 inner_ethertype_setting;\n+\tu8 pad[2];\n+};\n+\n+VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_vlan_offload);\n+\n /* VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE\n  * VF sends VSI id and flags.\n  * PF returns status code in retval.\n@@ -1291,6 +1626,10 @@ enum virtchnl_vector_limits {\n \tVIRTCHNL_OP_MAP_UNMAP_QUEUE_VECTOR_MAX\t=\n \t\t((u16)(~0) - sizeof(struct virtchnl_queue_vector_maps)) /\n \t\tsizeof(struct virtchnl_queue_vector),\n+\n+\tVIRTCHNL_OP_ADD_DEL_VLAN_V2_MAX\t\t=\n+\t\t((u16)(~0) - sizeof(struct virtchnl_vlan_filter_list_v2)) /\n+\t\tsizeof(struct virtchnl_vlan_filter),\n };\n \n /**\n@@ -1491,6 +1830,31 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,\n \tcase VIRTCHNL_OP_QUERY_FDIR_FILTER:\n \t\tvalid_len = sizeof(struct virtchnl_fdir_query);\n \t\tbreak;\n+\tcase VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS:\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_ADD_VLAN_V2:\n+\tcase VIRTCHNL_OP_DEL_VLAN_V2:\n+\t\tvalid_len = sizeof(struct virtchnl_vlan_filter_list_v2);\n+\t\tif (msglen >= valid_len) {\n+\t\t\tstruct virtchnl_vlan_filter_list_v2 *vfl =\n+\t\t\t    (struct virtchnl_vlan_filter_list_v2 *)msg;\n+\n+\t\t\tif (vfl->num_elements == 0 || vfl->num_elements >\n+\t\t\t    VIRTCHNL_OP_ADD_DEL_VLAN_V2_MAX) {\n+\t\t\t\terr_msg_format = true;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\tvalid_len += (vfl->num_elements - 1) *\n+\t\t\t\tsizeof(struct virtchnl_vlan_filter);\n+\t\t}\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2:\n+\tcase VIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2:\n+\tcase VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2:\n+\tcase VIRTCHNL_OP_DISABLE_VLAN_INSERTION_V2:\n+\t\tvalid_len = sizeof(struct virtchnl_vlan_offload);\n+\t\tbreak;\n \tcase VIRTCHNL_OP_ENABLE_QUEUES_V2:\n \tcase VIRTCHNL_OP_DISABLE_QUEUES_V2:\n \t\tvalid_len = sizeof(struct virtchnl_del_ena_dis_queues);\n",
    "prefixes": [
        "1/3"
    ]
}