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

Xueming Li xuemingl at nvidia.com
Sun Oct 22 16:21:42 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=1ef99ed9dd5ecb32f1ebac1788045281ae3d59c8

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 1ef99ed9dd5ecb32f1ebac1788045281ae3d59c8 Mon Sep 17 00:00:00 2001
From: Ashwin Sekhar T K <asekhar at marvell.com>
Date: Tue, 22 Aug 2023 22:31:57 +0530
Subject: [PATCH] mempool/cnxk: fix alloc from non-EAL threads
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit b3ddd649ad063eb90035836b64b22fb4d6fea8b7 ]

For non-EAL pthreads, rte_lcore_id() will not be valid.
So, batch allocation cannot be used as we won't have a
dedicated alloc buffer for the thread. So, fallback to
bulk alloc in such cases.

Fixes: 91531e63f43b ("mempool/cnxk: add cn10k batch dequeue")

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 310624730b..9d6982fdab 100644
--- a/drivers/mempool/cnxk/cn10k_mempool_ops.c
+++ b/drivers/mempool/cnxk/cn10k_mempool_ops.c
@@ -257,6 +257,12 @@ cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table, unsigned int n)
 		}
 	}

+	/* 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_deq(mp, obj_table, n);
+
 	if (unlikely(count != n)) {
 		/* No partial alloc allowed. Free up allocated pointers */
 		cn10k_mempool_enq(mp, obj_table, count);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-10-22 22:17:37.056866500 +0800
+++ 0073-mempool-cnxk-fix-alloc-from-non-EAL-threads.patch	2023-10-22 22:17:34.296723700 +0800
@@ -1 +1 @@
-From b3ddd649ad063eb90035836b64b22fb4d6fea8b7 Mon Sep 17 00:00:00 2001
+From 1ef99ed9dd5ecb32f1ebac1788045281ae3d59c8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit b3ddd649ad063eb90035836b64b22fb4d6fea8b7 ]
@@ -12 +14,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
-index 2e46204c8d..2a5aad0008 100644
+index 310624730b..9d6982fdab 100644
@@ -23,3 +25,3 @@
-@@ -332,6 +332,12 @@ cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table, unsigned int n)
- 	struct batch_op_data *op_data;
- 	unsigned int count = 0;
+@@ -257,6 +257,12 @@ cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table, unsigned int n)
+ 		}
+ 	}
@@ -33,3 +35,3 @@
- 	op_data = batch_op_data_get(mp->pool_id);
- 	if (op_data->max_async_batch)
- 		count = mempool_deq_batch_async(mp, obj_table, n);
+ 	if (unlikely(count != n)) {
+ 		/* No partial alloc allowed. Free up allocated pointers */
+ 		cn10k_mempool_enq(mp, obj_table, count);


More information about the stable mailing list