patch 'test/mcslock: scale test based on core count' has been queued to stable release 23.11.7
Shani Peretz
shperetz at nvidia.com
Wed Apr 15 11:59:48 CEST 2026
Hi,
FYI, your patch has been queued to stable release 23.11.7
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/19/26. 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/shanipr/dpdk-stable
This queued commit can be viewed at:
https://github.com/shanipr/dpdk-stable/commit/fc70c1801aa340db7e428152499738e469518f90
Thanks.
Shani
---
>From fc70c1801aa340db7e428152499738e469518f90 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Thu, 5 Mar 2026 09:50:57 -0800
Subject: [PATCH] test/mcslock: scale test based on core count
[ upstream commit f0437ade1595c54ed5d4bfa52a1a89a490170d99 ]
This test uses loops to synchronize but has problems on systems
with high number of cores. Scale iterations to the number of
cores.
Fixes: 32dcb9fd2a22 ("test/mcslock: add MCS queued lock unit test")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
app/test/test_mcslock.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/app/test/test_mcslock.c b/app/test/test_mcslock.c
index 46ff13cc00..0f5f02e957 100644
--- a/app/test/test_mcslock.c
+++ b/app/test/test_mcslock.c
@@ -43,6 +43,9 @@ RTE_ATOMIC(rte_mcslock_t *) p_ml_perf;
static unsigned int count;
static uint32_t synchro;
+#define MAX_LOOP_BASE 1000000u
+#define MAX_LOOP_MIN 10000u
+static unsigned int max_loop;
static int
test_mcslock_per_core(__rte_unused void *arg)
@@ -60,8 +63,6 @@ test_mcslock_per_core(__rte_unused void *arg)
static uint64_t time_count[RTE_MAX_LCORE] = {0};
-#define MAX_LOOP 1000000
-
static int
load_loop_fn(void *func_param)
{
@@ -78,7 +79,7 @@ load_loop_fn(void *func_param)
rte_wait_until_equal_32(&synchro, 1, __ATOMIC_RELAXED);
begin = rte_get_timer_cycles();
- while (lcount < MAX_LOOP) {
+ while (lcount < max_loop) {
if (use_lock)
rte_mcslock_lock(&p_ml_perf, &ml_perf_me);
@@ -175,6 +176,8 @@ test_mcslock(void)
rte_mcslock_t ml_me;
rte_mcslock_t ml_try_me;
+ max_loop = test_scale_iterations(MAX_LOOP_BASE, MAX_LOOP_MIN);
+
/*
* Test mcs lock & unlock on each core
*/
--
2.43.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-04-14 14:44:33.348343485 +0300
+++ 0047-test-mcslock-scale-test-based-on-core-count.patch 2026-04-14 14:44:28.635390000 +0300
@@ -1 +1 @@
-From f0437ade1595c54ed5d4bfa52a1a89a490170d99 Mon Sep 17 00:00:00 2001
+From fc70c1801aa340db7e428152499738e469518f90 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f0437ade1595c54ed5d4bfa52a1a89a490170d99 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -15,2 +16,2 @@
- app/test/test_mcslock.c | 10 +++++++---
- 1 file changed, 7 insertions(+), 3 deletions(-)
+ app/test/test_mcslock.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
@@ -19 +20 @@
-index 245df99a5d..b182da72f1 100644
+index 46ff13cc00..0f5f02e957 100644
@@ -22,2 +23 @@
-@@ -42,6 +42,10 @@ RTE_ATOMIC(rte_mcslock_t *) p_ml_perf;
-
+@@ -43,6 +43,9 @@ RTE_ATOMIC(rte_mcslock_t *) p_ml_perf;
@@ -25,0 +26 @@
+ static uint32_t synchro;
@@ -29,2 +29,0 @@
-+
- static RTE_ATOMIC(uint32_t) synchro;
@@ -33 +32,2 @@
-@@ -60,8 +64,6 @@ test_mcslock_per_core(__rte_unused void *arg)
+ test_mcslock_per_core(__rte_unused void *arg)
+@@ -60,8 +63,6 @@ test_mcslock_per_core(__rte_unused void *arg)
@@ -42,2 +42,2 @@
-@@ -78,7 +80,7 @@ load_loop_fn(void *func_param)
- rte_wait_until_equal_32((uint32_t *)(uintptr_t)&synchro, 1, rte_memory_order_relaxed);
+@@ -78,7 +79,7 @@ load_loop_fn(void *func_param)
+ rte_wait_until_equal_32(&synchro, 1, __ATOMIC_RELAXED);
@@ -51 +51 @@
-@@ -175,6 +177,8 @@ test_mcslock(void)
+@@ -175,6 +176,8 @@ test_mcslock(void)
More information about the stable
mailing list