Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1313240/?format=api
{ "id": 1313240, "url": "http://patchwork.ozlabs.org/api/patches/1313240/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200619171022.9539-5-haiyue.wang@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20200619171022.9539-5-haiyue.wang@intel.com>", "list_archive_url": null, "date": "2020-06-19T17:10:21", "name": "[v2,4/5] ice: enable DDP package info querying", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "0603ab05e6f46754a1de7de6f792ce3400d92fab", "submitter": { "id": 79056, "url": "http://patchwork.ozlabs.org/api/people/79056/?format=api", "name": "Haiyue Wang", "email": "haiyue.wang@intel.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200619171022.9539-5-haiyue.wang@intel.com/mbox/", "series": [ { "id": 184628, "url": "http://patchwork.ozlabs.org/api/series/184628/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=184628", "date": "2020-06-19T17:10:17", "name": "ice: add Intel DCF mode support", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/184628/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1313240/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1313240/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Authentication-Results": [ "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.137; helo=fraxinus.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=<UNKNOWN>)", "ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 49pQXw5chbz9sWk\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 20 Jun 2020 03:20:00 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 5EC7987775;\n\tFri, 19 Jun 2020 17:19:59 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id bxQ_waStA6_B; Fri, 19 Jun 2020 17:19:58 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 163C087BD6;\n\tFri, 19 Jun 2020 17:19:58 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n by ash.osuosl.org (Postfix) with ESMTP id ABB2A1BF40D\n for <intel-wired-lan@lists.osuosl.org>; Fri, 19 Jun 2020 17:19:56 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by whitealder.osuosl.org (Postfix) with ESMTP id A85AE88E56\n for <intel-wired-lan@lists.osuosl.org>; Fri, 19 Jun 2020 17:19:56 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id jLnbwktJcyEl for <intel-wired-lan@lists.osuosl.org>;\n Fri, 19 Jun 2020 17:19:54 +0000 (UTC)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by whitealder.osuosl.org (Postfix) with ESMTPS id 8CF8B88F3D\n for <intel-wired-lan@lists.osuosl.org>; Fri, 19 Jun 2020 17:19:51 +0000 (UTC)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 19 Jun 2020 10:19:51 -0700", "from npg-dpdk-haiyue-1.sh.intel.com ([10.67.119.213])\n by fmsmga005.fm.intel.com with ESMTP; 19 Jun 2020 10:19:50 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "IronPort-SDR": [ "\n Mv2DYOOXEOdxZwGrmL3AiXFcE1TBln0J3ogB9HVy3vV1Gof6nqdzwUmb6plIe3ZsEcoS8MN9eJ\n u1NzSZe6u/3Q==", "\n mmtUqi+DC5cKlOmu6NzHp1F8WLAGaWRmenJFY90LX0FVs+zDCn/7LWo/RrUCv+n/oOjl15cLC9\n +sMbNmuLQ+2g==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9657\"; a=\"141298930\"", "E=Sophos;i=\"5.75,256,1589266800\"; d=\"scan'208\";a=\"141298930\"", "E=Sophos;i=\"5.75,256,1589266800\"; d=\"scan'208\";a=\"477702873\"" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Haiyue Wang <haiyue.wang@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Sat, 20 Jun 2020 01:10:21 +0800", "Message-Id": "<20200619171022.9539-5-haiyue.wang@intel.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20200619171022.9539-1-haiyue.wang@intel.com>", "References": "<20200619045711.16055-1-haiyue.wang@intel.com>\n <20200619171022.9539-1-haiyue.wang@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH v2 4/5] ice: enable DDP package info\n querying", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "Cc": "Ting Xu <ting.xu@intel.com>, Leyi Rong <leyi.rong@intel.com>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "Since the firmware doesn't support reading the DDP package data that PF\nis using. The DCF has to find the PF's DDP package file directly.\n\nFor searching the right DDP package that the PF uses, the DCF needs the\nDDP package characteristic information such as the PF's device serial\nnumber which is used to find the package loading path, and the exact DDP\ntrack ID, package name, version.\n\nOnly with the matched DDP package, the DCF can get the right metadata to\ncreate switch rules etc.\n\nSigned-off-by: Leyi Rong <leyi.rong@intel.com>\nSigned-off-by: Ting Xu <ting.xu@intel.com>\nSigned-off-by: Haiyue Wang <haiyue.wang@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_dcf.h | 6 +++\n drivers/net/ethernet/intel/ice/ice_main.c | 2 +\n .../net/ethernet/intel/ice/ice_virtchnl_pf.c | 52 +++++++++++++++++++\n include/linux/avf/virtchnl.h | 23 ++++++++\n 4 files changed, 83 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_dcf.h b/drivers/net/ethernet/intel/ice/ice_dcf.h\nindex 4ac639068197..3f891dfeeb46 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcf.h\n+++ b/drivers/net/ethernet/intel/ice/ice_dcf.h\n@@ -32,6 +32,12 @@ struct ice_dcf {\n \tstruct ice_aq_desc aq_desc;\n \tu8 aq_desc_received;\n \tunsigned long aq_desc_expires;\n+\n+\t/* Save the current Device Serial Number when searching the package\n+\t * path for later query.\n+\t */\n+#define ICE_DSN_NUM_LEN 8\n+\tu8 dsn[ICE_DSN_NUM_LEN];\n };\n \n #ifdef CONFIG_PCI_IOV\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex a1cef089201a..983b5e21b436 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -3243,6 +3243,8 @@ static char *ice_get_opt_fw_name(struct ice_pf *pf)\n \tsnprintf(opt_fw_filename, NAME_MAX, \"%sice-%016llx.pkg\",\n \t\t ICE_DDP_PKG_PATH, dsn);\n \n+\tmemcpy(pf->dcf.dsn, &dsn, sizeof(pf->dcf.dsn));\n+\n \treturn opt_fw_filename;\n }\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\nindex 2584c3f199e3..919f1cec784e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n@@ -3906,6 +3906,55 @@ static int ice_vc_dcf_get_vsi_map(struct ice_vf *vf)\n \treturn ret;\n }\n \n+/**\n+ * ice_vc_dcf_query_pkg_info - query DDP package info from PF\n+ * @vf: pointer to VF info\n+ *\n+ * Called from VF to query DDP package information loaded in PF,\n+ * including track ID, package name, version and device serial\n+ * number.\n+ */\n+static int ice_vc_dcf_query_pkg_info(struct ice_vf *vf)\n+{\n+\tenum virtchnl_status_code v_ret = VIRTCHNL_STATUS_SUCCESS;\n+\tstruct virtchnl_pkg_info *pkg_info = NULL;\n+\tstruct ice_hw *hw = &vf->pf->hw;\n+\tstruct ice_pf *pf = vf->pf;\n+\tint len = 0;\n+\tint ret;\n+\n+\tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n+\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n+\t\tgoto err;\n+\t}\n+\n+\tif (!ice_is_vf_dcf(vf) || ice_dcf_get_state(pf) != ICE_DCF_STATE_ON) {\n+\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n+\t\tgoto err;\n+\t}\n+\n+\tlen = sizeof(struct virtchnl_pkg_info);\n+\tpkg_info = kzalloc(len, GFP_KERNEL);\n+\tif (!pkg_info) {\n+\t\tv_ret = VIRTCHNL_STATUS_ERR_NO_MEMORY;\n+\t\tlen = 0;\n+\t\tgoto err;\n+\t}\n+\n+\tpkg_info->track_id = hw->active_track_id;\n+\tmemcpy(&pkg_info->pkg_ver, &hw->active_pkg_ver,\n+\t sizeof(pkg_info->pkg_ver));\n+\tmemcpy(pkg_info->pkg_name, hw->active_pkg_name,\n+\t sizeof(pkg_info->pkg_name));\n+\tmemcpy(pkg_info->dsn, pf->dcf.dsn, sizeof(pkg_info->dsn));\n+\n+err:\n+\tret = ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_DCF_GET_PKG_INFO,\n+\t\t\t\t v_ret, (u8 *)pkg_info, len);\n+\tkfree(pkg_info);\n+\treturn ret;\n+}\n+\n /**\n * ice_vc_process_vf_msg - Process request from VF\n * @pf: pointer to the PF structure\n@@ -4028,6 +4077,9 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event)\n \tcase VIRTCHNL_OP_DCF_GET_VSI_MAP:\n \t\terr = ice_vc_dcf_get_vsi_map(vf);\n \t\tbreak;\n+\tcase VIRTCHNL_OP_DCF_GET_PKG_INFO:\n+\t\terr = ice_vc_dcf_query_pkg_info(vf);\n+\t\tbreak;\n \tcase VIRTCHNL_OP_UNKNOWN:\n \tdefault:\n \t\tdev_err(dev, \"Unsupported opcode %d from VF %d\\n\", v_opcode,\ndiff --git a/include/linux/avf/virtchnl.h b/include/linux/avf/virtchnl.h\nindex ef07cff40662..b14ff350469b 100644\n--- a/include/linux/avf/virtchnl.h\n+++ b/include/linux/avf/virtchnl.h\n@@ -141,6 +141,7 @@ enum virtchnl_ops {\n \tVIRTCHNL_OP_DCF_CMD_BUFF = 40,\n \tVIRTCHNL_OP_DCF_DISABLE = 41,\n \tVIRTCHNL_OP_DCF_GET_VSI_MAP = 42,\n+\tVIRTCHNL_OP_DCF_GET_PKG_INFO = 43,\n \t/* New major set of opcodes introduced and so leaving room for\n \t * old misc opcodes to be added in future. Also these opcodes may only\n \t * be used if both the PF and VF have successfully negotiated the\n@@ -647,6 +648,27 @@ struct virtchnl_dcf_vsi_map {\n \n VIRTCHNL_CHECK_STRUCT_LEN(6, virtchnl_dcf_vsi_map);\n \n+#define PKG_NAME_SIZE\t32\n+#define DSN_SIZE\t8\n+\n+struct pkg_version {\n+\tu8 major;\n+\tu8 minor;\n+\tu8 update;\n+\tu8 draft;\n+};\n+\n+VIRTCHNL_CHECK_STRUCT_LEN(4, pkg_version);\n+\n+struct virtchnl_pkg_info {\n+\tstruct pkg_version pkg_ver;\n+\tu32 track_id;\n+\tchar pkg_name[PKG_NAME_SIZE];\n+\tu8 dsn[DSN_SIZE];\n+};\n+\n+VIRTCHNL_CHECK_STRUCT_LEN(48, virtchnl_pkg_info);\n+\n /* VIRTCHNL_OP_EVENT\n * PF sends this message to inform the VF driver of events that may affect it.\n * No direct response is expected from the VF, though it may generate other\n@@ -1301,6 +1323,7 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,\n \t\tbreak;\n \tcase VIRTCHNL_OP_DCF_DISABLE:\n \tcase VIRTCHNL_OP_DCF_GET_VSI_MAP:\n+\tcase VIRTCHNL_OP_DCF_GET_PKG_INFO:\n \t\tbreak;\n \tcase VIRTCHNL_OP_GET_CAPS:\n \t\tvalid_len = sizeof(struct virtchnl_get_capabilities);\n", "prefixes": [ "v2", "4/5" ] }