[3/3] net/bnxt: fix backing store logging

Message ID 20240606233116.38445-4-ajit.khaparde@broadcom.com (mailing list archive)
State Accepted
Delegated to: Ajit Khaparde
Headers
Series bnxt bug fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Ajit Khaparde June 6, 2024, 11:31 p.m. UTC
  Backing store type count can increase with newer firmware.
So a static bnxt_backing_store_types can cause unnecessary faults.
Instead of logging the string for the backing store type, just log
the value provided by the firmware.

Fixes: fe2f715ca580 ("net/bnxt: support backing store v2")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 48 ++++--------------------------------
 1 file changed, 5 insertions(+), 43 deletions(-)
  

Patch

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 9ea5cc090f..fc142672f6 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -31,43 +31,6 @@  struct bnxt_plcmodes_cfg {
 	uint16_t	hds_threshold;
 };
 
-const char *bnxt_backing_store_types[] = {
-	"Queue pair",
-	"Shared receive queue",
-	"Completion queue",
-	"Virtual NIC",
-	"Statistic context",
-	"Slow-path TQM ring",
-	"Fast-path TQM ring",
-	"Unused",
-	"Unused",
-	"Unused",
-	"Unused",
-	"Unused",
-	"Unused",
-	"Unused",
-	"MR and MAV Context",
-	"TIM",
-	"Unused",
-	"Unused",
-	"Unused",
-	"Tx key context",
-	"Rx key context",
-	"Mid-path TQM ring",
-	"SQ Doorbell shadow region",
-	"RQ Doorbell shadow region",
-	"SRQ Doorbell shadow region",
-	"CQ Doorbell shadow region",
-	"QUIC Tx key context",
-	"QUIC Rx key context",
-	"Invalid type",
-	"Invalid type",
-	"Invalid type",
-	"Invalid type",
-	"Invalid type",
-	"Invalid type"
-};
-
 const char *media_type[] = { "Unknown", "Twisted Pair",
 	"Direct Attached Copper", "Fiber"
 };
@@ -6402,8 +6365,8 @@  int bnxt_hwrm_func_backing_store_qcaps_v2(struct bnxt *bp)
 			ctxm->split[i] = rte_le_to_cpu_32(*p);
 
 		PMD_DRV_LOG(DEBUG,
-			    "type:%s size:%d multiple:%d max:%d min:%d split:%d init_val:%d init_off:%d init:%d bmap:0x%x\n",
-			    bnxt_backing_store_types[ctxm->type], ctxm->entry_size,
+			    "type:0x%x size:%d multiple:%d max:%d min:%d split:%d init_val:%d init_off:%d init:%d bmap:0x%x\n",
+			    ctxm->type, ctxm->entry_size,
 			    ctxm->entry_multiple, ctxm->max_entries, ctxm->min_entries,
 			    ctxm->split_entry_cnt, init_val, init_off,
 			    BNXT_CTX_INIT_VALID(flags), ctxm->instance_bmap);
@@ -6446,8 +6409,7 @@  int bnxt_hwrm_func_backing_store_types_count(struct bnxt *bp)
 		HWRM_UNLOCK();
 
 		if (flags & HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_TYPE_VALID) {
-			PMD_DRV_LOG(DEBUG, "Valid types 0x%x - %s\n",
-				    req.type, bnxt_backing_store_types[req.type]);
+			PMD_DRV_LOG(DEBUG, "Valid types 0x%x\n", req.type);
 			types++;
 		}
 	} while (type != HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_INVALID);
@@ -6625,8 +6587,8 @@  int bnxt_hwrm_func_backing_store_cfg_v2(struct bnxt *bp,
 				      &req.page_size_pbl_level,
 				      &req.page_dir);
 		PMD_DRV_LOG(DEBUG,
-			    "Backing store config V2 type:%s last %d, instance %d, hw %d\n",
-			    bnxt_backing_store_types[req.type], ctxm->last, j, w);
+			    "Backing store config V2 type:0x%x last %d, instance %d, hw %d\n",
+			    req.type, ctxm->last, j, w);
 		if (ctxm->last && i == (w - 1))
 			req.flags =
 			rte_cpu_to_le_32(BACKING_STORE_CFG_V2_IN_FLG_CFG_ALL_DONE);