Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1283978/?format=api
{ "id": 1283978, "url": "http://patchwork.ozlabs.org/api/patches/1283978/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200505225537.3318391-1-jacob.e.keller@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": "<20200505225537.3318391-1-jacob.e.keller@intel.com>", "list_archive_url": null, "date": "2020-05-05T22:55:37", "name": "[net-next] ice: report netlist version in .info_get", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "5e7324cf31fde861b17bb21cad159bc0d976a641", "submitter": { "id": 9784, "url": "http://patchwork.ozlabs.org/api/people/9784/?format=api", "name": "Jacob Keller", "email": "jacob.e.keller@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/20200505225537.3318391-1-jacob.e.keller@intel.com/mbox/", "series": [ { "id": 174933, "url": "http://patchwork.ozlabs.org/api/series/174933/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=174933", "date": "2020-05-05T22:55:37", "name": "[net-next] ice: report netlist version in .info_get", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/174933/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1283978/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1283978/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.138; helo=whitealder.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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\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 49Gw7B3mjjz9sRf\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 6 May 2020 08:55:47 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 26229878DB;\n\tTue, 5 May 2020 22:55:45 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 8l4rceAAUl36; Tue, 5 May 2020 22:55:43 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 826DE87789;\n\tTue, 5 May 2020 22:55:43 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n by ash.osuosl.org (Postfix) with ESMTP id 4883B1BF479\n for <intel-wired-lan@lists.osuosl.org>; Tue, 5 May 2020 22:55:42 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by whitealder.osuosl.org (Postfix) with ESMTP id 4232B869EC\n for <intel-wired-lan@lists.osuosl.org>; Tue, 5 May 2020 22:55:42 +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 HQfoZcfDQRxc for <intel-wired-lan@lists.osuosl.org>;\n Tue, 5 May 2020 22:55:41 +0000 (UTC)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by whitealder.osuosl.org (Postfix) with ESMTPS id 1B43387789\n for <intel-wired-lan@lists.osuosl.org>; Tue, 5 May 2020 22:55:41 +0000 (UTC)", "from orsmga008.jf.intel.com ([10.7.209.65])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 05 May 2020 15:55:40 -0700", "from jekeller-desk.amr.corp.intel.com ([10.166.241.33])\n by orsmga008.jf.intel.com with ESMTP; 05 May 2020 15:55:40 -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 GLor9loKdjVAMihWDE6d9B9L7U4KLETyxQAT55vKmEeNqRIoBAgCxcjVB13LdO6fhZ/Tslp2R2\n LeFuZcGXerqQ==", "\n lG7nkmaHhl0JuAas84aYiQHl1LEATlA3U0cAFVTj1U5A9zymMmSX/OLxgch8K5GXudQUPupOrw\n QN7I3kdFCWJg==" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.73,357,1583222400\"; d=\"scan'208\";a=\"295994766\"", "From": "Jacob Keller <jacob.e.keller@intel.com>", "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>", "Date": "Tue, 5 May 2020 15:55:37 -0700", "Message-Id": "<20200505225537.3318391-1-jacob.e.keller@intel.com>", "X-Mailer": "git-send-email 2.25.2", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH net-next] ice: report netlist version in\n .info_get", "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>", "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": "The flash memory for the ice hardware contains a block of information\nused for link management called the Netlist module.\n\nAs this essentially represents another section of firmware, add its\nversion information to the output of the driver's .info_get handler.\n\nThis includes both a version and the first few bytes of a hash of the\nmodule contents.\n\n fw.netlist -> the version information extracted from the netlist module\n fw.netlist.build-> first 4 bytes of the hash of the contents, similar\n to fw.mgmt.build\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n Documentation/networking/devlink/ice.rst | 11 +++\n .../net/ethernet/intel/ice/ice_adminq_cmd.h | 27 ++++++\n drivers/net/ethernet/intel/ice/ice_devlink.c | 23 +++++\n drivers/net/ethernet/intel/ice/ice_nvm.c | 86 +++++++++++++++++++\n drivers/net/ethernet/intel/ice/ice_type.h | 11 +++\n 5 files changed, 158 insertions(+)", "diff": "diff --git a/Documentation/networking/devlink/ice.rst b/Documentation/networking/devlink/ice.rst\nindex 5b58fc4e1268..b7c1c3602b1c 100644\n--- a/Documentation/networking/devlink/ice.rst\n+++ b/Documentation/networking/devlink/ice.rst\n@@ -69,6 +69,17 @@ The ``ice`` driver reports the following versions\n - The version of the DDP package that is active in the device. Note\n that both the name (as reported by ``fw.app.name``) and version are\n required to uniquely identify the package.\n+ * - ``fw.netlist``\n+ - running\n+ - 1.1.2000-6.7.0\n+ - The version of the netlist module. This module defines the device's\n+ Ethernet capabilities and default settings, and is used by the\n+ management firmware as part of managing link and device\n+ connectivity.\n+ * - ``fw.netlist.build``\n+ - running\n+ - 0xee16ced7\n+ - The first 4 bytes of the hash of the netlist module contents.\n \n Regions\n =======\ndiff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\nindex a1066c4bf40d..214c8f1c699f 100644\n--- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\n+++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\n@@ -1265,6 +1265,33 @@ struct ice_aqc_nvm_checksum {\n \tu8 rsvd2[12];\n };\n \n+/* The result of netlist NVM read comes in a TLV format. The actual data\n+ * (netlist header) starts from word offset 1 (byte 2). The FW strips\n+ * out the type field from the TLV header so all the netlist fields\n+ * should adjust their offset value by 1 word (2 bytes) in order to map\n+ * their correct location.\n+ */\n+#define ICE_AQC_NVM_LINK_TOPO_NETLIST_MOD_ID\t\t0x11B\n+#define ICE_AQC_NVM_LINK_TOPO_NETLIST_LEN_OFFSET\t1\n+#define ICE_AQC_NVM_LINK_TOPO_NETLIST_LEN\t\t2 /* In bytes */\n+#define ICE_AQC_NVM_NETLIST_NODE_COUNT_OFFSET\t\t2\n+#define ICE_AQC_NVM_NETLIST_NODE_COUNT_LEN\t\t2 /* In bytes */\n+#define ICE_AQC_NVM_NETLIST_NODE_COUNT_M\t\tICE_M(0x3FF, 0)\n+#define ICE_AQC_NVM_NETLIST_ID_BLK_START_OFFSET\t\t5\n+#define ICE_AQC_NVM_NETLIST_ID_BLK_LEN\t\t\t0x30 /* In words */\n+\n+/* netlist ID block field offsets (word offsets) */\n+#define ICE_AQC_NVM_NETLIST_ID_BLK_MAJOR_VER_LOW\t2\n+#define ICE_AQC_NVM_NETLIST_ID_BLK_MAJOR_VER_HIGH\t3\n+#define ICE_AQC_NVM_NETLIST_ID_BLK_MINOR_VER_LOW\t4\n+#define ICE_AQC_NVM_NETLIST_ID_BLK_MINOR_VER_HIGH\t5\n+#define ICE_AQC_NVM_NETLIST_ID_BLK_TYPE_LOW\t\t6\n+#define ICE_AQC_NVM_NETLIST_ID_BLK_TYPE_HIGH\t\t7\n+#define ICE_AQC_NVM_NETLIST_ID_BLK_REV_LOW\t\t8\n+#define ICE_AQC_NVM_NETLIST_ID_BLK_REV_HIGH\t\t9\n+#define ICE_AQC_NVM_NETLIST_ID_BLK_SHA_HASH\t\t0xA\n+#define ICE_AQC_NVM_NETLIST_ID_BLK_CUST_VER\t\t0x2F\n+\n /**\n * Send to PF command (indirect 0x0801) ID is only used by PF\n *\ndiff --git a/drivers/net/ethernet/intel/ice/ice_devlink.c b/drivers/net/ethernet/intel/ice/ice_devlink.c\nindex c6833944b90a..a73d06e06b5d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_devlink.c\n+++ b/drivers/net/ethernet/intel/ice/ice_devlink.c\n@@ -105,6 +105,27 @@ static int ice_info_ddp_pkg_version(struct ice_pf *pf, char *buf, size_t len)\n \treturn 0;\n }\n \n+static int ice_info_netlist_ver(struct ice_pf *pf, char *buf, size_t len)\n+{\n+\tstruct ice_netlist_ver_info *netlist = &pf->hw.netlist_ver;\n+\n+\t/* The netlist version fields are BCD formatted */\n+\tsnprintf(buf, len, \"%x.%x.%x-%x.%x.%x\", netlist->major, netlist->minor,\n+\t\t netlist->type >> 16, netlist->type & 0xFFFF, netlist->rev,\n+\t\t netlist->cust_ver);\n+\n+\treturn 0;\n+}\n+\n+static int ice_info_netlist_build(struct ice_pf *pf, char *buf, size_t len)\n+{\n+\tstruct ice_netlist_ver_info *netlist = &pf->hw.netlist_ver;\n+\n+\tsnprintf(buf, len, \"0x%08x\", netlist->hash);\n+\n+\treturn 0;\n+}\n+\n #define fixed(key, getter) { ICE_VERSION_FIXED, key, getter }\n #define running(key, getter) { ICE_VERSION_RUNNING, key, getter }\n \n@@ -128,6 +149,8 @@ static const struct ice_devlink_version {\n \trunning(DEVLINK_INFO_VERSION_GENERIC_FW_BUNDLE_ID, ice_info_eetrack),\n \trunning(\"fw.app.name\", ice_info_ddp_pkg_name),\n \trunning(DEVLINK_INFO_VERSION_GENERIC_FW_APP, ice_info_ddp_pkg_version),\n+\trunning(\"fw.netlist\", ice_info_netlist_ver),\n+\trunning(\"fw.netlist.build\", ice_info_netlist_build),\n };\n \n /**\ndiff --git a/drivers/net/ethernet/intel/ice/ice_nvm.c b/drivers/net/ethernet/intel/ice/ice_nvm.c\nindex 8beb675d676b..7c2a06892bbb 100644\n--- a/drivers/net/ethernet/intel/ice/ice_nvm.c\n+++ b/drivers/net/ethernet/intel/ice/ice_nvm.c\n@@ -366,6 +366,87 @@ static enum ice_status ice_get_orom_ver_info(struct ice_hw *hw)\n \treturn 0;\n }\n \n+/**\n+ * ice_get_netlist_ver_info\n+ * @hw: pointer to the HW struct\n+ *\n+ * Get the netlist version information\n+ */\n+static enum ice_status ice_get_netlist_ver_info(struct ice_hw *hw)\n+{\n+\tstruct ice_netlist_ver_info *ver = &hw->netlist_ver;\n+\tenum ice_status ret;\n+\tu32 id_blk_start;\n+\t__le16 raw_data;\n+\tu16 data, i;\n+\tu16 *buff;\n+\n+\tret = ice_acquire_nvm(hw, ICE_RES_READ);\n+\tif (ret)\n+\t\treturn ret;\n+\tbuff = kcalloc(ICE_AQC_NVM_NETLIST_ID_BLK_LEN, sizeof(*buff),\n+\t\t GFP_KERNEL);\n+\tif (!buff) {\n+\t\tret = ICE_ERR_NO_MEMORY;\n+\t\tgoto exit_no_mem;\n+\t}\n+\n+\t/* read module length */\n+\tret = ice_aq_read_nvm(hw, ICE_AQC_NVM_LINK_TOPO_NETLIST_MOD_ID,\n+\t\t\t ICE_AQC_NVM_LINK_TOPO_NETLIST_LEN_OFFSET * 2,\n+\t\t\t ICE_AQC_NVM_LINK_TOPO_NETLIST_LEN, &raw_data,\n+\t\t\t false, false, NULL);\n+\tif (ret)\n+\t\tgoto exit_error;\n+\n+\tdata = le16_to_cpu(raw_data);\n+\t/* exit if length is = 0 */\n+\tif (!data)\n+\t\tgoto exit_error;\n+\n+\t/* read node count */\n+\tret = ice_aq_read_nvm(hw, ICE_AQC_NVM_LINK_TOPO_NETLIST_MOD_ID,\n+\t\t\t ICE_AQC_NVM_NETLIST_NODE_COUNT_OFFSET * 2,\n+\t\t\t ICE_AQC_NVM_NETLIST_NODE_COUNT_LEN, &raw_data,\n+\t\t\t false, false, NULL);\n+\tif (ret)\n+\t\tgoto exit_error;\n+\tdata = le16_to_cpu(raw_data) & ICE_AQC_NVM_NETLIST_NODE_COUNT_M;\n+\n+\t/* netlist ID block starts from offset 4 + node count * 2 */\n+\tid_blk_start = ICE_AQC_NVM_NETLIST_ID_BLK_START_OFFSET + data * 2;\n+\n+\t/* read the entire netlist ID block */\n+\tret = ice_aq_read_nvm(hw, ICE_AQC_NVM_LINK_TOPO_NETLIST_MOD_ID,\n+\t\t\t id_blk_start * 2,\n+\t\t\t ICE_AQC_NVM_NETLIST_ID_BLK_LEN * 2, buff, false,\n+\t\t\t false, NULL);\n+\tif (ret)\n+\t\tgoto exit_error;\n+\n+\tfor (i = 0; i < ICE_AQC_NVM_NETLIST_ID_BLK_LEN; i++)\n+\t\tbuff[i] = le16_to_cpu(((__force __le16 *)buff)[i]);\n+\n+\tver->major = (buff[ICE_AQC_NVM_NETLIST_ID_BLK_MAJOR_VER_HIGH] << 16) |\n+\t\tbuff[ICE_AQC_NVM_NETLIST_ID_BLK_MAJOR_VER_LOW];\n+\tver->minor = (buff[ICE_AQC_NVM_NETLIST_ID_BLK_MINOR_VER_HIGH] << 16) |\n+\t\tbuff[ICE_AQC_NVM_NETLIST_ID_BLK_MINOR_VER_LOW];\n+\tver->type = (buff[ICE_AQC_NVM_NETLIST_ID_BLK_TYPE_HIGH] << 16) |\n+\t\tbuff[ICE_AQC_NVM_NETLIST_ID_BLK_TYPE_LOW];\n+\tver->rev = (buff[ICE_AQC_NVM_NETLIST_ID_BLK_REV_HIGH] << 16) |\n+\t\tbuff[ICE_AQC_NVM_NETLIST_ID_BLK_REV_LOW];\n+\tver->cust_ver = buff[ICE_AQC_NVM_NETLIST_ID_BLK_CUST_VER];\n+\t/* Read the left most 4 bytes of SHA */\n+\tver->hash = buff[ICE_AQC_NVM_NETLIST_ID_BLK_SHA_HASH + 15] << 16 |\n+\t\tbuff[ICE_AQC_NVM_NETLIST_ID_BLK_SHA_HASH + 14];\n+\n+exit_error:\n+\tkfree(buff);\n+exit_no_mem:\n+\tice_release_nvm(hw);\n+\treturn ret;\n+}\n+\n /**\n * ice_discover_flash_size - Discover the available flash size.\n * @hw: pointer to the HW struct\n@@ -515,6 +596,11 @@ enum ice_status ice_init_nvm(struct ice_hw *hw)\n \t\treturn status;\n \t}\n \n+\t/* read the netlist version information */\n+\tstatus = ice_get_netlist_ver_info(hw);\n+\tif (status)\n+\t\tice_debug(hw, ICE_DBG_INIT, \"Failed to read netlist info.\\n\");\n+\n \treturn 0;\n }\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_type.h b/drivers/net/ethernet/intel/ice/ice_type.h\nindex 4ceb2db42999..40ac93d24e97 100644\n--- a/drivers/net/ethernet/intel/ice/ice_type.h\n+++ b/drivers/net/ethernet/intel/ice/ice_type.h\n@@ -261,6 +261,16 @@ struct ice_nvm_info {\n \n #define ICE_NVM_VER_LEN\t32\n \n+/* netlist version information */\n+struct ice_netlist_ver_info {\n+\tu32 major;\t\t\t/* major high/low */\n+\tu32 minor;\t\t\t/* minor high/low */\n+\tu32 type;\t\t\t/* type high/low */\n+\tu32 rev;\t\t\t/* revision high/low */\n+\tu32 hash;\t\t\t/* SHA-1 hash word */\n+\tu16 cust_ver;\t\t\t/* customer version */\n+};\n+\n /* Max number of port to queue branches w.r.t topology */\n #define ICE_MAX_TRAFFIC_CLASS 8\n #define ICE_TXSCHED_MAX_BRANCHES ICE_MAX_TRAFFIC_CLASS\n@@ -510,6 +520,7 @@ struct ice_hw {\n \tstruct ice_nvm_info nvm;\n \tstruct ice_hw_dev_caps dev_caps;\t/* device capabilities */\n \tstruct ice_hw_func_caps func_caps;\t/* function capabilities */\n+\tstruct ice_netlist_ver_info netlist_ver; /* netlist version info */\n \n \tstruct ice_switch_info *switch_info;\t/* switch filter lists */\n \n", "prefixes": [ "net-next" ] }