[dpdk-stable] patch 'mempool/octeontx2: fix shift calculation' has been queued to stable release 20.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Jul 12 15:04:51 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/14/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/7d1f406efb3819279e340e11de240ebb35cccc93

Thanks.

Luca Boccassi

---
>From 7d1f406efb3819279e340e11de240ebb35cccc93 Mon Sep 17 00:00:00 2001
From: Pavan Nikhilesh <pbhagavatula at marvell.com>
Date: Tue, 15 Jun 2021 00:54:24 +0530
Subject: [PATCH] mempool/octeontx2: fix shift calculation

[ upstream commit 43d89404950bb4d8e0efbcaebf734a0a722c2dbb ]

Shift is used to generate an 8-bit saturate value from the current
aura used count. The shift value should be derived from the log2 of
block count if it is greater than 256 else the shift should be 0.

Fixes: 7bcc47cbe2fa ("mempool/octeontx2: add mempool alloc op")

Signed-off-by: Pavan Nikhilesh <pbhagavatula at marvell.com>
---
 drivers/mempool/octeontx2/otx2_mempool_ops.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mempool/octeontx2/otx2_mempool_ops.c b/drivers/mempool/octeontx2/otx2_mempool_ops.c
index 9ff71bcf6b..d827fd8c7b 100644
--- a/drivers/mempool/octeontx2/otx2_mempool_ops.c
+++ b/drivers/mempool/octeontx2/otx2_mempool_ops.c
@@ -611,7 +611,8 @@ npa_lf_aura_pool_pair_alloc(struct otx2_npa_lf *lf, const uint32_t block_size,
 	/* Update aura fields */
 	aura->pool_addr = pool_id;/* AF will translate to associated poolctx */
 	aura->ena = 1;
-	aura->shift = __builtin_clz(block_count) - 8;
+	aura->shift = rte_log2_u32(block_count);
+	aura->shift = aura->shift < 8 ? 0 : aura->shift - 8;
 	aura->limit = block_count;
 	aura->pool_caching = 1;
 	aura->err_int_ena = BIT(NPA_AURA_ERR_INT_AURA_ADD_OVER);
@@ -626,7 +627,8 @@ npa_lf_aura_pool_pair_alloc(struct otx2_npa_lf *lf, const uint32_t block_size,
 	pool->ena = 1;
 	pool->buf_size = block_size / OTX2_ALIGN;
 	pool->stack_max_pages = stack_size;
-	pool->shift = __builtin_clz(block_count) - 8;
+	pool->shift = rte_log2_u32(block_count);
+	pool->shift = pool->shift < 8 ? 0 : pool->shift - 8;
 	pool->ptr_start = 0;
 	pool->ptr_end = ~0;
 	pool->stack_caching = 1;
-- 
2.30.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-07-12 13:41:39.565564333 +0100
+++ 0056-mempool-octeontx2-fix-shift-calculation.patch	2021-07-12 13:41:36.450121777 +0100
@@ -1 +1 @@
-From 43d89404950bb4d8e0efbcaebf734a0a722c2dbb Mon Sep 17 00:00:00 2001
+From 7d1f406efb3819279e340e11de240ebb35cccc93 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 43d89404950bb4d8e0efbcaebf734a0a722c2dbb ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list