app/test: remove use of coremasks

Message ID 20251201181024.1583767-1-bruce.richardson@intel.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series app/test: remove use of coremasks |

Checks

Context Check Description
ci/loongarch-compilation success Compilation OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/github-robot-post success github post: success
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS RETEST #1
ci/iol-mellanox-Performance success Performance Testing PASS RETEST #1
ci/iol-compile-amd64-testing success Testing PASS RETEST #1
ci/iol-broadcom-Performance success Performance Testing PASS RETEST #1
ci/iol-compile-arm64-testing success Testing PASS RETEST #1
ci/iol-sample-apps-testing success Testing PASS RETEST #1
ci/iol-unit-arm64-testing success Testing PASS RETEST #1
ci/iol-mellanox-Functional success Functional Testing PASS RETEST #1
ci/iol-intel-Performance success Performance Testing PASS RETEST #1
ci/iol-intel-Functional success Functional Testing PASS RETEST #1

Commit Message

Bruce Richardson Dec. 1, 2025, 6:10 p.m. UTC
A number of test cases spawned off secondary processes and used the
"-c", or coremask, EAL option to do so. This option is deprecated, so
replace it with "-l" in tests.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/test_mp_secondary.c    | 13 ++++++-------
 app/test/test_pdump.c           |  7 +++----
 app/test/test_timer_secondary.c |  6 +++---
 3 files changed, 12 insertions(+), 14 deletions(-)
  

Comments

Stephen Hemminger Dec. 1, 2025, 6:37 p.m. UTC | #1
On Mon,  1 Dec 2025 18:10:24 +0000
Bruce Richardson <bruce.richardson@intel.com> wrote:

> A number of test cases spawned off secondary processes and used the
> "-c", or coremask, EAL option to do so. This option is deprecated, so
> replace it with "-l" in tests.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---

Acked-by: Stephen Hemminger <stephen@networkplumber.org>
  
fengchengwen Dec. 2, 2025, 1:07 a.m. UTC | #2
Acked-by: Chengwen Feng <fengchengwen@huawei.com>

On 12/2/2025 2:10 AM, Bruce Richardson wrote:
> A number of test cases spawned off secondary processes and used the
> "-c", or coremask, EAL option to do so. This option is deprecated, so
> replace it with "-l" in tests.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
  
Bruce Richardson Dec. 5, 2025, 9:32 a.m. UTC | #3
On Mon, Dec 01, 2025 at 06:10:24PM +0000, Bruce Richardson wrote:
> A number of test cases spawned off secondary processes and used the
> "-c", or coremask, EAL option to do so. This option is deprecated, so
> replace it with "-l" in tests.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  app/test/test_mp_secondary.c    | 13 ++++++-------
>  app/test/test_pdump.c           |  7 +++----
>  app/test/test_timer_secondary.c |  6 +++---
>  3 files changed, 12 insertions(+), 14 deletions(-)
> 
Recheck-request: iol-intel-Performance
  

Patch

diff --git a/app/test/test_mp_secondary.c b/app/test/test_mp_secondary.c
index f3694530a8..2593454b2c 100644
--- a/app/test/test_mp_secondary.c
+++ b/app/test/test_mp_secondary.c
@@ -66,7 +66,7 @@  static int
 run_secondary_instances(void)
 {
 	int ret = 0;
-	char coremask[10];
+	char core_str[10];
 
 #ifdef RTE_EXEC_ENV_LINUX
 	char tmp[PATH_MAX] = {0};
@@ -81,29 +81,28 @@  run_secondary_instances(void)
 
 	/* good case, using secondary */
 	const char *argv1[] = {
-			prgname, "-c", coremask, "--proc-type=secondary",
+			prgname, "-l", core_str, "--proc-type=secondary",
 			prefix
 	};
 	/* good case, using auto */
 	const char *argv2[] = {
-			prgname, "-c", coremask, "--proc-type=auto",
+			prgname, "-l", core_str, "--proc-type=auto",
 			prefix
 	};
 	/* bad case, using invalid type */
 	const char *argv3[] = {
-			prgname, "-c", coremask, "--proc-type=ERROR",
+			prgname, "-l", core_str, "--proc-type=ERROR",
 			prefix
 	};
 #ifdef RTE_EXEC_ENV_LINUX
 	/* bad case, using invalid file prefix */
 	const char *argv4[]  = {
-			prgname, "-c", coremask, "--proc-type=secondary",
+			prgname, "-l", core_str, "--proc-type=secondary",
 					"--file-prefix=ERROR"
 	};
 #endif
 
-	snprintf(coremask, sizeof(coremask), "%x", \
-			(1 << rte_get_main_lcore()));
+	snprintf(core_str, sizeof(core_str), "%u", rte_get_main_lcore());
 
 	ret |= launch_proc(argv1);
 	printf("### Testing rte_mp_disable() reject:\n");
diff --git a/app/test/test_pdump.c b/app/test/test_pdump.c
index 9f7769707e..1d3fe6e2d5 100644
--- a/app/test/test_pdump.c
+++ b/app/test/test_pdump.c
@@ -173,7 +173,7 @@  int
 run_pdump_server_tests(void)
 {
 	int ret = 0;
-	char coremask[10];
+	char core_str[10];
 
 #ifdef RTE_EXEC_ENV_LINUX
 	char tmp[PATH_MAX] = { 0 };
@@ -187,12 +187,11 @@  run_pdump_server_tests(void)
 
 	/* good case, using secondary */
 	const char *const argv1[] = {
-		prgname, "-c", coremask, "--proc-type=secondary",
+		prgname, "-l", core_str, "--proc-type=secondary",
 		prefix
 	};
 
-	snprintf(coremask, sizeof(coremask), "%x",
-		 (1 << rte_get_main_lcore()));
+	snprintf(core_str, sizeof(core_str), "%u", rte_get_main_lcore());
 
 	ret = test_pdump_init();
 	ret |= launch_p(argv1);
diff --git a/app/test/test_timer_secondary.c b/app/test/test_timer_secondary.c
index 4e220559b4..60ce8c7507 100644
--- a/app/test/test_timer_secondary.c
+++ b/app/test/test_timer_secondary.c
@@ -50,7 +50,7 @@  struct test_info {
 static int
 timer_secondary_spawn_wait(unsigned int lcore)
 {
-	char coremask[10];
+	char core_str[10];
 #ifdef RTE_EXEC_ENV_LINUXAPP
 	char tmp[PATH_MAX] = {0};
 	char prefix[PATH_MAX] = {0};
@@ -63,12 +63,12 @@  timer_secondary_spawn_wait(unsigned int lcore)
 #endif
 	char const *argv[] = {
 		prgname,
-		"-c", coremask,
+		"-l", core_str,
 		"--proc-type=secondary",
 		prefix
 	};
 
-	snprintf(coremask, sizeof(coremask), "%x", (1 << lcore));
+	snprintf(core_str, sizeof(core_str), "%u", lcore);
 
 	return launch_proc(argv);
 }