From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 257B24404F; Wed, 12 Jun 2024 17:25:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C41CA432A2; Wed, 12 Jun 2024 17:07:02 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 1241C432A8 for ; Wed, 12 Jun 2024 17:06:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204816; x=1749740816; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=duF8qxGpduyuzt0wdaY/IP9jlfqnfCX86UUwuP4OZ98=; b=Tj/Bp1WOH0zM7wmEW9TwwG9CF8UYqpMPoD2atzUevcnATytcRkTcvud7 bQzhMHRSWX2pJU5OrwUfYPZ+5v95MqyoC0FLmwBpFahDWOahtXcj4AQyr QfgT/oW3Gy8VEe1SmOtpVYNM09Fnhojs0R6CArMMGcC3AqYcSeoALXbeO onMKQPLQaFJc0epKJNp91nq4kCtJMjuL4/QXsUpAaJvUDL/ehTVUYT6QX fRv/PH9UBGRDHXm+5sJHgxXdFtNMu7wcdvD2u2AFLv96AjwP1ZgEucsoY eTRiu4z1BR4k54Wtcs3IDwCeBLdc1NvpJ0sdYi1mhe35MhwvhZk6/BPBu Q==; X-CSE-ConnectionGUID: f+pBmTNLQsmr1yYoLpjkIQ== X-CSE-MsgGUID: PH1l0ocuSey2EGTL4oYgeA== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32460106" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32460106" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 08:06:56 -0700 X-CSE-ConnectionGUID: QpH0hV0WRtObUnJ/KEFgXQ== X-CSE-MsgGUID: YEbmvK4eRC+MfZIb6dz/MA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39925981" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:06:55 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Ian Stokes , bruce.richardson@intel.com, Eric Joyner Subject: [PATCH v2 130/148] net/ice/base: detect and store device sensor reading capability Date: Wed, 12 Jun 2024 16:02:04 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240430154014.1026-1-ian.stokes@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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Ian Stokes The driver can use this capability to see if temperature sensor reading or other HW sensor reading capabilities are supported before reading them using the Get Sensor Reading AQ command. Signed-off-by: Eric Joyner Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_adminq_cmd.h | 1 + drivers/net/ice/base/ice_common.c | 23 +++++++++++++++++++++++ drivers/net/ice/base/ice_type.h | 3 +++ 3 files changed, 27 insertions(+) diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h index cc4c2ce89e..90b15ed9ae 100644 --- a/drivers/net/ice/base/ice_adminq_cmd.h +++ b/drivers/net/ice/base/ice_adminq_cmd.h @@ -119,6 +119,7 @@ struct ice_aqc_list_caps_elem { #define ICE_AQC_CAPS_1588 0x0046 #define ICE_AQC_CAPS_MAX_MTU 0x0047 #define ICE_AQC_CAPS_IWARP 0x0051 +#define ICE_AQC_CAPS_SENSOR_READING 0x0067 #define ICE_AQC_CAPS_PCIE_RESET_AVOIDANCE 0x0076 #define ICE_AQC_CAPS_POST_UPDATE_RESET_RESTRICT 0x0077 #define ICE_AQC_CAPS_NVM_MGMT 0x0080 diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index 5694c840bc..fcd40e398b 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -2853,6 +2853,26 @@ ice_parse_nac_topo_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, dev_p->nac_topo.id); } +/** + * ice_parse_sensor_reading_cap - Parse ICE_AQC_CAPS_SENSOR_READING cap + * @hw: pointer to the HW struct + * @dev_p: pointer to device capabilities structure + * @cap: capability element to parse + * + * Parse ICE_AQC_CAPS_SENSOR_READING for device capability for reading + * enabled sensors. + */ +static void +ice_parse_sensor_reading_cap(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, + struct ice_aqc_list_caps_elem *cap) +{ + dev_p->supported_sensors = LE32_TO_CPU(cap->number); + + ice_debug(hw, ICE_DBG_INIT, + "dev caps: supported sensors (bitmap) = 0x%x\n", + dev_p->supported_sensors); +} + /** * ice_parse_dev_caps - Parse device capabilities * @hw: pointer to the HW struct @@ -2901,6 +2921,9 @@ ice_parse_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, case ICE_AQC_CAPS_NAC_TOPOLOGY: ice_parse_nac_topo_dev_caps(hw, dev_p, &cap_resp[i]); break; + case ICE_AQC_CAPS_SENSOR_READING: + ice_parse_sensor_reading_cap(hw, dev_p, &cap_resp[i]); + break; default: /* Don't list common capabilities as unknown */ if (!found) diff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h index ff37487636..5d4d85ff16 100644 --- a/drivers/net/ice/base/ice_type.h +++ b/drivers/net/ice/base/ice_type.h @@ -827,6 +827,9 @@ struct ice_hw_dev_caps { struct ice_ts_dev_info ts_dev_info; u32 num_funcs; struct ice_nac_topology nac_topo; + /* bitmap of supported sensors */ + u32 supported_sensors; +#define ICE_SENSOR_SUPPORT_E810_INT_TEMP BIT(0) }; /* Information about MAC such as address, etc... */ -- 2.43.0