[PATCH 07/14] common/cnxk: derive mbuf from CPT CQ in inline IRQ path

Rahul Bhansali rbhansali at marvell.com
Thu Sep 17 09:10:09 CEST 2026


From: Rakesh Kudurumalla <rkudurumalla at marvell.com>

Populate mbuf from WQE_PTR_CPTR and CPTR_WQE_PTR completions, handle
WQE_PTR_ANTI_REPLAY and CPTR_ANTI_REPLAY, and pass the mbuf pointer
into the inline device work callback instead of a fixed non-NULL
sentinel.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla at marvell.com>
Signed-off-by: Rahul Bhansali <rbhansali at marvell.com>
---
 drivers/common/cnxk/roc_nix_inl_dev_irq.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/common/cnxk/roc_nix_inl_dev_irq.c b/drivers/common/cnxk/roc_nix_inl_dev_irq.c
index f99c32f30b..dcf77a29a5 100644
--- a/drivers/common/cnxk/roc_nix_inl_dev_irq.c
+++ b/drivers/common/cnxk/roc_nix_inl_dev_irq.c
@@ -51,13 +51,15 @@ nix_inl_cpt_cq_cb(struct roc_cpt_lf *lf)
 	struct idev_cfg *idev = idev_get_cfg();
 	struct nix_inl_dev *inl_dev = NULL;
 	enum nix_inl_event_type cq_type;
+	uint32_t port_id = UINT32_MAX;
 	union cpt_lf_cq_base cq_base;
 	union cpt_lf_cq_ptr cq_ptr;
+	uint64_t gw[2] = {~0ULL, 0};
 	struct roc_nix *roc_nix;
 	struct cpt_cq_s *cq_s;
 	uint8_t fmt_msk = 0x3;
 	uint32_t count, head;
-	uint32_t port_id = UINT32_MAX;
+	void *wqe = NULL;
 	uint32_t nq_ptr;
 	struct nix *nix;
 	uint64_t i;
@@ -107,16 +109,26 @@ nix_inl_cpt_cq_cb(struct roc_cpt_lf *lf)
 			switch (cq_s->w2.s.fmt & fmt_msk) {
 			case WQE_PTR_CPTR:
 				sa = (void *)cq_s->w1.esn;
+				wqe = (void *)((uintptr_t)cq_s->w3.comp_ptr & ~0x7ULL);
 				break;
 			case CPTR_WQE_PTR:
 				sa = (void *)cq_s->w3.comp_ptr;
+				wqe = (void *)((uintptr_t)cq_s->w1.esn & ~0x7ULL);
+				break;
+			case WQE_PTR_ANTI_REPLAY:
+				sa = NULL;
+				wqe = (void *)((uintptr_t)cq_s->w3.comp_ptr & ~0x7ULL);
+				break;
+			case CPTR_ANTI_REPLAY:
+				sa = (void *)cq_s->w3.comp_ptr;
+				wqe = NULL;
 				break;
 			default:
 				plt_err("Invalid event Received ");
 				goto done;
 			}
-			uint64_t tmp = ~(uint32_t)0x0;
-			inl_dev->work_cb(&tmp, sa, cq_type, (void *)cq_s, port_id);
+			gw[1] = (uint64_t)(uintptr_t)wqe;
+			inl_dev->work_cb(gw, sa, cq_type, (void *)cq_s, port_id);
 		}
 done:
 		head = (head + 1) % lf->cq_size;
-- 
2.34.1



More information about the dev mailing list