Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/126575/?format=api
http://patchwork.dpdk.org/api/patches/126575/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230427062001.478032-9-qiming.yang@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": "<20230427062001.478032-9-qiming.yang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230427062001.478032-9-qiming.yang@intel.com", "date": "2023-04-27T06:19:39", "name": "[08/30] net/ice/base: add function to read HW sensors", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "a5a6bdbcbdb99d53e0d14b6b00f4dd34111c3482", "submitter": { "id": 522, "url": "http://patchwork.dpdk.org/api/people/522/?format=api", "name": "Qiming Yang", "email": "qiming.yang@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/20230427062001.478032-9-qiming.yang@intel.com/mbox/", "series": [ { "id": 27885, "url": "http://patchwork.dpdk.org/api/series/27885/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=27885", "date": "2023-04-27T06:19:31", "name": "net/ice/base: share code update", "version": 1, "mbox": "http://patchwork.dpdk.org/series/27885/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/126575/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/126575/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 34BB342A08;\n\tThu, 27 Apr 2023 08:38:53 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id CCC0742D9E;\n\tThu, 27 Apr 2023 08:38:01 +0200 (CEST)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by mails.dpdk.org (Postfix) with ESMTP id B8C4642D8E\n for <dev@dpdk.org>; Thu, 27 Apr 2023 08:37:59 +0200 (CEST)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 26 Apr 2023 23:37:59 -0700", "from dpdk-qiming3.sh.intel.com ([10.67.111.4])\n by fmsmga002.fm.intel.com with ESMTP; 26 Apr 2023 23:37:57 -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=1682577479; x=1714113479;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=dXfJ+soVh046aH7BufYMsfVq9hbpqGXaRD7WpcBXpiY=;\n b=hnQVzhuZ52ClI1nSDHjKcgdh7fFewKQwfVXYZNRXk7XuFy68ILBwKr9r\n UNfwvIAeWEEGlDWuk9C6plKoKQ1GeQG02PEO3xkgVP59HVehPyhSQUqK3\n FKcvTqcUOZnqL5KSGlJQYiMJLAaaEbNOGeGZpYnNjZ4IdLMa2clrvsxo+\n gLh4iqXx1E/X4q0VuAHm6Pzwn6s/q35w9OBqxQSUadexN9esAN0U+BSdR\n jdiKTiYNllN6Wz3dvB8u2tSLqxmoW//jcLD6rtWBBHtTL3i5xHrO3r67u\n g6p1zwTc3jc8XDlYMdYYZn8k4vo2K0MW+u18HsbulFDSx3Phy02wc9lgZ w==;", "X-IronPort-AV": [ "E=McAfee;i=\"6600,9927,10692\"; a=\"375324294\"", "E=Sophos;i=\"5.99,230,1677571200\"; d=\"scan'208\";a=\"375324294\"", "E=McAfee;i=\"6600,9927,10692\"; a=\"805845704\"", "E=Sophos;i=\"5.99,230,1677571200\"; d=\"scan'208\";a=\"805845704\"" ], "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 Martion Domagala <marvinx.domagala@intel.com>", "Subject": "[PATCH 08/30] net/ice/base: add function to read HW sensors", "Date": "Thu, 27 Apr 2023 06:19:39 +0000", "Message-Id": "<20230427062001.478032-9-qiming.yang@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20230427062001.478032-1-qiming.yang@intel.com>", "References": "<20230427062001.478032-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\nSigned-off-by: Martion Domagala <marvinx.domagala@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 | 6 +++--\n 3 files changed, 69 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h\nindex 4c4fd27865..5a44ebbdc0 100644\n--- a/drivers/net/ice/base/ice_adminq_cmd.h\n+++ b/drivers/net/ice/base/ice_adminq_cmd.h\n@@ -1681,6 +1681,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@@ -3032,6 +3058,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@@ -3281,6 +3309,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 a51a436df6..ed811e406d 100644\n--- a/drivers/net/ice/base/ice_common.c\n+++ b/drivers/net/ice/base/ice_common.c\n@@ -5278,6 +5278,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 f612ce7c52..ccefe85af7 100644\n--- a/drivers/net/ice/base/ice_common.h\n+++ b/drivers/net/ice/base/ice_common.h\n@@ -29,7 +29,6 @@ enum ice_status ice_init_hw(struct ice_hw *hw);\n void ice_deinit_hw(struct ice_hw *hw);\n enum ice_status ice_check_reset(struct ice_hw *hw);\n enum ice_status ice_reset(struct ice_hw *hw, enum ice_reset_req req);\n-\n enum ice_status ice_create_all_ctrlq(struct ice_hw *hw);\n enum ice_status ice_init_all_ctrlq(struct ice_hw *hw);\n void ice_shutdown_all_ctrlq(struct ice_hw *hw, bool unloading);\n@@ -61,7 +60,6 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,\n \t\tstruct ice_aq_desc *desc, void *buf, u16 buf_size,\n \t\tstruct ice_sq_cd *cd);\n void ice_clear_pxe_mode(struct ice_hw *hw);\n-\n enum ice_status ice_get_caps(struct ice_hw *hw);\n \n void ice_set_safe_mode_caps(struct ice_hw *hw);\n@@ -247,6 +245,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": [ "08/30" ] }{ "id": 126575, "url": "