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 98E7D454EF; Tue, 25 Jun 2024 13:19:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C44F42ECB; Tue, 25 Jun 2024 13:16:34 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id BC23A42DD4 for ; Tue, 25 Jun 2024 13:15:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719314153; x=1750850153; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kK4zQuDbAhH/RBnsSWEIFfkKd9gPavCJRr2Ak8CGILs=; b=VfAbsynAWOrtuV+dV8WDo+crowWdDuNGO4kXr4pUM5B+C2LOP4maVqsk LRmtGSXEECiTY5aTj36t+DVnhdi7QsintInGiEDkQJ9kjSNRgG1HRv0Fn cGiaAM/GZ3KPCF/yoVJzCtif6CDfj5Y4treGqm2LdwjQiwLV4v9m8s3Ey j96LXfRH+An3p1JAXeQM2CliqOc1gEfZa8V8TC7LkBB6Lix+EUW7b17F3 gjl6KxKsLyQ4y0Kw2WlKiIeBiVcVLl8E/bu7qn3lgGmHySy6v4DKFdk7P M8qMbe5iLg0mMnUtVbpqjqkj12lt2Ndl69wqTWagUfbnIzydEj2MjmtdQ g==; X-CSE-ConnectionGUID: ss2PNnu0RxyFtFGFZ1XqEA== X-CSE-MsgGUID: Lj+lYbg9Q2efnGz8O4jbDA== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="16080144" X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="16080144" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2024 04:15:52 -0700 X-CSE-ConnectionGUID: mCR3nJR6Tu6+862NyQty0g== X-CSE-MsgGUID: HDW8jn2wSCWDnjyv8NrNBg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="43719103" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 25 Jun 2024 04:15:51 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Stefan Wegrzyn , bruce.richardson@intel.com, ian.stokes@intel.com Subject: [PATCH v3 032/129] net/ice/base: allow for dumping all clusters Date: Tue, 25 Jun 2024 12:12:37 +0100 Message-ID: <55da00fde081e0545b518218cf2b7e13768b525a.1719313663.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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: Stefan Wegrzyn Adjust ice_aq_get_internal_data() wrapping function so that it returns next cluster ID when iterating over clusters, as well as add missing cluster definition. Signed-off-by: Stefan Wegrzyn Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_adminq_cmd.h | 4 ++-- drivers/net/ice/base/ice_common.c | 11 +++++++---- drivers/net/ice/base/ice_common.h | 6 +++--- drivers/net/ice/ice_diagnose.c | 7 ++++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h index 9bd9e97de0..4c9325fb61 100644 --- a/drivers/net/ice/base/ice_adminq_cmd.h +++ b/drivers/net/ice/base/ice_adminq_cmd.h @@ -2896,7 +2896,7 @@ struct ice_aqc_event_lan_overflow { /* Debug Dump Internal Data (indirect 0xFF08) */ struct ice_aqc_debug_dump_internals { - u8 cluster_id; + __le16 cluster_id; /* Expresses next cluster ID in response */ #define ICE_AQC_DBG_DUMP_CLUSTER_ID_SW 0 #define ICE_AQC_DBG_DUMP_CLUSTER_ID_ACL 1 #define ICE_AQC_DBG_DUMP_CLUSTER_ID_TXSCHED 2 @@ -2910,7 +2910,7 @@ struct ice_aqc_debug_dump_internals { #define ICE_AQC_DBG_DUMP_CLUSTER_ID_L2P 8 #define ICE_AQC_DBG_DUMP_CLUSTER_ID_QUEUE_MNG 9 #define ICE_AQC_DBG_DUMP_CLUSTER_ID_FULL_CSR_SPACE 21 - u8 reserved; +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_MNG_TRANSACTION 22 __le16 table_id; /* Used only for non-memory clusters */ __le32 idx; /* In table entries for tables, in bytes for memory */ __le32 addr_high; diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index 16107317d3..a768c42b2b 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -4846,6 +4846,7 @@ ice_set_ctx(struct ice_hw *hw, u8 *src_ctx, u8 *dest_ctx, * @buf: dump buffer * @buf_size: dump buffer size * @ret_buf_size: return buffer size (returned by FW) + * @ret_next_cluster: next cluster to read (returned by FW) * @ret_next_table: next block to read (returned by FW) * @ret_next_index: next index to read (returned by FW) * @cd: pointer to command details structure @@ -4853,10 +4854,10 @@ ice_set_ctx(struct ice_hw *hw, u8 *src_ctx, u8 *dest_ctx, * Get internal FW/HW data (0xFF08) for debug purposes. */ int -ice_aq_get_internal_data(struct ice_hw *hw, u8 cluster_id, u16 table_id, +ice_aq_get_internal_data(struct ice_hw *hw, u16 cluster_id, u16 table_id, u32 start, void *buf, u16 buf_size, u16 *ret_buf_size, - u16 *ret_next_table, u32 *ret_next_index, - struct ice_sq_cd *cd) + u16 *ret_next_cluster, u16 *ret_next_table, + u32 *ret_next_index, struct ice_sq_cd *cd) { struct ice_aqc_debug_dump_internals *cmd; struct ice_aq_desc desc; @@ -4869,7 +4870,7 @@ ice_aq_get_internal_data(struct ice_hw *hw, u8 cluster_id, u16 table_id, ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_debug_dump_internals); - cmd->cluster_id = cluster_id; + cmd->cluster_id = CPU_TO_LE16(cluster_id); cmd->table_id = CPU_TO_LE16(table_id); cmd->idx = CPU_TO_LE32(start); @@ -4878,6 +4879,8 @@ ice_aq_get_internal_data(struct ice_hw *hw, u8 cluster_id, u16 table_id, if (!status) { if (ret_buf_size) *ret_buf_size = LE16_TO_CPU(desc.datalen); + if (ret_next_cluster) + *ret_next_cluster = LE16_TO_CPU(cmd->cluster_id); if (ret_next_table) *ret_next_table = LE16_TO_CPU(cmd->table_id); if (ret_next_index) diff --git a/drivers/net/ice/base/ice_common.h b/drivers/net/ice/base/ice_common.h index ecfe55bd3a..9ffa054994 100644 --- a/drivers/net/ice/base/ice_common.h +++ b/drivers/net/ice/base/ice_common.h @@ -65,10 +65,10 @@ int ice_get_caps(struct ice_hw *hw); void ice_set_safe_mode_caps(struct ice_hw *hw); int -ice_aq_get_internal_data(struct ice_hw *hw, u8 cluster_id, u16 table_id, +ice_aq_get_internal_data(struct ice_hw *hw, u16 cluster_id, u16 table_id, u32 start, void *buf, u16 buf_size, u16 *ret_buf_size, - u16 *ret_next_table, u32 *ret_next_index, - struct ice_sq_cd *cd); + u16 *ret_next_cluster, u16 *ret_next_table, + u32 *ret_next_index, struct ice_sq_cd *cd); /* Define a macro that will align a pointer to point to the next memory address * that falls on the given power of 2 (i.e., 2, 4, 8, 16, 32, 64...). For diff --git a/drivers/net/ice/ice_diagnose.c b/drivers/net/ice/ice_diagnose.c index 44641e6c79..51e2f2fb9f 100644 --- a/drivers/net/ice/ice_diagnose.c +++ b/drivers/net/ice/ice_diagnose.c @@ -437,9 +437,10 @@ static int ice_dump_switch(struct rte_eth_dev *dev, uint8_t **buff2, uint32_t *size) { struct ice_hw *hw; + struct ice_sq_cd *cd = NULL; int i = 0; uint16_t tbl_id = 0; - uint32_t tbl_idx = 0; + uint16_t tbl_idx = 0; uint8_t *buffer = *buff2; hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -469,7 +470,7 @@ ice_dump_switch(struct rte_eth_dev *dev, uint8_t **buff2, uint32_t *size) ICE_AQC_DBG_DUMP_CLUSTER_ID_SW, tbl_id, tbl_idx, buff, ICE_PKG_BUF_SIZE, - &buff_size, &tbl_id, &tbl_idx, NULL); + &buff_size, &tbl_id, &tbl_idx, NULL, cd); if (res) { free(buff); @@ -481,7 +482,7 @@ ice_dump_switch(struct rte_eth_dev *dev, uint8_t **buff2, uint32_t *size) free(buff); - if (tbl_idx == 0xffffffff) { + if (tbl_idx == 0xffff) { tbl_idx = 0; memset(buffer, '\n', sizeof(char)); buffer++; -- 2.43.0