Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/86941/?format=api
http://patchwork.dpdk.org/api/patches/86941/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210120011039.164462-1-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": "<20210120011039.164462-1-haiyue.wang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210120011039.164462-1-haiyue.wang@intel.com", "date": "2021-01-20T01:10:39", "name": "[v1] net/iavf: rename the VLAN offload virtchnl message", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "0d66b3ce713249db8c7a27e6584dc12bc81cfa6f", "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/20210120011039.164462-1-haiyue.wang@intel.com/mbox/", "series": [ { "id": 14853, "url": "http://patchwork.dpdk.org/api/series/14853/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=14853", "date": "2021-01-20T01:10:39", "name": "[v1] net/iavf: rename the VLAN offload virtchnl message", "version": 1, "mbox": "http://patchwork.dpdk.org/series/14853/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/86941/comments/", "check": "warning", "checks": "http://patchwork.dpdk.org/api/patches/86941/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 80585A0A05;\n\tWed, 20 Jan 2021 02:26:48 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E38AC140E3B;\n\tWed, 20 Jan 2021 02:26:47 +0100 (CET)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id 9A617140E37\n for <dev@dpdk.org>; Wed, 20 Jan 2021 02:26:45 +0100 (CET)", "from orsmga008.jf.intel.com ([10.7.209.65])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 19 Jan 2021 17:26:42 -0800", "from npg-dpdk-haiyue-3.sh.intel.com ([10.67.118.189])\n by orsmga008.jf.intel.com with ESMTP; 19 Jan 2021 17:26:40 -0800" ], "IronPort-SDR": [ "\n z61MVENjbWWIgrT4HP8lNEVrEBm/fuvw/KiCTCi8abDB6G+nggN4w4yT695jxpiFhW477VVg8M\n CQAqtCODbAfw==", "\n n+SfGWb9K+0f8sdNmEdtL9lOK/0l7ava4TVQecSQt9U1bZgmoMiNT1vOIP31t0zE43L3FHHjHc\n bnFflrUn076A==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9869\"; a=\"176455103\"", "E=Sophos;i=\"5.79,359,1602572400\"; d=\"scan'208\";a=\"176455103\"", "E=Sophos;i=\"5.79,359,1602572400\"; d=\"scan'208\";a=\"384162244\"" ], "X-ExtLoop1": "1", "From": "Haiyue Wang <haiyue.wang@intel.com>", "To": "dev@dpdk.org", "Cc": "qiming.yang@intel.com, qi.z.zhang@intel.com, qi.fu@intel.com,\n Haiyue Wang <haiyue.wang@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,\n Beilei Xing <beilei.xing@intel.com>", "Date": "Wed, 20 Jan 2021 09:10:39 +0800", "Message-Id": "<20210120011039.164462-1-haiyue.wang@intel.com>", "X-Mailer": "git-send-email 2.30.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v1] net/iavf: rename the VLAN offload virtchnl\n message", "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": "Rename the VLAN offload message to make the virtchnl support one more\nfiltering offload, the name is straightforward.\n\nSigned-off-by: Haiyue Wang <haiyue.wang@intel.com>\n---\n drivers/common/iavf/virtchnl.h | 67 ++++++++++++++++++++++++++++------\n drivers/net/iavf/iavf_vchnl.c | 36 +++++++++---------\n 2 files changed, 74 insertions(+), 29 deletions(-)", "diff": "diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h\nindex 09e42f034c..6b99e170f0 100644\n--- a/drivers/common/iavf/virtchnl.h\n+++ b/drivers/common/iavf/virtchnl.h\n@@ -149,6 +149,8 @@ enum virtchnl_ops {\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_VLAN_FILTERING_V2 = 58,\n+\tVIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2 = 59,\n \tVIRTCHNL_OP_ENABLE_QUEUES_V2 = 107,\n \tVIRTCHNL_OP_DISABLE_QUEUES_V2 = 108,\n \tVIRTCHNL_OP_MAP_QUEUE_VECTOR = 111,\n@@ -258,6 +260,10 @@ static inline const char *virtchnl_op_str(enum virtchnl_ops v_opcode)\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_ENABLE_VLAN_FILTERING_V2:\n+\t\treturn \"VIRTCHNL_OP_ENABLE_VLAN_FILTERING_V2\";\n+\tcase VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2:\n+\t\treturn \"VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2\";\n \tcase VIRTCHNL_OP_MAX:\n \t\treturn \"VIRTCHNL_OP_MAX\";\n \tdefault:\n@@ -914,13 +920,13 @@ VIRTCHNL_CHECK_STRUCT_LEN(40, virtchnl_vlan_filter_list_v2);\n *\n * In order to enable inner (again note that in this case inner is the outer\n * most or single VLAN from the VF's perspective) VLAN stripping for 0x8100\n- * VLANs, the VF would populate the virtchnl_vlan_offload structure in the\n+ * VLANs, the VF would populate the virtchnl_vlan_setting structure in the\n * following manner and send the VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2 message.\n *\n- * virtchnl_vlan_offload.inner_ethertype_setting =\n+ * virtchnl_vlan_setting.inner_ethertype_setting =\n *\t\t\tVIRTCHNL_VLAN_ETHERTYPE_8100;\n *\n- * virtchnl_vlan_offload.vport_id = vport_id or vsi_id assigned to the VF on\n+ * virtchnl_vlan_setting.vport_id = vport_id or vsi_id assigned to the VF on\n * initialization.\n *\n * The reason that VLAN TPID(s) are not being used for the\n@@ -952,11 +958,11 @@ VIRTCHNL_CHECK_STRUCT_LEN(40, virtchnl_vlan_filter_list_v2);\n * would populate the virthcnl_vlan_offload_structure in the following manner\n * and send the VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2 message.\n *\n- * virtchnl_vlan_offload.outer_ethertype_setting =\n+ * virtchnl_vlan_setting.outer_ethertype_setting =\n *\t\t\tVIRTHCNL_VLAN_ETHERTYPE_8100 |\n *\t\t\tVIRTHCNL_VLAN_ETHERTYPE_88A8;\n *\n- * virtchnl_vlan_offload.vport_id = vport_id or vsi_id assigned to the VF on\n+ * virtchnl_vlan_setting.vport_id = vport_id or vsi_id assigned to the VF on\n * initialization.\n *\n * There is also the case where a PF and the underlying hardware can support\n@@ -981,24 +987,61 @@ VIRTCHNL_CHECK_STRUCT_LEN(40, virtchnl_vlan_filter_list_v2);\n *\t\t\tVIRTCHNL_ETHERTYPE_STRIPPING_MATCHES_INSERTION;\n *\n * In order to enable outer VLAN stripping for 0x88a8 VLANs, the VF would\n- * populate the virtchnl_vlan_offload_structure in the following manner and send\n+ * populate the virtchnl_vlan_setting structure in the following manner and send\n * the VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2. Also, this will change the\n * ethertype for VLAN insertion if it's enabled. So, for completeness, a\n * VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2 with the same ethertype should be sent.\n *\n- * virtchnl_vlan_offload.outer_ethertype_setting = VIRTHCNL_VLAN_ETHERTYPE_88A8;\n+ * virtchnl_vlan_setting.outer_ethertype_setting = VIRTHCNL_VLAN_ETHERTYPE_88A8;\n *\n- * virtchnl_vlan_offload.vport_id = vport_id or vsi_id assigned to the VF on\n+ * virtchnl_vlan_setting.vport_id = vport_id or vsi_id assigned to the VF on\n * initialization.\n+ *\n+ * VIRTCHNL_OP_ENABLE_VLAN_FILTERING_V2\n+ * VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2\n+ *\n+ * VF sends this message to enable or disable VLAN filtering. It also needs to\n+ * specify an ethertype. The VF knows which VLAN ethertypes are allowed and\n+ * whether or not it's allowed to enable/disable filtering via the\n+ * VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS message. The VF needs to\n+ * parse the virtchnl_vlan_caps.filtering fields to determine which, if any,\n+ * filtering messages are allowed.\n+ *\n+ * For example, if the PF populates the virtchnl_vlan_caps.filtering in the\n+ * following manner the VF will be allowed to enable/disable 0x8100 and 0x88a8\n+ * outer VLAN filtering together. Note, that the VIRTCHNL_VLAN_ETHERTYPE_AND\n+ * means that all filtering ethertypes will to be enabled and disabled together\n+ * regardless of the request from the VF. This means that the underlying\n+ * hardware only supports VLAN filtering for all VLAN the specified ethertypes\n+ * or none of them.\n+ *\n+ * virtchnl_vlan_caps.filtering.filtering_support.outer =\n+ *\t\t\tVIRTCHNL_VLAN_TOGGLE |\n+ *\t\t\tVIRTCHNL_VLAN_ETHERTYPE_8100 |\n+ *\t\t\tVIRTHCNL_VLAN_ETHERTYPE_88A8 |\n+ *\t\t\tVIRTCHNL_VLAN_ETHERTYPE_9100 |\n+ *\t\t\tVIRTCHNL_VLAN_ETHERTYPE_AND;\n+ *\n+ * In order to enable outer VLAN filtering for 0x88a8 and 0x8100 VLANs (0x9100\n+ * VLANs aren't supported by the VF driver), the VF would populate the\n+ * virtchnl_vlan_setting structure in the following manner and send the\n+ * VIRTCHNL_OP_ENABLE_VLAN_FILTERING_V2. The same message format would be used\n+ * to disable outer VLAN filtering for 0x88a8 and 0x8100 VLANs, but the\n+ * VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2 opcode is used.\n+ *\n+ * virtchnl_vlan_setting.outer_ethertype_setting =\n+ *\t\t\tVIRTCHNL_VLAN_ETHERTYPE_8100 |\n+ *\t\t\tVIRTCHNL_VLAN_ETHERTYPE_88A8;\n+ *\n */\n-struct virtchnl_vlan_offload {\n+struct virtchnl_vlan_setting {\n \tu32 outer_ethertype_setting;\n \tu32 inner_ethertype_setting;\n \tu16 vport_id;\n \tu8 pad[6];\n };\n \n-VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vlan_offload);\n+VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vlan_setting);\n \n /* VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE\n * VF sends VSI id and flags.\n@@ -2017,7 +2060,9 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,\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+\tcase VIRTCHNL_OP_ENABLE_VLAN_FILTERING_V2:\n+\tcase VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2:\n+\t\tvalid_len = sizeof(struct virtchnl_vlan_setting);\n \t\tbreak;\n \tcase VIRTCHNL_OP_ENABLE_QUEUES_V2:\n \tcase VIRTCHNL_OP_DISABLE_QUEUES_V2:\ndiff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c\nindex 3ef29d509d..27eb59ad91 100644\n--- a/drivers/net/iavf/iavf_vchnl.c\n+++ b/drivers/net/iavf/iavf_vchnl.c\n@@ -529,32 +529,32 @@ 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 virtchnl_vlan_setting vlan_strip_setting;\n \tstruct iavf_cmd_info args;\n \tuint32_t stripping_caps;\n-\tuint32_t *vlan_setting;\n+\tuint32_t *ethertype;\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\tethertype = &vlan_strip_setting.outer_ethertype_setting;\n \t} else {\n \t\tstripping_caps = supported_caps->inner;\n-\t\tvlan_setting = &vlan_strip.inner_ethertype_setting;\n+\t\tethertype = &vlan_strip_setting.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+\tmemset(&vlan_strip_setting, 0, sizeof(vlan_strip_setting));\n+\tvlan_strip_setting.vport_id = vf->vsi_res->vsi_id;\n+\t*ethertype = 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.in_args = (uint8_t *)&vlan_strip_setting;\n+\targs.in_args_size = sizeof(vlan_strip_setting);\n \targs.out_buffer = vf->aq_resp;\n \targs.out_size = IAVF_AQ_BUF_SZ;\n \tret = iavf_execute_vf_cmd(adapter, &args);\n@@ -571,32 +571,32 @@ 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 virtchnl_vlan_setting vlan_insert_setting;\n \tstruct iavf_cmd_info args;\n \tuint32_t insertion_caps;\n-\tuint32_t *vlan_setting;\n+\tuint32_t *ethertype;\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\tethertype = &vlan_insert_setting.outer_ethertype_setting;\n \t} else {\n \t\tinsertion_caps = supported_caps->inner;\n-\t\tvlan_setting = &vlan_insert.inner_ethertype_setting;\n+\t\tethertype = &vlan_insert_setting.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+\tmemset(&vlan_insert_setting, 0, sizeof(vlan_insert_setting));\n+\tvlan_insert_setting.vport_id = vf->vsi_res->vsi_id;\n+\t*ethertype = 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.in_args = (uint8_t *)&vlan_insert_setting;\n+\targs.in_args_size = sizeof(vlan_insert_setting);\n \targs.out_buffer = vf->aq_resp;\n \targs.out_size = IAVF_AQ_BUF_SZ;\n \tret = iavf_execute_vf_cmd(adapter, &args);\n", "prefixes": [ "v1" ] }{ "id": 86941, "url": "