Skip to contentSkip to conversation

common/cnxk: fix pool buffer size in opaque mode

PATCH Applied Ashwin Sekhar T K 2 participants 3 messages Oct 13, 2023 – Oct 18, 2023

lore
Share & tools
lore
#0 lore raw

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

From: Kommula Shiva Shankar <[email protected]>

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

Fixes f765f5611240 ("common/cnxk: add NPA pool HW operations")
---
 drivers/common/cnxk/roc_npa.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/common/cnxk/roc_npa.c +5 -1
index b76b8e2342..6c14c49901 100644
@@ -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;
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Ashwin Sekhar T K

From: Kommula Shiva Shankar <[email protected]>

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

Fixes f765f5611240 ("common/cnxk: add NPA pool HW operations")
Quoted 24 lines
---
 drivers/common/cnxk/roc_npa.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/common/cnxk/roc_npa.c +5 -2
index b76b8e2342..6c14c49901 100644
@@ -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

Applied
#2 lore raw
In reply to Ashwin Sekhar T K
Quoted 9 lines · Ashwin Sekhar T K

From: Kommula Shiva Shankar <[email protected]>

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

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

Applied to dpdk-next-net-mrvl/for-next-net. Thanks

Quoted 24 lines
---
 drivers/common/cnxk/roc_npa.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/common/cnxk/roc_npa.c +5 -2
index b76b8e2342..6c14c49901 100644
@@ -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