[PATCH 3/7] crypto/caam_jr: fix descriptor dump build

Stephen Hemminger stephen at networkplumber.org
Fri Sep 4 21:12:38 CEST 2026


SEC_DUMP_DESC() grew a FILE * argument when the NXP drivers were
converted to fprintf(), but the only caller was never updated, so
building with RTE_LIBRTE_PMD_CAAM_JR_DEBUG failed with a macro
arity error.

Compiling the macro body for the first time then exposed two
further problems in it: the log format string ended in a newline,
which RTE_LOG_LINE() rejects, and descriptor pointers were cast to uint32_t,
truncating them on 64-bit builds.

Fixes: a8794e398279 ("drivers: use fprintf for debug dumps in NXP drivers")
Cc: stable at dpdk.org

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 drivers/crypto/caam_jr/caam_jr.c      | 2 +-
 drivers/crypto/caam_jr/caam_jr_desc.h | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c
index a57dc56b80..104ce52d11 100644
--- a/drivers/crypto/caam_jr/caam_jr.c
+++ b/drivers/crypto/caam_jr/caam_jr.c
@@ -462,7 +462,7 @@ caam_jr_prep_cdb(struct caam_jr_session *ses)
 	}
 
 #if CAAM_JR_DBG
-	SEC_DUMP_DESC(cdb->sh_desc);
+	SEC_DUMP_DESC(cdb->sh_desc, stdout);
 #endif
 
 	cdb->sh_hdr.hi.field.idlen = shared_desc_len;
diff --git a/drivers/crypto/caam_jr/caam_jr_desc.h b/drivers/crypto/caam_jr/caam_jr_desc.h
index eb4e68578a..845facec26 100644
--- a/drivers/crypto/caam_jr/caam_jr_desc.h
+++ b/drivers/crypto/caam_jr/caam_jr_desc.h
@@ -112,12 +112,12 @@
 /* Helper macro for dumping the hex representation of a descriptor */
 #define SEC_DUMP_DESC(descriptor, f) {					\
 	int __i;							\
-	CAAM_JR_INFO("Des@ 0x%08x\n", (uint32_t)((uint32_t *)(descriptor)));\
+	CAAM_JR_INFO("Des@ %p", (const void *)(descriptor));		\
 	for (__i = 0;						\
 		__i < SEC_GET_DESC_LEN(descriptor);			\
 		__i++) {						\
-		fprintf(f, "0x%08x: 0x%08x\n",			\
-			(uint32_t)(((uint32_t *)(descriptor)) + __i),	\
+		fprintf(f, "%p: 0x%08x\n",			\
+			(const void *)(((uint32_t *)(descriptor)) + __i), \
 			*(((uint32_t *)(descriptor)) + __i));		\
 	}								\
 }
-- 
2.53.0



More information about the dev mailing list