Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1320196/?format=api
{ "id": 1320196, "url": "http://patchwork.ozlabs.org/api/patches/1320196/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200701012557.40234-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": "<20200701012557.40234-5-haiyue.wang@intel.com>", "list_archive_url": null, "date": "2020-07-01T01:25:56", "name": "[net-next,v7,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": 109701, "url": "http://patchwork.ozlabs.org/api/users/109701/?format=api", "username": "anguy11", "first_name": "Anthony", "last_name": "Nguyen", "email": "anthony.l.nguyen@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200701012557.40234-5-haiyue.wang@intel.com/mbox/", "series": [ { "id": 186808, "url": "http://patchwork.ozlabs.org/api/series/186808/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=186808", "date": "2020-07-01T01:25:52", "name": "ice: add Intel DCF mode support", "version": 7, "mbox": "http://patchwork.ozlabs.org/series/186808/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1320196/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1320196/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.133; helo=hemlock.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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 49xP234bbZz9sQt\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 1 Jul 2020 11:35:55 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 77DA788A0E;\n\tWed, 1 Jul 2020 01:35:53 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 3O4AyeJhbyPM; Wed, 1 Jul 2020 01:35:51 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 2912188A1F;\n\tWed, 1 Jul 2020 01:35:51 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n by ash.osuosl.org (Postfix) with ESMTP id D6B011BF34E\n for <intel-wired-lan@lists.osuosl.org>; Wed, 1 Jul 2020 01:35:47 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by fraxinus.osuosl.org (Postfix) with ESMTP id D38F8877FC\n for <intel-wired-lan@lists.osuosl.org>; Wed, 1 Jul 2020 01:35:47 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id Zfx70xS_SRro for <intel-wired-lan@lists.osuosl.org>;\n Wed, 1 Jul 2020 01:35:45 +0000 (UTC)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by fraxinus.osuosl.org (Postfix) with ESMTPS id C90DB87806\n for <intel-wired-lan@lists.osuosl.org>; Wed, 1 Jul 2020 01:35:45 +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 30 Jun 2020 18:35:44 -0700", "from npg-dpdk-haiyue-1.sh.intel.com ([10.67.119.213])\n by fmsmga005.fm.intel.com with ESMTP; 30 Jun 2020 18:35:43 -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 kJb8poYF60nt7EWPQCB59CK14X0yvFX2dWLfm5fYqsFpeXrpkCnM6U3qzRHUd6+vw2I9wF1UYa\n s01z3BYxiEVg==", "\n gxcRaqYik/mXKzUWblj3nmoJx1UF91yCyfDwOX5H5bmCeDQlCezt7IwpXiWyryi2S/RjVlegAk\n iwkudMH69yEQ==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9668\"; a=\"144601248\"", "E=Sophos;i=\"5.75,298,1589266800\"; d=\"scan'208\";a=\"144601248\"", "E=Sophos;i=\"5.75,298,1589266800\"; d=\"scan'208\";a=\"481399982\"" ], "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": "Wed, 1 Jul 2020 09:25:56 +0800", "Message-Id": "<20200701012557.40234-5-haiyue.wang@intel.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20200701012557.40234-1-haiyue.wang@intel.com>", "References": "<20200619045711.16055-1-haiyue.wang@intel.com>\n <20200701012557.40234-1-haiyue.wang@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [net-next,\n v7 4/5] ice: enable DDP package info 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 1dabcca6f753..1ca228f89a19 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": [ "net-next", "v7", "4/5" ] }