Skip to contentSkip to conversation

crypto/cnxk: add CPT CQ support for cn20k

PATCH Applied Tejasree Kondoj 2 participants 2 messages Nov 11, 2025 – Nov 14, 2025 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto/cnxk: add CPT CQ support for cn20k

Adding CPT CQ support for cn20k.

---
 drivers/common/cnxk/roc_cpt.c             |  3 +-
 drivers/common/cnxk/roc_cpt.h             |  2 +
 drivers/crypto/cnxk/cn20k_cryptodev_ops.c |  5 +-
 drivers/crypto/cnxk/cnxk_cryptodev_ops.c  | 83 ++++++++++++++++-------
 drivers/crypto/cnxk/cnxk_cryptodev_ops.h  |  5 +-
 5 files changed, 67 insertions(+), 31 deletions(-)
drivers/common/cnxk/roc_cpt.c +1 -2
index 4e610109b4..83e0c9896b 100644
@@ -24,7 +24,6 @@
 #define CPT_LF_MAX_NB_DESC	128000
 #define CPT_LF_DEFAULT_NB_DESC	1024
 #define CPT_LF_FC_MIN_THRESHOLD 32
-#define CQ_ENTRY_SIZE_UNIT	32
 
 static struct cpt_int_cb {
 	roc_cpt_int_misc_cb_t cb;
@@ -704,7 +703,7 @@ cpt_lf_cq_init(struct roc_cpt_lf *lf)
 	roc_cpt_cq_disable(lf);
 
 	/* Set command queue base address */
-	len = PLT_ALIGN(lf->cq_size * (CQ_ENTRY_SIZE_UNIT << lf->cq_entry_size), ROC_ALIGN);
+	len = PLT_ALIGN(lf->cq_size * (ROC_CPT_CQ_ENTRY_SIZE_UNIT << lf->cq_entry_size), ROC_ALIGN);
 	lf->cq_vaddr = plt_zmalloc(len, ROC_ALIGN);
 	if (lf->cq_vaddr == NULL)
 		return -ENOMEM;
drivers/common/cnxk/roc_cpt.h +2 -0
index 41a681e2a5..67956758be 100644
@@ -133,6 +133,8 @@
 #define ROC_CPTR_CACHE_LINE_SZ 256
 #define ROC_CPTR_ALIGN	       ROC_CPTR_CACHE_LINE_SZ
 
+#define ROC_CPT_CQ_ENTRY_SIZE_UNIT 32
+
 enum {
 	ROC_CPT_REVISION_ID_83XX = 0,
 	ROC_CPT_REVISION_ID_96XX_B0 = 1,
drivers/crypto/cnxk/cn20k_cryptodev_ops.c +3 -2
index d56f6b9d63..18100ff1f8 100644
@@ -261,8 +261,9 @@ cn20k_cpt_fill_inst(struct cnxk_cpt_qp *qp, struct rte_crypto_op *ops[], struct
 	}
 
 	inst[0].res_addr = (uint64_t)&infl_req->res;
-	rte_atomic_store_explicit((RTE_ATOMIC(uint64_t) *)(&infl_req->res.u64[0]),
-				res.u64[0], rte_memory_order_relaxed);
+	inst[0].cq_ena = 1;
+	rte_atomic_store_explicit((RTE_ATOMIC(uint64_t) *)(&infl_req->res.u64[0]), res.u64[0],
+				  rte_memory_order_relaxed);
 	infl_req->cop = op;
 
 	inst[0].w7.u64 = w7;
drivers/crypto/cnxk/cnxk_cryptodev_ops.c +58 -25

161 lines not on this page · raw message

drivers/crypto/cnxk/cnxk_cryptodev_ops.h +3 -2
index 03af1029ce..32fc7a26fc 100644
@@ -54,13 +54,15 @@ struct cpt_qp_meta_info {
 
 struct __rte_aligned(ROC_ALIGN) cpt_inflight_req {
 	union cpt_res_s res;
+	uint8_t rsvd[16];
+	uint8_t meta[META_LEN];
 	union {
 		void *opaque;
 		struct rte_crypto_op *cop;
 		struct rte_event_vector *vec;
 	};
+	void *qp;
 	void *mdata;
-	uint8_t meta[META_LEN];
 	uint8_t op_flags;
 #ifdef CPT_INST_DEBUG_ENABLE
 	uint8_t scatter_sz;
@@ -69,7 +71,6 @@ struct __rte_aligned(ROC_ALIGN) cpt_inflight_req {
 	uint8_t *dptr;
 	uint8_t *rptr;
 #endif
-	void *qp;
 };
 
 PLT_STATIC_ASSERT(sizeof(struct cpt_inflight_req) == ROC_CACHE_LINE_SZ);
Signature · 1 line
2.25.1
Applied
#1 lore raw
Quoted 13 lines

-----Original Message-----
From: Tejasree Kondoj <[email protected]>
Sent: Tuesday, November 11, 2025 4:47 PM
To: Akhil Goyal <[email protected]>
Cc: Anoob Joseph <[email protected]>; Nithinsen Kaithakadan <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>; Rakesh Kudurumalla <[email protected]>; Vidya Sagar Velumuri <[email protected]>; [email protected]
Subject: [PATCH] crypto/cnxk: add CPT CQ support for cn20k

Quoted 3 lines

Adding CPT CQ support for cn20k.

Applied to dpdk-next-crypto