From: Stefan Wegrzyn <stefan.wegr...@intel.com> 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 <stefan.wegr...@intel.com> Signed-off-by: Ian Stokes <ian.sto...@intel.com> --- 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