[PATCH] common/cnxk: fix pool buffer size in opaque mode

Ashwin Sekhar T K asekhar at marvell.com
Fri Oct 13 18:35:48 CEST 2023


From: Kommula Shiva Shankar <kshankar at marvell.com>

Pool buffer size in opaque mode must always be set to 0.

Fixes: f765f5611240 ("common/cnxk: add NPA pool HW operations")

Signed-off-by: Kommula Shiva Shankar <kshankar at marvell.com>
Signed-off-by: Ashwin Sekhar T K <asekhar at marvell.com>
---
 drivers/common/cnxk/roc_npa.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/common/cnxk/roc_npa.c b/drivers/common/cnxk/roc_npa.c
index b76b8e2342..6c14c49901 100644
--- a/drivers/common/cnxk/roc_npa.c
+++ b/drivers/common/cnxk/roc_npa.c
@@ -517,7 +517,11 @@ npa_aura_pool_pair_alloc(struct npa_lf *lf, const uint32_t block_size,
 	/* Update pool fields */
 	pool->stack_base = mz->iova;
 	pool->ena = 1;
-	pool->buf_size = block_size / ROC_ALIGN;
+	/* In opaque mode buffer size must be 0 */
+	if (!pool->nat_align)
+		pool->buf_size = 0;
+	else
+		pool->buf_size = block_size / ROC_ALIGN;
 	pool->stack_max_pages = stack_size;
 	pool->shift = plt_log2_u32(block_count);
 	pool->shift = pool->shift < 8 ? 0 : pool->shift - 8;
-- 
2.25.1



More information about the dev mailing list