patch 'mempool/cnxk: fix free from non-EAL threads' has been queued to stable release 22.11.4

Xueming Li xuemingl at nvidia.com
Sun Oct 22 16:21:41 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/15/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=0da4d859cda17cce000e86e3d2ccdf6680894e08

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 0da4d859cda17cce000e86e3d2ccdf6680894e08 Mon Sep 17 00:00:00 2001
From: Harman Kalra <hkalra at marvell.com>
Date: Tue, 22 Aug 2023 22:31:56 +0530
Subject: [PATCH] mempool/cnxk: fix free from non-EAL threads
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit e97668dd1e34c7049a7a568bb945f739d7eff9da ]

For non-EAL pthreads, rte_lcore_id() will not be valid.
So, batch free cannot be used as those threads won't have
dedicated lmtlines. So, fallback to bulk alloc in such cases.

Fixes: ecbc731a2286 ("mempool/cnxk: add cn10k batch enqueue")

Signed-off-by: Harman Kalra <hkalra at marvell.com>
Signed-off-by: Ashwin Sekhar T K <asekhar at marvell.com>
---
 drivers/mempool/cnxk/cn10k_mempool_ops.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mempool/cnxk/cn10k_mempool_ops.c b/drivers/mempool/cnxk/cn10k_mempool_ops.c
index ff0015d8de..310624730b 100644
--- a/drivers/mempool/cnxk/cn10k_mempool_ops.c
+++ b/drivers/mempool/cnxk/cn10k_mempool_ops.c
@@ -151,6 +151,12 @@ cn10k_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
 	 */
 	rte_io_wmb();

+	/* For non-EAL threads, rte_lcore_id() will not be valid. Hence
+	 * fallback to bulk alloc
+	 */
+	if (unlikely(rte_lcore_id() == LCORE_ID_ANY))
+		return cnxk_mempool_enq(mp, obj_table, n);
+
 	if (n == 1) {
 		roc_npa_aura_op_free(mp->pool_id, 1, ptr[0]);
 		return 0;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-10-22 22:17:37.025279200 +0800
+++ 0072-mempool-cnxk-fix-free-from-non-EAL-threads.patch	2023-10-22 22:17:34.296723700 +0800
@@ -1 +1 @@
-From e97668dd1e34c7049a7a568bb945f739d7eff9da Mon Sep 17 00:00:00 2001
+From 0da4d859cda17cce000e86e3d2ccdf6680894e08 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit e97668dd1e34c7049a7a568bb945f739d7eff9da ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
-index 41b755b52b..2e46204c8d 100644
+index ff0015d8de..310624730b 100644
@@ -23 +25 @@
-@@ -162,6 +162,12 @@ cn10k_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
+@@ -151,6 +151,12 @@ cn10k_mempool_enq(struct rte_mempool *mp, void *const *obj_table,


More information about the stable mailing list