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 EB7804404F; Wed, 12 Jun 2024 17:11:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E5B14427DA; Wed, 12 Jun 2024 17:04:27 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 569E540EE1 for ; Wed, 12 Jun 2024 17:04:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204663; x=1749740663; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sEr7F5e3nlmkrdTaBZB5hMU2gsxYKpph9RNdTLvOkSo=; b=VjxlYyQL07e2o3WXnT+9kYPp/fNW5WeY5fxbtbcjrdpFM82EB+sBFH90 G5XxEhUOyfFK/XEZHRdM6oC2JoMS19DHSNMQb1oFIo1JxGZLIL1bh4SJB /BmlCWQZUX0N1mA8oJLdgeN83guf8ysCqpmvdLxce/iIUrMVK8jUj8GY7 B/CDkDX0586i6CbYQkkrbKdlje9BXlqGXoBJhrlPi5bdLqrKpcG5XW1QG sN/xWpT5uGXNvPNlWw4wO4jbkSu6/IENtKznr2xfdDhE22bmsr/uXck59 XgZvvXxK81HIZiuOmhE5d4/1Lk8gvq/LCfWCgffErlra7xq7xSIAYszcE A==; X-CSE-ConnectionGUID: eU7TlR6TREmmB9ZSx2JAcw== X-CSE-MsgGUID: B6bzmHoQSRa+fZe4f1+LsA== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32459369" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32459369" 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:04:19 -0700 X-CSE-ConnectionGUID: UxtU8cD0Rz+keEYXoUklzQ== X-CSE-MsgGUID: rtFjRkasSb2V6LYVzOnxHg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39925117" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:04:18 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Ian Stokes , bruce.richardson@intel.com, Stefan Wegrzyn Subject: [PATCH v2 038/148] net/ice/base: allow for dumping all clusters Date: Wed, 12 Jun 2024 16:00:32 +0100 Message-ID: <95fde002965566071d6ec1afde20ecb8f62dbacd.1718204528.git.anatoly.burakov@intel.com> 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 Define MNG Transactions cluster ID, as well as adjust definition of 0xFF08 admin command according to better match data sheet. Also, modify ice_aq_get_internal_data() wrapping function so that it returns next cluster ID. Signed-off-by: Stefan Wegrzyn Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_adminq_cmd.h | 3 +-- 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, 15 insertions(+), 12 deletions(-) diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h index 89f565d09f..3b917e9d7d 100644 --- a/drivers/net/ice/base/ice_adminq_cmd.h +++ b/drivers/net/ice/base/ice_adminq_cmd.h @@ -2905,7 +2905,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 @@ -2920,7 +2920,6 @@ struct ice_aqc_debug_dump_internals { #define ICE_AQC_DBG_DUMP_CLUSTER_ID_QUEUE_MNG 9 #define ICE_AQC_DBG_DUMP_CLUSTER_ID_FULL_CSR_SPACE 21 #define ICE_ACQ_DBG_DUMP_CLUSTER_ID_MNG_TRANSACTION 22 - u8 reserved; __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 977071e1e9..6266b67f24 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -4858,6 +4858,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 @@ -4865,10 +4866,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; @@ -4881,7 +4882,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); @@ -4890,6 +4891,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 4a871d69b5..567c6481e9 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 3be819d7f8..3e9d25a8ea 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