get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 86389,
    "url": "http://patchwork.dpdk.org/api/patches/86389/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210112081302.87715-4-haiyue.wang@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20210112081302.87715-4-haiyue.wang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210112081302.87715-4-haiyue.wang@intel.com",
    "date": "2021-01-12T08:13:02",
    "name": "[v6,3/3] net/iavf: implement new VLAN capability handling",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a5dbc06f30ca9e710a9ae0ed3afdcb50d5ed070e",
    "submitter": {
        "id": 1044,
        "url": "http://patchwork.dpdk.org/api/people/1044/?format=api",
        "name": "Wang, Haiyue",
        "email": "haiyue.wang@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patchwork.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20210112081302.87715-4-haiyue.wang@intel.com/mbox/",
    "series": [
        {
            "id": 14664,
            "url": "http://patchwork.dpdk.org/api/series/14664/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=14664",
            "date": "2021-01-12T08:12:59",
            "name": "Add AVF & DCF VLAN feaure",
            "version": 6,
            "mbox": "http://patchwork.dpdk.org/series/14664/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/86389/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/86389/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 (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C98DAA04B5;\n\tTue, 12 Jan 2021 09:29:04 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 013BF140D61;\n\tTue, 12 Jan 2021 09:28:49 +0100 (CET)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by mails.dpdk.org (Postfix) with ESMTP id E4FAE140D5C\n for <dev@dpdk.org>; Tue, 12 Jan 2021 09:28:46 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 12 Jan 2021 00:28:46 -0800",
            "from npg-dpdk-haiyue-3.sh.intel.com ([10.67.118.237])\n by fmsmga001.fm.intel.com with ESMTP; 12 Jan 2021 00:28:44 -0800"
        ],
        "IronPort-SDR": [
            "\n EUJEnfcL02siU1q8cg+3qUW4vm2iex+L+MUwxsA+bY3AGpIVn1jAa0kDiojjGrH3TCLV849arB\n B+4fYbcY2rpQ==",
            "\n JujiR0cKhJTUqtE4zR+AKNSqaCBn0OELC8grCTQElWF2qlqerUSZXWaiqkIE+8Gi1GzxK0iU0b\n 3+iBUB9MnFcw=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9861\"; a=\"262788611\"",
            "E=Sophos;i=\"5.79,340,1602572400\"; d=\"scan'208\";a=\"262788611\"",
            "E=Sophos;i=\"5.79,340,1602572400\"; d=\"scan'208\";a=\"464443652\""
        ],
        "X-ExtLoop1": "1",
        "From": "Haiyue Wang <haiyue.wang@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qiming.yang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com,\n qi.z.zhang@intel.com, qi.fu@intel.com, Haiyue Wang <haiyue.wang@intel.com>",
        "Date": "Tue, 12 Jan 2021 16:13:02 +0800",
        "Message-Id": "<20210112081302.87715-4-haiyue.wang@intel.com>",
        "X-Mailer": "git-send-email 2.30.0",
        "In-Reply-To": "<20210112081302.87715-1-haiyue.wang@intel.com>",
        "References": "<20201214071155.98764-1-haiyue.wang@intel.com>\n <20210112081302.87715-1-haiyue.wang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v6 3/3] net/iavf: implement new VLAN capability\n handling",
        "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": "The new VLAN virtchnl opcodes introduce new capabilities like VLAN\nfiltering, stripping and insertion.\n\nThe AVF needs to query the VLAN capabilities based on current device\nconfiguration firstly.\n\nAVF is able to configure inner VLAN filter when port VLAN is enabled\nbase on negotiation; and AVF is able to configure outer VLAN (0x8100)\nif port VLAN is disabled to be compatible with legacy mode.\n\nWhen port VLAN is updated by DCF, the AVF needs to reset to query the\nnew VLAN capabilities.\n\nSigned-off-by: Qiming Yang <qiming.yang@intel.com>\nSigned-off-by: Haiyue Wang <haiyue.wang@intel.com>\n---\n drivers/net/iavf/iavf.h        |   6 ++\n drivers/net/iavf/iavf_ethdev.c | 117 +++++++++++++++++++++++--\n drivers/net/iavf/iavf_vchnl.c  | 153 +++++++++++++++++++++++++++++++++\n 3 files changed, 269 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h\nindex 9754273b2..af11268fe 100644\n--- a/drivers/net/iavf/iavf.h\n+++ b/drivers/net/iavf/iavf.h\n@@ -139,6 +139,7 @@ struct iavf_info {\n \tstruct virtchnl_version_info virtchnl_version;\n \tstruct virtchnl_vf_resource *vf_res; /* VF resource */\n \tstruct virtchnl_vsi_resource *vsi_res; /* LAN VSI */\n+\tstruct virtchnl_vlan_caps vlan_v2_caps;\n \tuint64_t supported_rxdid;\n \tuint8_t *proto_xtr; /* proto xtr type for all queues */\n \tvolatile enum virtchnl_ops pend_cmd; /* pending command not finished */\n@@ -310,6 +311,11 @@ int iavf_configure_rss_key(struct iavf_adapter *adapter);\n int iavf_configure_queues(struct iavf_adapter *adapter,\n \t\t\tuint16_t num_queue_pairs, uint16_t index);\n int iavf_get_supported_rxdid(struct iavf_adapter *adapter);\n+int iavf_config_vlan_strip_v2(struct iavf_adapter *adapter, bool enable);\n+int iavf_config_vlan_insert_v2(struct iavf_adapter *adapter, bool enable);\n+int iavf_add_del_vlan_v2(struct iavf_adapter *adapter, uint16_t vlanid,\n+\t\t\t bool add);\n+int iavf_get_vlan_offload_caps_v2(struct iavf_adapter *adapter);\n int iavf_config_irq_map(struct iavf_adapter *adapter);\n int iavf_config_irq_map_lv(struct iavf_adapter *adapter, uint16_t num,\n \t\t\tuint16_t index);\ndiff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c\nindex 49e6dd125..e22c62ed0 100644\n--- a/drivers/net/iavf/iavf_ethdev.c\n+++ b/drivers/net/iavf/iavf_ethdev.c\n@@ -326,13 +326,52 @@ iavf_queues_req_reset(struct rte_eth_dev *dev, uint16_t num)\n \treturn 0;\n }\n \n+static int\n+iavf_dev_vlan_insert_set(struct rte_eth_dev *dev)\n+{\n+\tstruct iavf_adapter *adapter =\n+\t\tIAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);\n+\tbool enable;\n+\n+\tif (!(vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN_V2))\n+\t\treturn 0;\n+\n+\tenable = !!(dev->data->dev_conf.txmode.offloads &\n+\t\t    DEV_TX_OFFLOAD_VLAN_INSERT);\n+\tiavf_config_vlan_insert_v2(adapter, enable);\n+\n+\treturn 0;\n+}\n+\n+static int\n+iavf_dev_init_vlan(struct rte_eth_dev *dev)\n+{\n+\tint err;\n+\n+\terr = iavf_dev_vlan_offload_set(dev,\n+\t\t\t\t\tETH_VLAN_STRIP_MASK |\n+\t\t\t\t\tETH_QINQ_STRIP_MASK |\n+\t\t\t\t\tETH_VLAN_FILTER_MASK |\n+\t\t\t\t\tETH_VLAN_EXTEND_MASK);\n+\tif (err) {\n+\t\tPMD_DRV_LOG(ERR, \"Failed to update vlan offload\");\n+\t\treturn err;\n+\t}\n+\n+\terr = iavf_dev_vlan_insert_set(dev);\n+\tif (err)\n+\t\tPMD_DRV_LOG(ERR, \"Failed to update vlan insertion\");\n+\n+\treturn err;\n+}\n+\n static int\n iavf_dev_configure(struct rte_eth_dev *dev)\n {\n \tstruct iavf_adapter *ad =\n \t\tIAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n \tstruct iavf_info *vf =  IAVF_DEV_PRIVATE_TO_VF(ad);\n-\tstruct rte_eth_conf *dev_conf = &dev->data->dev_conf;\n \tuint16_t num_queue_pairs = RTE_MAX(dev->data->nb_rx_queues,\n \t\tdev->data->nb_tx_queues);\n \tint ret;\n@@ -389,12 +428,10 @@ iavf_dev_configure(struct rte_eth_dev *dev)\n \t\tvf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;\n \t}\n \n-\t/* Vlan stripping setting */\n-\tif (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {\n-\t\tif (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)\n-\t\t\tiavf_enable_vlan_strip(ad);\n-\t\telse\n-\t\t\tiavf_disable_vlan_strip(ad);\n+\tret = iavf_dev_init_vlan(dev);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR, \"configure VLAN failed: %d\", ret);\n+\t\treturn -1;\n \t}\n \n \tif (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) {\n@@ -784,6 +821,7 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)\n \t\tDEV_RX_OFFLOAD_JUMBO_FRAME |\n \t\tDEV_RX_OFFLOAD_VLAN_FILTER |\n \t\tDEV_RX_OFFLOAD_RSS_HASH;\n+\n \tdev_info->tx_offload_capa =\n \t\tDEV_TX_OFFLOAD_VLAN_INSERT |\n \t\tDEV_TX_OFFLOAD_QINQ_INSERT |\n@@ -997,6 +1035,13 @@ iavf_dev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)\n \tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);\n \tint err;\n \n+\tif (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN_V2) {\n+\t\terr = iavf_add_del_vlan_v2(adapter, vlan_id, on);\n+\t\tif (err)\n+\t\t\treturn -EIO;\n+\t\treturn 0;\n+\t}\n+\n \tif (!(vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN))\n \t\treturn -ENOTSUP;\n \n@@ -1006,6 +1051,54 @@ iavf_dev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)\n \treturn 0;\n }\n \n+static void\n+iavf_iterate_vlan_filters_v2(struct rte_eth_dev *dev, bool enable)\n+{\n+\tstruct rte_vlan_filter_conf *vfc = &dev->data->vlan_filter_conf;\n+\tstruct iavf_adapter *adapter =\n+\t\tIAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n+\tuint32_t i, j;\n+\tuint64_t ids;\n+\n+\tfor (i = 0; i < RTE_DIM(vfc->ids); i++) {\n+\t\tif (vfc->ids[i] == 0)\n+\t\t\tcontinue;\n+\n+\t\tids = vfc->ids[i];\n+\t\tfor (j = 0; ids != 0 && j < 64; j++, ids >>= 1) {\n+\t\t\tif (ids & 1)\n+\t\t\t\tiavf_add_del_vlan_v2(adapter,\n+\t\t\t\t\t\t     64 * i + j, enable);\n+\t\t}\n+\t}\n+}\n+\n+static int\n+iavf_dev_vlan_offload_set_v2(struct rte_eth_dev *dev, int mask)\n+{\n+\tstruct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;\n+\tstruct iavf_adapter *adapter =\n+\t\tIAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n+\tbool enable;\n+\tint err;\n+\n+\tif (mask & ETH_VLAN_FILTER_MASK) {\n+\t\tenable = !!(rxmode->offloads & DEV_RX_OFFLOAD_VLAN_FILTER);\n+\n+\t\tiavf_iterate_vlan_filters_v2(dev, enable);\n+\t}\n+\n+\tif (mask & ETH_VLAN_STRIP_MASK) {\n+\t\tenable = !!(rxmode->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);\n+\n+\t\terr = iavf_config_vlan_strip_v2(adapter, enable);\n+\t\tif (err)\n+\t\t\treturn -EIO;\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int\n iavf_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask)\n {\n@@ -1015,6 +1108,9 @@ iavf_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask)\n \tstruct rte_eth_conf *dev_conf = &dev->data->dev_conf;\n \tint err;\n \n+\tif (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN_V2)\n+\t\treturn iavf_dev_vlan_offload_set_v2(dev, mask);\n+\n \tif (!(vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN))\n \t\treturn -ENOTSUP;\n \n@@ -1898,6 +1994,13 @@ iavf_init_vf(struct rte_eth_dev *dev)\n \t\t}\n \t}\n \n+\tif (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN_V2) {\n+\t\tif (iavf_get_vlan_offload_caps_v2(adapter) != 0) {\n+\t\t\tPMD_INIT_LOG(ERR, \"failed to do get VLAN offload v2 capabilities\");\n+\t\t\tgoto err_rss;\n+\t\t}\n+\t}\n+\n \tiavf_init_proto_xtr(dev);\n \n \treturn 0;\ndiff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c\nindex c33194cdc..3ef29d509 100644\n--- a/drivers/net/iavf/iavf_vchnl.c\n+++ b/drivers/net/iavf/iavf_vchnl.c\n@@ -174,6 +174,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)\n \tcase VIRTCHNL_OP_VERSION:\n \tcase VIRTCHNL_OP_GET_VF_RESOURCES:\n \tcase VIRTCHNL_OP_GET_SUPPORTED_RXDIDS:\n+\tcase VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS:\n \t\t/* for init virtchnl ops, need to poll the response */\n \t\tdo {\n \t\t\tresult = iavf_read_msg_from_pf(adapter, args->out_size,\n@@ -459,6 +460,7 @@ iavf_get_vf_resource(struct iavf_adapter *adapter)\n \t\tVIRTCHNL_VF_OFFLOAD_ADV_RSS_PF |\n \t\tVIRTCHNL_VF_OFFLOAD_REQ_QUEUES |\n \t\tVIRTCHNL_VF_OFFLOAD_CRC |\n+\t\tVIRTCHNL_VF_OFFLOAD_VLAN_V2 |\n \t\tVIRTCHNL_VF_LARGE_NUM_QPAIRS;\n \n \targs.in_args = (uint8_t *)&caps;\n@@ -522,6 +524,157 @@ iavf_get_supported_rxdid(struct iavf_adapter *adapter)\n \treturn 0;\n }\n \n+int\n+iavf_config_vlan_strip_v2(struct iavf_adapter *adapter, bool enable)\n+{\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);\n+\tstruct virtchnl_vlan_supported_caps *supported_caps;\n+\tstruct virtchnl_vlan_offload vlan_strip;\n+\tstruct iavf_cmd_info args;\n+\tuint32_t stripping_caps;\n+\tuint32_t *vlan_setting;\n+\tint ret;\n+\n+\tsupported_caps = &vf->vlan_v2_caps.offloads.stripping_support;\n+\tif (supported_caps->outer) {\n+\t\tstripping_caps = supported_caps->outer;\n+\t\tvlan_setting = &vlan_strip.outer_ethertype_setting;\n+\t} else {\n+\t\tstripping_caps = supported_caps->inner;\n+\t\tvlan_setting = &vlan_strip.inner_ethertype_setting;\n+\t}\n+\n+\tif (!(stripping_caps & VIRTCHNL_VLAN_ETHERTYPE_8100))\n+\t\treturn -ENOTSUP;\n+\n+\tmemset(&vlan_strip, 0, sizeof(vlan_strip));\n+\tvlan_strip.vport_id = vf->vsi_res->vsi_id;\n+\t*vlan_setting = VIRTCHNL_VLAN_ETHERTYPE_8100;\n+\n+\targs.ops = enable ? VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2 :\n+\t\t\t    VIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2;\n+\targs.in_args = (uint8_t *)&vlan_strip;\n+\targs.in_args_size = sizeof(vlan_strip);\n+\targs.out_buffer = vf->aq_resp;\n+\targs.out_size = IAVF_AQ_BUF_SZ;\n+\tret = iavf_execute_vf_cmd(adapter, &args);\n+\tif (ret)\n+\t\tPMD_DRV_LOG(ERR, \"fail to execute command %s\",\n+\t\t\t    enable ? \"VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2\" :\n+\t\t\t\t     \"VIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2\");\n+\n+\treturn ret;\n+}\n+\n+int\n+iavf_config_vlan_insert_v2(struct iavf_adapter *adapter, bool enable)\n+{\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);\n+\tstruct virtchnl_vlan_supported_caps *supported_caps;\n+\tstruct virtchnl_vlan_offload vlan_insert;\n+\tstruct iavf_cmd_info args;\n+\tuint32_t insertion_caps;\n+\tuint32_t *vlan_setting;\n+\tint ret;\n+\n+\tsupported_caps = &vf->vlan_v2_caps.offloads.insertion_support;\n+\tif (supported_caps->outer) {\n+\t\tinsertion_caps = supported_caps->outer;\n+\t\tvlan_setting = &vlan_insert.outer_ethertype_setting;\n+\t} else {\n+\t\tinsertion_caps = supported_caps->inner;\n+\t\tvlan_setting = &vlan_insert.inner_ethertype_setting;\n+\t}\n+\n+\tif (!(insertion_caps & VIRTCHNL_VLAN_ETHERTYPE_8100))\n+\t\treturn -ENOTSUP;\n+\n+\tmemset(&vlan_insert, 0, sizeof(vlan_insert));\n+\tvlan_insert.vport_id = vf->vsi_res->vsi_id;\n+\t*vlan_setting = VIRTCHNL_VLAN_ETHERTYPE_8100;\n+\n+\targs.ops = enable ? VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2 :\n+\t\t\t    VIRTCHNL_OP_DISABLE_VLAN_INSERTION_V2;\n+\targs.in_args = (uint8_t *)&vlan_insert;\n+\targs.in_args_size = sizeof(vlan_insert);\n+\targs.out_buffer = vf->aq_resp;\n+\targs.out_size = IAVF_AQ_BUF_SZ;\n+\tret = iavf_execute_vf_cmd(adapter, &args);\n+\tif (ret)\n+\t\tPMD_DRV_LOG(ERR, \"fail to execute command %s\",\n+\t\t\t    enable ? \"VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2\" :\n+\t\t\t\t     \"VIRTCHNL_OP_DISABLE_VLAN_INSERTION_V2\");\n+\n+\treturn ret;\n+}\n+\n+int\n+iavf_add_del_vlan_v2(struct iavf_adapter *adapter, uint16_t vlanid, bool add)\n+{\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);\n+\tstruct virtchnl_vlan_supported_caps *supported_caps;\n+\tstruct virtchnl_vlan_filter_list_v2 vlan_filter;\n+\tstruct virtchnl_vlan *vlan_setting;\n+\tstruct iavf_cmd_info args;\n+\tuint32_t filtering_caps;\n+\tint err;\n+\n+\tsupported_caps = &vf->vlan_v2_caps.filtering.filtering_support;\n+\tif (supported_caps->outer) {\n+\t\tfiltering_caps = supported_caps->outer;\n+\t\tvlan_setting = &vlan_filter.filters[0].outer;\n+\t} else {\n+\t\tfiltering_caps = supported_caps->inner;\n+\t\tvlan_setting = &vlan_filter.filters[0].inner;\n+\t}\n+\n+\tif (!(filtering_caps & VIRTCHNL_VLAN_ETHERTYPE_8100))\n+\t\treturn -ENOTSUP;\n+\n+\tmemset(&vlan_filter, 0, sizeof(vlan_filter));\n+\tvlan_filter.vport_id = vf->vsi_res->vsi_id;\n+\tvlan_filter.num_elements = 1;\n+\tvlan_setting->tpid = RTE_ETHER_TYPE_VLAN;\n+\tvlan_setting->tci = vlanid;\n+\n+\targs.ops = add ? VIRTCHNL_OP_ADD_VLAN_V2 : VIRTCHNL_OP_DEL_VLAN_V2;\n+\targs.in_args = (uint8_t *)&vlan_filter;\n+\targs.in_args_size = sizeof(vlan_filter);\n+\targs.out_buffer = vf->aq_resp;\n+\targs.out_size = IAVF_AQ_BUF_SZ;\n+\terr = iavf_execute_vf_cmd(adapter, &args);\n+\tif (err)\n+\t\tPMD_DRV_LOG(ERR, \"fail to execute command %s\",\n+\t\t\t    add ? \"OP_ADD_VLAN_V2\" :  \"OP_DEL_VLAN_V2\");\n+\n+\treturn err;\n+}\n+\n+int\n+iavf_get_vlan_offload_caps_v2(struct iavf_adapter *adapter)\n+{\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);\n+\tstruct iavf_cmd_info args;\n+\tint ret;\n+\n+\targs.ops = VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS;\n+\targs.in_args = NULL;\n+\targs.in_args_size = 0;\n+\targs.out_buffer = vf->aq_resp;\n+\targs.out_size = IAVF_AQ_BUF_SZ;\n+\n+\tret = iavf_execute_vf_cmd(adapter, &args);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR,\n+\t\t\t    \"Failed to execute command of VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS\");\n+\t\treturn ret;\n+\t}\n+\n+\trte_memcpy(&vf->vlan_v2_caps, vf->aq_resp, sizeof(vf->vlan_v2_caps));\n+\n+\treturn 0;\n+}\n+\n int\n iavf_enable_queues(struct iavf_adapter *adapter)\n {\n",
    "prefixes": [
        "v6",
        "3/3"
    ]
}