Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/127014/?format=api
http://patches.dpdk.org/api/patches/127014/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230518151638.1207021-21-qiming.yang@intel.com/", "project": { "id": 1, "url": "http://patches.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": "<20230518151638.1207021-21-qiming.yang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230518151638.1207021-21-qiming.yang@intel.com", "date": "2023-05-18T15:16:38", "name": "[v2,20/20] net/ice/base: add new AQ ro read HW sensors", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "876615475c937328a11cff6248dad05f47681906", "submitter": { "id": 522, "url": "http://patches.dpdk.org/api/people/522/?format=api", "name": "Qiming Yang", "email": "qiming.yang@intel.com" }, "delegate": { "id": 1540, "url": "http://patches.dpdk.org/api/users/1540/?format=api", "username": "qzhan15", "first_name": "Qi", "last_name": "Zhang", "email": "qi.z.zhang@intel.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230518151638.1207021-21-qiming.yang@intel.com/mbox/", "series": [ { "id": 28063, "url": "http://patches.dpdk.org/api/series/28063/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28063", "date": "2023-05-18T15:16:18", "name": "net/ice/base: code update", "version": 2, "mbox": "http://patches.dpdk.org/series/28063/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/127014/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/127014/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 338E642AF1;\n\tThu, 18 May 2023 17:36:48 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id DACDB42F90;\n\tThu, 18 May 2023 17:34:51 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by mails.dpdk.org (Postfix) with ESMTP id 7B83B42DC2\n for <dev@dpdk.org>; Thu, 18 May 2023 17:34:50 +0200 (CEST)", "from fmsmga007.fm.intel.com ([10.253.24.52])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 18 May 2023 08:34:50 -0700", "from dpdk-qiming3.sh.intel.com ([10.67.111.4])\n by fmsmga007.fm.intel.com with ESMTP; 18 May 2023 08:34:48 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1684424090; x=1715960090;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=iIgAZuLlRMwa4I6vSSilLsuCJaCI3G3nggckGFIY5OQ=;\n b=EMw7ZQg0Wf+xB4GdrYcWNbtqzpBGcdSuaAVHQcrEVIvE5JaAUkWwohxe\n oYWIlcsWejFM+ouzPxPEn43j+xhen2qIdj8ZBnZTK7p5MYagMXsg32Qk2\n SNSJBnB6rCJzCwp9xahaAq9AoPEVKVv966CFncXSjm5HsdpyV9d/OXv3X\n baN/uggl+1h/jqJAWmY/EaTO25XOQ/hrc8It0Nz6+f0x4bWq+XH9cM+F3\n vJHFUuj687R7Aff3czZ1DTngx/9sVjSgp+4tI1xs5FGTBQal7FN7gm3sO\n ApnFg8T6Vunypp/Mk0ULpAY6Lfla7GZRqnp5iicVaIj/X/zavmmOIEStm A==;", "X-IronPort-AV": [ "E=McAfee;i=\"6600,9927,10714\"; a=\"341527827\"", "E=Sophos;i=\"5.99,285,1677571200\"; d=\"scan'208\";a=\"341527827\"", "E=McAfee;i=\"6600,9927,10714\"; a=\"705235281\"", "E=Sophos;i=\"5.99,285,1677571200\"; d=\"scan'208\";a=\"705235281\"" ], "X-ExtLoop1": "1", "From": "Qiming Yang <qiming.yang@intel.com>", "To": "dev@dpdk.org", "Cc": "qi.z.zhang@intel.com, Qiming Yang <qiming.yang@intel.com>,\n Marcin Domagala <marcinx.domagala@intel.com>,\n Eric Joyner <eric.joyner@intel.com>", "Subject": "[PATCH v2 20/20] net/ice/base: add new AQ ro read HW sensors", "Date": "Thu, 18 May 2023 15:16:38 +0000", "Message-Id": "<20230518151638.1207021-21-qiming.yang@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20230518151638.1207021-1-qiming.yang@intel.com>", "References": "<20230427062001.478032-1-qiming.yang@intel.com>\n <20230518151638.1207021-1-qiming.yang@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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" }, "content": "Adds new helper function to read from HW sensors via a new AQ command\n\"Get Sensor Reading (0x0632)\".\n\nCurrently, this AQ command only supports reading the temperature from\nE810 devices with a supported firmware, but in the future it could be\nextended to read other sensors.\n\nSigned-off-by: Marcin Domagala <marcinx.domagala@intel.com>\nSigned-off-by: Eric Joyner <eric.joyner@intel.com>\nSigned-off-by: Qiming Yang <qiming.yang@intel.com>\n---\n drivers/net/ice/base/ice_adminq_cmd.h | 29 +++++++++++++++++++++\n drivers/net/ice/base/ice_common.c | 36 +++++++++++++++++++++++++++\n drivers/net/ice/base/ice_common.h | 4 +++\n 3 files changed, 69 insertions(+)", "diff": "diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h\nindex 8df6ca41e9..844e90bbce 100644\n--- a/drivers/net/ice/base/ice_adminq_cmd.h\n+++ b/drivers/net/ice/base/ice_adminq_cmd.h\n@@ -1666,6 +1666,32 @@ struct ice_aqc_set_mac_lb {\n \tu8 reserved[15];\n };\n \n+/* Get sensor reading (direct 0x0632) */\n+struct ice_aqc_get_sensor_reading {\n+\tu8 sensor;\n+#define ICE_AQC_INT_TEMP_SENSOR\t\t0x0\n+\tu8 format;\n+#define ICE_AQC_INT_TEMP_FORMAT\t\t0x0\n+\tu8 reserved[6];\n+\t__le32 addr_high;\n+\t__le32 addr_low;\n+};\n+\n+/* Get sensor reading response (direct 0x0632) */\n+struct ice_aqc_get_sensor_reading_resp {\n+\tunion {\n+\t\tu8 raw[8];\n+\t\t/* Output data for sensor 0x00, format 0x00 */\n+\t\tstruct {\n+\t\t\ts8 temp;\n+\t\t\tu8 temp_warning_threshold;\n+\t\t\tu8 temp_critical_threshold;\n+\t\t\tu8 temp_fatal_threshold;\n+\t\t\tu8 reserved[4];\n+\t\t} s0f0;\n+\t} data;\n+};\n+\n struct ice_aqc_link_topo_params {\n \tu8 lport_num;\n \tu8 lport_num_valid;\n@@ -3004,6 +3030,8 @@ struct ice_aq_desc {\n \t\tstruct ice_aqc_get_phy_caps get_phy;\n \t\tstruct ice_aqc_set_phy_cfg set_phy;\n \t\tstruct ice_aqc_restart_an restart_an;\n+\t\tstruct ice_aqc_get_sensor_reading get_sensor_reading;\n+\t\tstruct ice_aqc_get_sensor_reading_resp get_sensor_reading_resp;\n \t\tstruct ice_aqc_i2c read_write_i2c;\n \t\tstruct ice_aqc_read_i2c_resp read_i2c_resp;\n \t\tstruct ice_aqc_gpio read_write_gpio;\n@@ -3253,6 +3281,7 @@ enum ice_adminq_opc {\n \tice_aqc_opc_get_link_status\t\t\t= 0x0607,\n \tice_aqc_opc_set_event_mask\t\t\t= 0x0613,\n \tice_aqc_opc_set_mac_lb\t\t\t\t= 0x0620,\n+\tice_aqc_opc_get_sensor_reading\t\t\t= 0x0632,\n \tice_aqc_opc_get_link_topo\t\t\t= 0x06E0,\n \tice_aqc_opc_get_link_topo_pin\t\t\t= 0x06E1,\n \tice_aqc_opc_read_i2c\t\t\t\t= 0x06E2,\ndiff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c\nindex f7f43cd7e0..0f26f1d854 100644\n--- a/drivers/net/ice/base/ice_common.c\n+++ b/drivers/net/ice/base/ice_common.c\n@@ -5359,6 +5359,42 @@ ice_cfg_vsi_lan(struct ice_port_info *pi, u16 vsi_handle, u16 tc_bitmap,\n \t\t\t ICE_SCHED_NODE_OWNER_LAN);\n }\n \n+/**\n+ * ice_aq_get_sensor_reading\n+ * @hw: pointer to the HW struct\n+ * @sensor: sensor type\n+ * @format: requested response format\n+ * @data: pointer to data to be read from the sensor\n+ * @cd: pointer to command details structure or NULL\n+ *\n+ * Get sensor reading (0x0632)\n+ */\n+enum ice_status\n+ice_aq_get_sensor_reading(struct ice_hw *hw, u8 sensor, u8 format,\n+\t\t\t struct ice_aqc_get_sensor_reading_resp *data,\n+\t\t\t struct ice_sq_cd *cd)\n+{\n+\tstruct ice_aqc_get_sensor_reading *cmd;\n+\tstruct ice_aq_desc desc;\n+\tenum ice_status status;\n+\n+\tif (!data)\n+\t\treturn ICE_ERR_PARAM;\n+\n+\tice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_sensor_reading);\n+\tcmd = &desc.params.get_sensor_reading;\n+\tcmd->sensor = sensor;\n+\tcmd->format = format;\n+\n+\tstatus = ice_aq_send_cmd(hw, &desc, NULL, 0, cd);\n+\n+\tif (!status)\n+\t\tice_memcpy(data, &desc.params.get_sensor_reading_resp,\n+\t\t\t sizeof(*data), ICE_NONDMA_TO_NONDMA);\n+\n+\treturn status;\n+}\n+\n /**\n * ice_is_main_vsi - checks whether the VSI is main VSI\n * @hw: pointer to the HW struct\ndiff --git a/drivers/net/ice/base/ice_common.h b/drivers/net/ice/base/ice_common.h\nindex aff361e5aa..0f1be917db 100644\n--- a/drivers/net/ice/base/ice_common.h\n+++ b/drivers/net/ice/base/ice_common.h\n@@ -249,6 +249,10 @@ enum ice_status ice_sbq_rw_reg_lp(struct ice_hw *hw,\n void ice_sbq_lock(struct ice_hw *hw);\n void ice_sbq_unlock(struct ice_hw *hw);\n enum ice_status ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in);\n+enum ice_status\n+ice_aq_get_sensor_reading(struct ice_hw *hw, u8 sensor, u8 format,\n+\t\t\t struct ice_aqc_get_sensor_reading_resp *data,\n+\t\t\t struct ice_sq_cd *cd);\n void\n ice_stat_update40(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,\n \t\t u64 *prev_stat, u64 *cur_stat);\n", "prefixes": [ "v2", "20/20" ] }{ "id": 127014, "url": "