Skip to contentSkip to conversation

Get fast-test suite to run on FreeBSD

PATCH Superseded Bruce Richardson 8 participants 40 messages Mar 19 – Apr 29

lore
Share & tools
lore
#0 lore raw

cover Get fast-test suite to run on FreeBSD

Bugzilla ID: 761

The standard "fast-tests" suite is used to sanity-check large parts of the DPDK codebase, but it failed to run successfully on FreeBSD, with large numbers of failures. This is a long-standing issue reported in Bugzilla back in 2021 (hence the 3-digit BZ ID)

This set attempts to rectify this situation by allowing the suite to run without errors. Mostly it does this by disabling test suites that rely on features like multi-process which are unsupported on FreeBSD. It also fixes the test_debug suite which should run on BSD but was failing.

After this set, a run on my FreeBSD system passes with zero failures and 22 tests reported as skipped.

Bruce Richardson (7):
test/timer_secondary: skip test on FreeBSD
test/eal_flags: skip test on FreeBSD
test/pdump: skip test on FreeBSD
test/secondary_process: skip test on FreeBSD
test/external_memory: skip test on FreeBSD
test/interrupts: skip test on FreeBSD
test/debug: fix unit test on FreeBSD

 app/test/process.h              | 11 ++++++++---
 app/test/test_debug.c           |  6 +++---
 app/test/test_eal_flags.c       | 26 +++++++++++++-------------
 app/test/test_external_mem.c    |  4 ++--
 app/test/test_interrupts.c      |  2 +-
 app/test/test_mp_secondary.c    |  4 ++--
 app/test/test_pdump.c           |  6 ++++++
 app/test/test_timer_secondary.c |  4 ++--
 8 files changed, 37 insertions(+), 26 deletions(-)

--
2.51.0

#1 lore raw

PATCH 1/7 test/timer_secondary: skip test on FreeBSD

FreeBSD does not have multiprocess support, so skip the secondary timer autotest.

Bugzilla ID: 761 (partial fix)

Fixes 50247fe03fe0 ("test/timer: exercise new APIs in secondary process")
---
 app/test/test_timer_secondary.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test/test_timer_secondary.c +2 -2
index 57ab39130d..529774f4d0 100644
@@ -18,11 +18,11 @@
 
 #include "test.h"
 
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
 int
 test_timer_secondary(void)
 {
-	printf("timer_secondary not supported on Windows, skipping test\n");
+	printf("timer_secondary only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 #else
Signature · 1 line
2.51.0
Acked-by on v1 1/7
#2 lore raw

Re: [PATCH 1/7] test/timer_secondary: skip test on FreeBSD

Quoted 9 lines · Bruce Richardson

FreeBSD does not have multiprocess support, so skip the secondary timer autotest.

Bugzilla ID: 761 (partial fix)

Fixes 50247fe03fe0 ("test/timer: exercise new APIs in secondary process")

---

Signature · 2 lines
Thanks,
Anatoly
#3 lore raw

PATCH 2/7 test/eal_flags: skip test on FreeBSD

In reply to Bruce Richardson

EAL flags tests depend on running secondary or multiple DPDK instances so will not work on FreeBSD. Report these as SKIPPED tests on that OS.

Bugzilla ID: 761 (partial fix)

Fixes 764bf26873b9 ("add FreeBSD support")
---
 app/test/test_eal_flags.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
app/test/test_eal_flags.c +13 -13
index b3a8d0ae6f..12280e7a39 100644
@@ -10,88 +10,88 @@
 #include <string.h>
 #include <stdarg.h>
 
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
 static int
 test_missing_c_flag(void)
 {
-	printf("missing_c_flag not supported on Windows, skipping test\n");
+	printf("missing_c_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_main_lcore_flag(void)
 {
-	printf("main_lcore_flag not supported on Windows, skipping test\n");
+	printf("main_lcore_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_invalid_n_flag(void)
 {
-	printf("invalid_n_flag not supported on Windows, skipping test\n");
+	printf("invalid_n_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_no_hpet_flag(void)
 {
-	printf("no_hpet_flag not supported on Windows, skipping test\n");
+	printf("no_hpet_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_no_huge_flag(void)
 {
-	printf("no_huge_flag not supported on Windows, skipping test\n");
+	printf("no_huge_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_allow_flag(void)
 {
-	printf("allow_flag not supported on Windows, skipping test\n");
+	printf("allow_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_invalid_b_flag(void)
 {
-	printf("invalid_b_flag not supported on Windows, skipping test\n");
+	printf("invalid_b_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_invalid_vdev_flag(void)
 {
-	printf("invalid_vdev_flag not supported on Windows, skipping test\n");
+	printf("invalid_vdev_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_invalid_r_flag(void)
 {
-	printf("invalid_r_flag not supported on Windows, skipping test\n");
+	printf("invalid_r_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_memory_flags(void)
 {
-	printf("memory_flags not supported on Windows, skipping test\n");
+	printf("memory_flags only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_file_prefix(void)
 {
-	printf("file_prefix not supported on Windows, skipping test\n");
+	printf("file_prefix only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_misc_flags(void)
 {
-	printf("misc_flags not supported on Windows, skipping test\n");
+	printf("misc_flags only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
Signature · 1 line
2.51.0
Acked-by on v1 2/7
#4 lore raw

Re: [PATCH 2/7] test/eal_flags: skip test on FreeBSD

Quoted 10 lines · Bruce Richardson

EAL flags tests depend on running secondary or multiple DPDK instances so will not work on FreeBSD. Report these as SKIPPED tests on that OS.

Bugzilla ID: 761 (partial fix)

Fixes 764bf26873b9 ("add FreeBSD support")

---

Signature · 2 lines
Thanks,
Anatoly
#5 lore raw

PATCH 3/7 test/pdump: skip test on FreeBSD

In reply to Bruce Richardson

FreeBSD doesn't support multiprocess so skip the pdump unit test which requires multi-process support.

Bugzilla ID: 761 (partial fix)

Fixes 086eb64db39e ("test/pdump: add unit test for pdump library")
---
 app/test/test_pdump.c | 6 ++++++
 1 file changed, 6 insertions(+)
app/test/test_pdump.c +6 -0
index 824caef2d4..9d1175b4b0 100644
@@ -5,6 +5,7 @@
 #include <unistd.h>
 #include <stdint.h>
 #include <limits.h>
+#include <sys/utsname.h>
 
 #include <ethdev_driver.h>
 #include <rte_pdump.h>
@@ -197,7 +198,12 @@ run_pdump_server_tests(void)
 int
 test_pdump(void)
 {
+	struct utsname name;
 	int ret = 0;
+
+	if (uname(&name) < 0 || strcmp(name.sysname, "FreeBSD") == 0)
+		return TEST_SKIPPED;
+
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		printf("IN PRIMARY PROCESS\n");
 		ret = run_pdump_server_tests();
Signature · 1 line
2.51.0
#6 lore raw

Re: [PATCH 3/7] test/pdump: skip test on FreeBSD

Quoted 25 lines · Bruce Richardson

FreeBSD doesn't support multiprocess so skip the pdump unit test which requires multi-process support.

Bugzilla ID: 761 (partial fix)

Fixes 086eb64db39e ("test/pdump: add unit test for pdump library")
---
 app/test/test_pdump.c | 6 ++++++
 1 file changed, 6 insertions(+)
app/test/test_pdump.c +1 -0
index 824caef2d4..9d1175b4b0 100644
@@ -5,6 +5,7 @@
 #include <unistd.h>
 #include <stdint.h>
 #include <limits.h>
+#include <sys/utsname.h>
 
 #include <ethdev_driver.h>
 #include <rte_pdump.h>

app/test/test_pdump.c run_pdump_server_tests(void) · line 206

Quoted 9 lines
app/test/test_pdump.c +5 -0
@@ -197,7 +198,12 @@ run_pdump_server_tests(void)
 int
 test_pdump(void)
 {
+	struct utsname name;
 	int ret = 0;
+
+	if (uname(&name) < 0 || strcmp(name.sysname, "FreeBSD") == 0)
+		return TEST_SKIPPED;
+

Self-NAK, I forgot to update this patch to just use "RTE_EXEC_ENV_IS_FREEBSD" instead of calling "uname". Will fix in V2.

Quoted 6 lines
app/test/test_pdump.c +0 -0
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		printf("IN PRIMARY PROCESS\n");
 		ret = run_pdump_server_tests();
Signature · 1 line
2.51.0
#7 lore raw

Re: [PATCH 3/7] test/pdump: skip test on FreeBSD

Quoted 23 lines · On Thu, 19 Mar 2026 17:16:27 +0000 Bruce Richardson…
Quoted 22 lines · Bruce Richardson

FreeBSD doesn't support multiprocess so skip the pdump unit test which requires multi-process support.

Bugzilla ID: 761 (partial fix)

Fixes 086eb64db39e ("test/pdump: add unit test for pdump library")
---
 app/test/test_pdump.c | 6 ++++++
 1 file changed, 6 insertions(+)
app/test/test_pdump.c +1 -0
index 824caef2d4..9d1175b4b0 100644
@@ -5,6 +5,7 @@
 #include <unistd.h>
 #include <stdint.h>
 #include <limits.h>
+#include <sys/utsname.h>
 
Quoted 22 lines

app/test/test_pdump.c run_pdump_server_tests(void) · line 206

Quoted 12 lines
app/test/test_pdump.c +5 -0
 #include <ethdev_driver.h>
 #include <rte_pdump.h>
@@ -197,7 +198,12 @@ run_pdump_server_tests(void)
 int
 test_pdump(void)
 {
+	struct utsname name;
 	int ret = 0;
+
+	if (uname(&name) < 0 || strcmp(name.sysname, "FreeBSD") == 0)
+		return TEST_SKIPPED;
+  

Self-NAK, I forgot to update this patch to just use "RTE_EXEC_ENV_IS_FREEBSD" instead of calling "uname". Will fix in V2.

Quoted 6 lines
app/test/test_pdump.c +0 -0
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		printf("IN PRIMARY PROCESS\n");
 		ret = run_pdump_server_tests();
Signature · 1 line
2.51.0

Couldn't there be a common dependency in meson.build would rather not build tests for platforms that are missing the secondary_process support.

#8 lore raw

Re: [PATCH 3/7] test/pdump: skip test on FreeBSD

Quoted 49 lines · Stephen Hemminger
Quoted 23 lines · On Thu, 19 Mar 2026 17:16:27 +0000 Bruce Richardson…
Quoted 22 lines · Bruce Richardson

FreeBSD doesn't support multiprocess so skip the pdump unit test which requires multi-process support.

Bugzilla ID: 761 (partial fix)

Fixes 086eb64db39e ("test/pdump: add unit test for pdump library")
---
 app/test/test_pdump.c | 6 ++++++
 1 file changed, 6 insertions(+)
app/test/test_pdump.c +1 -0
index 824caef2d4..9d1175b4b0 100644
@@ -5,6 +5,7 @@
 #include <unistd.h>
 #include <stdint.h>
 #include <limits.h>
+#include <sys/utsname.h>
 
Quoted 22 lines

app/test/test_pdump.c run_pdump_server_tests(void) · line 206

Quoted 12 lines
app/test/test_pdump.c +5 -0
 #include <ethdev_driver.h>
 #include <rte_pdump.h>
@@ -197,7 +198,12 @@ run_pdump_server_tests(void)
 int
 test_pdump(void)
 {
+	struct utsname name;
 	int ret = 0;
+
+	if (uname(&name) < 0 || strcmp(name.sysname, "FreeBSD") == 0)
+		return TEST_SKIPPED;
+  

Self-NAK, I forgot to update this patch to just use "RTE_EXEC_ENV_IS_FREEBSD" instead of calling "uname". Will fix in V2.

Quoted 6 lines
app/test/test_pdump.c +0 -0
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		printf("IN PRIMARY PROCESS\n");
 		ret = run_pdump_server_tests();
Signature · 1 line
2.51.0
Quoted 3 lines

Couldn't there be a common dependency in meson.build would rather not build tests for platforms that are missing the secondary_process support.

We probably could engineer something like that, but I actually prefer to keep them as skipped for two reasons:

1. it makes us aware of what tests are not supported rather than having them just silently dropped.
2. for cases like this where we do a runtime check, we at least guarantee that the tests build for the platform

#9 lore raw

PATCH 4/7 test/secondary_process: skip test on FreeBSD

In reply to Bruce Richardson

Since there is no secondary process support on FreeBSD skip the unit tests for that feature.

Bugzilla ID: 761 (partial fix)

Fixes 764bf26873b9 ("add FreeBSD support")
---
 app/test/test_mp_secondary.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test/test_mp_secondary.c +2 -2
index 218eacb3bf..93fcfd735b 100644
@@ -15,11 +15,11 @@
 #include <string.h>
 #include <unistd.h>
 
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
 int
 test_mp_secondary(void)
 {
-	printf("mp_secondary not supported on Windows, skipping test\n");
+	printf("Multiprocess support on present on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 #else
Signature · 1 line
2.51.0
Acked-by on v1 4/7
#10 lore raw

Re: [PATCH 4/7] test/secondary_process: skip test on FreeBSD

Quoted 20 lines · Bruce Richardson

Since there is no secondary process support on FreeBSD skip the unit tests for that feature.

Bugzilla ID: 761 (partial fix)

Fixes 764bf26873b9 ("add FreeBSD support")
---
  app/test/test_mp_secondary.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
app/test/test_mp_secondary.c +0 -0
index 218eacb3bf..93fcfd735b 100644
@@ -15,11 +15,11 @@
  #include <string.h>
  #include <unistd.h>
 

app/test/test_mp_secondary.c line 25

Quoted 10 lines
app/test/test_mp_secondary.c +2 -2
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
  int
  test_mp_secondary(void)
  {
-	printf("mp_secondary not supported on Windows, skipping test\n");
+	printf("Multiprocess support on present on Linux, skipping test\n");
  	return TEST_SKIPPED;
  }
  #else
Signature · 2 lines
Thanks,
Anatoly
#11 lore raw

PATCH 5/7 test/external_memory: skip test on FreeBSD

In reply to Bruce Richardson

FreeBSD doesn't support external memory, so skip the test.

Bugzilla ID: 761 (partial fix)

Fixes b270daa43b3d ("test: support external memory")
---
 app/test/test_external_mem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test/test_external_mem.c +2 -2
index 1c977b749b..53300983ed 100644
@@ -10,11 +10,11 @@
 #include <string.h>
 #include <fcntl.h>
 
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
 static int
 test_external_mem(void)
 {
-	printf("external_mem not supported on Windows, skipping test\n");
+	printf("external_mem only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
Signature · 1 line
2.51.0
Acked-by on v1 5/7
#12 lore raw

Re: [PATCH 5/7] test/external_memory: skip test on FreeBSD

Quoted 19 lines · Bruce Richardson

FreeBSD doesn't support external memory, so skip the test.

Bugzilla ID: 761 (partial fix)

Fixes b270daa43b3d ("test: support external memory")
---
  app/test/test_external_mem.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
app/test/test_external_mem.c +0 -0
index 1c977b749b..53300983ed 100644
@@ -10,11 +10,11 @@
  #include <string.h>
  #include <fcntl.h>
 

app/test/test_external_mem.c line 20

Quoted 10 lines
app/test/test_external_mem.c +2 -2
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
  static int
  test_external_mem(void)
  {
-	printf("external_mem not supported on Windows, skipping test\n");
+	printf("external_mem only supported on Linux, skipping test\n");
  	return TEST_SKIPPED;
  }
 
Signature · 2 lines
Thanks,
Anatoly
#13 lore raw

PATCH 6/7 test/interrupts: skip test on FreeBSD

In reply to Bruce Richardson

FreeBSD does not have interrupt support for DPDK, so skip the test associated with that functionality.

Bugzilla ID: 761 (partial fix)

Fixes 764bf26873b9 ("add FreeBSD support")
---
 app/test/test_interrupts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test/test_interrupts.c +1 -1
index 2eb876e65a..3a5be92cd7 100644
@@ -429,7 +429,7 @@ test_interrupt(void)
 	int ret = -1;
 	struct rte_intr_handle *test_intr_handle;
 
-	if (RTE_EXEC_ENV_IS_WINDOWS)
+	if (RTE_EXEC_ENV_IS_WINDOWS || RTE_EXEC_ENV_IS_FREEBSD)
 		return TEST_SKIPPED;
 
 	if (test_interrupt_init() < 0) {
Signature · 1 line
2.51.0
Acked-by on v1 6/7
#14 lore raw

Re: [PATCH 6/7] test/interrupts: skip test on FreeBSD

Quoted 17 lines · Bruce Richardson

FreeBSD does not have interrupt support for DPDK, so skip the test associated with that functionality.

Bugzilla ID: 761 (partial fix)

Fixes 764bf26873b9 ("add FreeBSD support")
---
  app/test/test_interrupts.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
app/test/test_interrupts.c +0 -0
index 2eb876e65a..3a5be92cd7 100644

app/test/test_interrupts.c test_interrupt(void) · line 435

Quoted 8 lines
app/test/test_interrupts.c +1 -1
@@ -429,7 +429,7 @@ test_interrupt(void)
  	int ret = -1;
  	struct rte_intr_handle *test_intr_handle;
 
-	if (RTE_EXEC_ENV_IS_WINDOWS)
+	if (RTE_EXEC_ENV_IS_WINDOWS || RTE_EXEC_ENV_IS_FREEBSD)
  		return TEST_SKIPPED;
 
  	if (test_interrupt_init() < 0) {
Signature · 2 lines
Thanks,
Anatoly
#15 lore raw

PATCH 7/7 test/debug: fix unit test on FreeBSD

In reply to Bruce Richardson

Fix the test_debug unit test on FreeBSD by:
* passing no-telemetry to the additional process calls
* ensuring that we always use the no-huge and no-shconf params
* removing the dependency on procfs to get the exe and using argv[0] instead

Bugzilla ID: 761 (partial fix)

Fixes 764bf26873b9 ("add FreeBSD support")
---
 app/test/process.h    | 11 ++++++++---
 app/test/test_debug.c |  6 +++---
 2 files changed, 11 insertions(+), 6 deletions(-)
app/test/process.h +8 -3
index df43966a2a..46b69ce330 100644
@@ -96,7 +96,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 	int driver_path_num;
 	int argv_num;
 	int i, status;
-	char path[32];
+	char *path;
 #ifdef RTE_LIB_PDUMP
 #ifdef RTE_NET_RING
 	rte_thread_t thread;
@@ -188,8 +188,13 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 		/* set the environment variable */
 		if (setenv(RECURSIVE_ENV_VAR, env_value, 1) != 0)
 			rte_panic("Cannot export environment variable\n");
-
-		strlcpy(path, "/proc/" self "/" exe, sizeof(path));
+#ifdef RTE_EXEC_ENV_LINUX
+		char path_buf[32];
+		strlcpy(path_buf, "/proc/" self "/" exe, sizeof(path_buf));
+		path = path_buf;
+#else
+		path = argv_cpy[0];
+#endif
 		if (execv(path, argv_cpy) < 0) {
 			if (errno == ENOENT) {
 				printf("Could not find '%s', is procfs mounted?\n",
app/test/test_debug.c +3 -3
index bfda4d1aa3..eda9c3e0e1 100644
@@ -154,15 +154,15 @@ test_debug(void)
 	test_args[2] = "-l";
 	test_args[3] = core;
 
-	if (rte_eal_has_hugepages()) {
+	if (rte_eal_has_hugepages() && RTE_EXEC_ENV_IS_LINUX) {
 		test_args[4] = "";
 		test_args[5] = "";
 		test_args[6] = "";
 		test_args[7] = "";
 	} else {
 		test_args[4] = "--no-huge";
-		test_args[5] = "-m";
-		test_args[6] = "2048";
+		test_args[5] = "-m2048";
+		test_args[6] = "--no-telemetry";
 #ifdef RTE_ARCH_PPC_64
 		/* iova=pa is the default, but fails on ppc64 with --no-huge */
 		test_args[7] = "--iova-mode=va";
Signature · 1 line
2.51.0
Acked-by on v1 7/7
#16 lore raw

Re: [PATCH 7/7] test/debug: fix unit test on FreeBSD

Quoted 31 lines · Bruce Richardson

Fix the test_debug unit test on FreeBSD by:
* passing no-telemetry to the additional process calls
* ensuring that we always use the no-huge and no-shconf params
* removing the dependency on procfs to get the exe and using argv[0] instead

Bugzilla ID: 761 (partial fix)

Fixes 764bf26873b9 ("add FreeBSD support")
---
  app/test/process.h    | 11 ++++++++---
  app/test/test_debug.c |  6 +++---
  2 files changed, 11 insertions(+), 6 deletions(-)
app/test/process.h +1 -1
index df43966a2a..46b69ce330 100644
@@ -96,7 +96,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
  	int driver_path_num;
  	int argv_num;
  	int i, status;
-	char path[32];
+	char *path;
  #ifdef RTE_LIB_PDUMP
  #ifdef RTE_NET_RING
  	rte_thread_t thread;
@@ -188,8 +188,13 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
  		/* set the environment variable */

app/test/process.h process_dup(const char *const argv[], int numargs, const char *env_value) · line 196

Quoted 10 lines
app/test/process.h +6 -2
  		if (setenv(RECURSIVE_ENV_VAR, env_value, 1) != 0)
  			rte_panic("Cannot export environment variable\n");
-
-		strlcpy(path, "/proc/" self "/" exe, sizeof(path));
+#ifdef RTE_EXEC_ENV_LINUX
+		char path_buf[32];
+		strlcpy(path_buf, "/proc/" self "/" exe, sizeof(path_buf));
+		path = path_buf;
+#else
+		path = argv_cpy[0];

Why can't we just use argv_cpy everywhere?

Otherwise,

Signature · 2 lines
Thanks,
Anatoly
#17 lore raw

Re: [PATCH 7/7] test/debug: fix unit test on FreeBSD

In reply to Bruce Richardson
Quoted 33 lines · Bruce Richardson

Fix the test_debug unit test on FreeBSD by:
* passing no-telemetry to the additional process calls
* ensuring that we always use the no-huge and no-shconf params
* removing the dependency on procfs to get the exe and using argv[0] instead

Bugzilla ID: 761 (partial fix)

Fixes 764bf26873b9 ("add FreeBSD support")
---
 app/test/process.h    | 11 ++++++++---
 app/test/test_debug.c |  6 +++---
 2 files changed, 11 insertions(+), 6 deletions(-)
app/test/process.h +1 -1
index df43966a2a..46b69ce330 100644
@@ -96,7 +96,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
        int driver_path_num;
        int argv_num;
        int i, status;
-       char path[32];
+       char *path;
 #ifdef RTE_LIB_PDUMP
 #ifdef RTE_NET_RING
        rte_thread_t thread;
@@ -188,8 +188,13 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
                /* set the environment variable */
                if (setenv(RECURSIVE_ENV_VAR, env_value, 1) != 0)

app/test/process.h process_dup(const char *const argv[], int numargs, const char *env_value) · line 197

Quoted 10 lines
app/test/process.h +7 -2
                        rte_panic("Cannot export environment variable\n");
-
-               strlcpy(path, "/proc/" self "/" exe, sizeof(path));
+#ifdef RTE_EXEC_ENV_LINUX
+               char path_buf[32];
+               strlcpy(path_buf, "/proc/" self "/" exe, sizeof(path_buf));
+               path = path_buf;
+#else
+               path = argv_cpy[0];
+#endif

You can remove the self and exe macros that makes no sense anymore (the only left users are Linux only).

app/test/process.h process_dup(const char *const argv[], int numargs, const char *env_value) · line 198

Quoted 1 line
app/test/process.h +0 -0
                if (execv(path, argv_cpy) < 0) {

IIRC, all callers pass an array with args[0] == prgname == original argv[0] from main.

To convince myself, I ran unit tests in GHA with a dumb change:

app/test/process.h +0 -0
index df43966a2a..c9205992d2 100644
@@ -104,6 +104,9 @@ process_dup(const char *const argv[], int numargs,

const char *env_value)
#endif
#endif

+ if (argv[0] != prgname)
+ return -1;
+

        pid_t pid = fork();
        if (pid < 0)
                return -1;

So it seems that we can remove this whole exe path discovery and just pass argv_cpy[0].

app/test/process.h process_dup(const char *const argv[], int numargs, const char *env_value) · line 200

Quoted 2 lines
app/test/process.h +0 -0
                        if (errno == ENOENT) {
                                printf("Could not find '%s', is procfs mounted?\n",

Mention of procfs makes no sense for FreeBSD.

app/test/test_debug.c test_debug(void) · line 157

Quoted 10 lines
app/test/test_debug.c +1 -1
index bfda4d1aa3..eda9c3e0e1 100644
@@ -154,15 +154,15 @@ test_debug(void)
        test_args[2] = "-l";
        test_args[3] = core;
 
-       if (rte_eal_has_hugepages()) {
+       if (rte_eal_has_hugepages() && RTE_EXEC_ENV_IS_LINUX) {

I miss the reason.
Why can't we run with hugepages on FreeBSD?

Quoted 16 lines
app/test/test_debug.c +2 -3
                test_args[4] = "";
                test_args[5] = "";
                test_args[6] = "";
                test_args[7] = "";
        } else {
                test_args[4] = "--no-huge";
-               test_args[5] = "-m";
-               test_args[6] = "2048";
+               test_args[5] = "-m2048";
+               test_args[6] = "--no-telemetry";
 #ifdef RTE_ARCH_PPC_64
                /* iova=pa is the default, but fails on ppc64 with --no-huge */
                test_args[7] = "--iova-mode=va";
--

2.51.0

Signature · 1 line
David Marchand
#18 lore raw

Re: [PATCH 7/7] test/debug: fix unit test on FreeBSD

Quoted 90 lines · David Marchand
Quoted 33 lines · Bruce Richardson

Fix the test_debug unit test on FreeBSD by:
* passing no-telemetry to the additional process calls
* ensuring that we always use the no-huge and no-shconf params
* removing the dependency on procfs to get the exe and using argv[0] instead

Bugzilla ID: 761 (partial fix)

Fixes 764bf26873b9 ("add FreeBSD support")
---
 app/test/process.h    | 11 ++++++++---
 app/test/test_debug.c |  6 +++---
 2 files changed, 11 insertions(+), 6 deletions(-)
app/test/process.h +1 -1
index df43966a2a..46b69ce330 100644
@@ -96,7 +96,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
        int driver_path_num;
        int argv_num;
        int i, status;
-       char path[32];
+       char *path;
 #ifdef RTE_LIB_PDUMP
 #ifdef RTE_NET_RING
        rte_thread_t thread;
@@ -188,8 +188,13 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
                /* set the environment variable */
                if (setenv(RECURSIVE_ENV_VAR, env_value, 1) != 0)

app/test/process.h process_dup(const char *const argv[], int numargs, const char *env_value) · line 197

Quoted 10 lines
app/test/process.h +7 -2
                        rte_panic("Cannot export environment variable\n");
-
-               strlcpy(path, "/proc/" self "/" exe, sizeof(path));
+#ifdef RTE_EXEC_ENV_LINUX
+               char path_buf[32];
+               strlcpy(path_buf, "/proc/" self "/" exe, sizeof(path_buf));
+               path = path_buf;
+#else
+               path = argv_cpy[0];
+#endif

You can remove the self and exe macros that makes no sense anymore (the only left users are Linux only).

app/test/process.h process_dup(const char *const argv[], int numargs, const char *env_value) · line 198

Quoted 1 line
app/test/process.h +0 -0
                if (execv(path, argv_cpy) < 0) {

IIRC, all callers pass an array with args[0] == prgname == original argv[0] from main.

To convince myself, I ran unit tests in GHA with a dumb change:

app/test/process.h +3 -0
index df43966a2a..c9205992d2 100644
@@ -104,6 +104,9 @@ process_dup(const char *const argv[], int numargs,
 const char *env_value)
 #endif
 #endif
 
+       if (argv[0] != prgname)
+               return -1;
+
        pid_t pid = fork();
        if (pid < 0)
                return -1;

So it seems that we can remove this whole exe path discovery and just pass argv_cpy[0].

app/test/process.h process_dup(const char *const argv[], int numargs, const char *env_value) · line 200

Quoted 2 lines
app/test/process.h +0 -0
                        if (errno == ENOENT) {
                                printf("Could not find '%s', is procfs mounted?\n",

Mention of procfs makes no sense for FreeBSD.

Quoted 8 lines
app/test/test_debug.c +0 -0
index bfda4d1aa3..eda9c3e0e1 100644
@@ -154,15 +154,15 @@ test_debug(void)
        test_args[2] = "-l";
        test_args[3] = core;
 
Quoted 6 lines

app/test/test_debug.c test_debug(void) · line 157

Quoted 2 lines
app/test/test_debug.c +1 -1
-       if (rte_eal_has_hugepages()) {
+       if (rte_eal_has_hugepages() && RTE_EXEC_ENV_IS_LINUX) {

I miss the reason.
Why can't we run with hugepages on FreeBSD?

Because only one process can use them right now, so spawning a second will fail. It's a major limitation we need to fix...

#19 lore raw
In reply to Bruce Richardson

Thanks Bruce. We will apply the series and try a fast tests run on our freebsd14 VM. And if all goes well provide a tested by tag and wait for this to hit mainline so unit tests in CI can turn back on. :)

Quoted 39 lines · Bruce Richardson

Bugzilla ID: 761

The standard "fast-tests" suite is used to sanity-check large parts of the DPDK codebase, but it failed to run successfully on FreeBSD, with large numbers of failures. This is a long-standing issue reported in Bugzilla back in 2021 (hence the 3-digit BZ ID)

This set attempts to rectify this situation by allowing the suite to run without errors. Mostly it does this by disabling test suites that rely on features like multi-process which are unsupported on FreeBSD. It also fixes the test_debug suite which should run on BSD but was failing.

After this set, a run on my FreeBSD system passes with zero failures and 22 tests reported as skipped.

Bruce Richardson (7):
test/timer_secondary: skip test on FreeBSD
test/eal_flags: skip test on FreeBSD
test/pdump: skip test on FreeBSD
test/secondary_process: skip test on FreeBSD
test/external_memory: skip test on FreeBSD
test/interrupts: skip test on FreeBSD
test/debug: fix unit test on FreeBSD

 app/test/process.h              | 11 ++++++++---
 app/test/test_debug.c           |  6 +++---
 app/test/test_eal_flags.c       | 26 +++++++++++++-------------
 app/test/test_external_mem.c    |  4 ++--
 app/test/test_interrupts.c      |  2 +-
 app/test/test_mp_secondary.c    |  4 ++--
 app/test/test_pdump.c           |  6 ++++++
 app/test/test_timer_secondary.c |  4 ++--
 8 files changed, 37 insertions(+), 26 deletions(-)

--
2.51.0

Tested-by on the v1 series
#20 lore raw
In reply to Bruce Richardson

Okay, applied the patchseries and did a run on FreeBSD 14. Looks like the suites are passing but a timeout exception is raised (on the test framework execution, not on a testcase itself).

100/137 DPDK:fast-tests / pflock_autotest
OK 0.58s
101/137 DPDK:fast-tests / pie_autotest
OK 0.08s
102/137 DPDK:fast-tests / ring_pmd_autotest
OK 0.05s
103/137 DPDK:fast-tests / prefetch_autotest
OK 0.05s
104/137 DPDK:fast-tests / ptr_compress_autotest
OK 0.17s
105/137 DPDK:fast-tests / rawdev_autotest
OK 0.05s
106/137 DPDK:fast-tests / rcu_qsbr_autotest
OK 0.45s
107/137 DPDK:fast-tests / reorder_autotest
OK 0.25s
Exception in callback TestHarness._run_tests.<locals>.test_done(<Task finishe...explicitly.')>) at /usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py:1837
handle: <Handle TestHarness._run_tests.<locals>.test_done(<Task finishe...explicitly.')>) at /usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py:1837> Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1268, in wait
await complete_all(self.all_futures, timeout=timeout)
File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1180, in complete_all
check_futures(futures)
File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1168, in check_futures
raise asyncio.TimeoutError
TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.11/asyncio/events.py", line 84, in _run
self._context.run(self._callback, *self._args)
File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1839, in test_done

    f.result()

File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1834, in run_test
res = await test.run(self)
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1376, in run
await self._run_cmd(harness, cmd)
File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1442, in _run_cmd
returncode, result, additional_error = await p.wait(self.runobj.timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1270, in wait
additional_error = await self._kill()
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1231, in _kill

    await try_wait_one(p.wait(), timeout=0.5)

File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1133, in try_wait_one
await asyncio.wait(awaitables,
File "/usr/local/lib/python3.11/asyncio/tasks.py", line 425, in wait
raise TypeError("Passing coroutines is forbidden, use tasks
explicitly.")
TypeError: Passing coroutines is forbidden, use tasks explicitly. /usr/local/lib/python3.11/asyncio/events.py:84: RuntimeWarning: coroutine 'Process.wait' was never awaited
self._context.run(self._callback, *self._args)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Ok:                 87
Expected Fail:      0
Fail:               0
Unexpected Pass:    0
Skipped:            20
Timeout:            0

Full log written to /tmp/dpdk/build2/meson-logs/testlog.txt Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1268, in wait
await complete_all(self.all_futures, timeout=timeout)
File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1180, in complete_all
check_futures(futures)
File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1168, in check_futures
raise asyncio.TimeoutError
TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/mesonbuild/mesonmain.py",
line 132, in run

    return options.run_func(options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1989, in run
    return th.doit()
           ^^^^^^^^^

File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1672, in doit
self.run_tests(runners)
File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1811, in run_tests
loop.run_until_complete(self._run_tests(runners))
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 654, in
run_until_complete

    return future.result()
           ^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1901, in _run_tests
await complete(future)
File "/usr/local/lib/python3.11/site-packages/mesonbuild/mtest.py", line
1147, in complete
await future
TypeError: Passing coroutines is forbidden, use tasks explicitly. root@dpdk-freebsd14:/tmp/dpdk/build2 # echo $?
2

#21 lore raw
Quoted 4 lines · Patrick Robb

Okay, applied the patchseries and did a run on FreeBSD 14. Looks like the suites are passing but a timeout exception is raised (on the test framework execution, not on a testcase itself).

Was this with the base version of meson? Maybe try using latest version. I was testing using a relatively recent meson release.

/Bruce

#22 lore raw
In reply to Bruce Richardson
Quoted 26 lines · Bruce Richardson

Bugzilla ID: 761

The standard "fast-tests" suite is used to sanity-check large parts of the DPDK codebase, but it failed to run successfully on FreeBSD, with large numbers of failures. This is a long-standing issue reported in Bugzilla back in 2021 (hence the 3-digit BZ ID)

This set attempts to rectify this situation by allowing the suite to run without errors. Mostly it does this by disabling test suites that rely on features like multi-process which are unsupported on FreeBSD. It also fixes the test_debug suite which should run on BSD but was failing.

After this set, a run on my FreeBSD system passes with zero failures and 22 tests reported as skipped.

Bruce Richardson (7):
test/timer_secondary: skip test on FreeBSD
test/eal_flags: skip test on FreeBSD
test/pdump: skip test on FreeBSD
test/secondary_process: skip test on FreeBSD
test/external_memory: skip test on FreeBSD
test/interrupts: skip test on FreeBSD
test/debug: fix unit test on FreeBSD

Quoted 9 lines
 app/test/process.h              | 11 ++++++++---
 app/test/test_debug.c           |  6 +++---
 app/test/test_eal_flags.c       | 26 +++++++++++++-------------
 app/test/test_external_mem.c    |  4 ++--
 app/test/test_interrupts.c      |  2 +-
 app/test/test_mp_secondary.c    |  4 ++--
 app/test/test_pdump.c           |  6 ++++++
 app/test/test_timer_secondary.c |  4 ++--
 8 files changed, 37 insertions(+), 26 deletions(-)

I would put the exec discovery rework in a first patch, then squash all the rest together.
Otherwise, it lgtm on the principle.

Signature · 1 line
David Marchand
#23 lore raw
Quoted 38 lines · David Marchand
Quoted 26 lines · Bruce Richardson

Bugzilla ID: 761

The standard "fast-tests" suite is used to sanity-check large parts of the DPDK codebase, but it failed to run successfully on FreeBSD, with large numbers of failures. This is a long-standing issue reported in Bugzilla back in 2021 (hence the 3-digit BZ ID)

This set attempts to rectify this situation by allowing the suite to run without errors. Mostly it does this by disabling test suites that rely on features like multi-process which are unsupported on FreeBSD. It also fixes the test_debug suite which should run on BSD but was failing.

After this set, a run on my FreeBSD system passes with zero failures and 22 tests reported as skipped.

Bruce Richardson (7):
test/timer_secondary: skip test on FreeBSD
test/eal_flags: skip test on FreeBSD
test/pdump: skip test on FreeBSD
test/secondary_process: skip test on FreeBSD
test/external_memory: skip test on FreeBSD
test/interrupts: skip test on FreeBSD
test/debug: fix unit test on FreeBSD

Quoted 9 lines
 app/test/process.h              | 11 ++++++++---
 app/test/test_debug.c           |  6 +++---
 app/test/test_eal_flags.c       | 26 +++++++++++++-------------
 app/test/test_external_mem.c    |  4 ++--
 app/test/test_interrupts.c      |  2 +-
 app/test/test_mp_secondary.c    |  4 ++--
 app/test/test_pdump.c           |  6 ++++++
 app/test/test_timer_secondary.c |  4 ++--
 8 files changed, 37 insertions(+), 26 deletions(-)
Quoted 4 lines

I would put the exec discovery rework in a first patch, then squash all the rest together.
Otherwise, it lgtm on the principle.

Ack, will rework into a 2-patch v2.

/Bruce

#24 lore raw

v2 cover Get fast-test suite to run on FreeBSD

In reply to Bruce Richardson

The standard "fast-tests" suite is used to sanity-check large parts of the DPDK codebase, but it failed to run successfully on FreeBSD, with large numbers of failures. This is a long-standing issue reported in Bugzilla back in 2021 as issue 761.

This set attempts to rectify this situation by allowing the suite to run without errors. Mostly it does this by disabling test suites that rely on features like multi-process which are unsupported on FreeBSD. It also fixes the test_debug suite which should run on BSD but was failing.

v2:
* squash patches for fixes into patch 1
* separate patch for some cleanup of process spawning into patch 2 which does not need backport

Bruce Richardson (2):
test: fix failing tests on FreeBSD
test: simplify spawning extra test processes

 app/test/process.h              | 20 ++------------------
 app/test/test_debug.c           |  6 +++---
 app/test/test_eal_flags.c       | 26 +++++++++++++-------------
 app/test/test_external_mem.c    |  4 ++--
 app/test/test_interrupts.c      |  2 +-
 app/test/test_mp_secondary.c    |  4 ++--
 app/test/test_pdump.c           |  4 ++++
 app/test/test_timer_secondary.c |  4 ++--
 8 files changed, 29 insertions(+), 41 deletions(-)

--
2.51.0

#25 lore raw

PATCH v2 1/2 test: fix failing tests on FreeBSD

Many autotests were failing on FreeBSD, mostly because of the lack of secondary process support. Skip these tests, and also fix the debug autotest which crashes on FreeBSD if telemetry is not disabled for the extra spawned process.

Bugzilla ID: 761

Fixes 764bf26873b9 ("add FreeBSD support")
Fixes 50247fe03fe0 ("test/timer: exercise new APIs in secondary process")
Fixes 086eb64db39e ("test/pdump: add unit test for pdump library")
Fixes b270daa43b3d ("test: support external memory")
---
 app/test/test_debug.c           |  6 +++---
 app/test/test_eal_flags.c       | 26 +++++++++++++-------------
 app/test/test_external_mem.c    |  4 ++--
 app/test/test_interrupts.c      |  2 +-
 app/test/test_mp_secondary.c    |  4 ++--
 app/test/test_pdump.c           |  4 ++++
 app/test/test_timer_secondary.c |  4 ++--
 7 files changed, 27 insertions(+), 23 deletions(-)
app/test/test_debug.c +3 -3
index bfda4d1aa3..eda9c3e0e1 100644
@@ -154,15 +154,15 @@ test_debug(void)
 	test_args[2] = "-l";
 	test_args[3] = core;
 
-	if (rte_eal_has_hugepages()) {
+	if (rte_eal_has_hugepages() && RTE_EXEC_ENV_IS_LINUX) {
 		test_args[4] = "";
 		test_args[5] = "";
 		test_args[6] = "";
 		test_args[7] = "";
 	} else {
 		test_args[4] = "--no-huge";
-		test_args[5] = "-m";
-		test_args[6] = "2048";
+		test_args[5] = "-m2048";
+		test_args[6] = "--no-telemetry";
 #ifdef RTE_ARCH_PPC_64
 		/* iova=pa is the default, but fails on ppc64 with --no-huge */
 		test_args[7] = "--iova-mode=va";
app/test/test_eal_flags.c +13 -13
index b3a8d0ae6f..12280e7a39 100644
@@ -10,88 +10,88 @@
 #include <string.h>
 #include <stdarg.h>
 
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
 static int
 test_missing_c_flag(void)
 {
-	printf("missing_c_flag not supported on Windows, skipping test\n");
+	printf("missing_c_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_main_lcore_flag(void)
 {
-	printf("main_lcore_flag not supported on Windows, skipping test\n");
+	printf("main_lcore_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_invalid_n_flag(void)
 {
-	printf("invalid_n_flag not supported on Windows, skipping test\n");
+	printf("invalid_n_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_no_hpet_flag(void)
 {
-	printf("no_hpet_flag not supported on Windows, skipping test\n");
+	printf("no_hpet_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_no_huge_flag(void)
 {
-	printf("no_huge_flag not supported on Windows, skipping test\n");
+	printf("no_huge_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_allow_flag(void)
 {
-	printf("allow_flag not supported on Windows, skipping test\n");
+	printf("allow_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_invalid_b_flag(void)
 {
-	printf("invalid_b_flag not supported on Windows, skipping test\n");
+	printf("invalid_b_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_invalid_vdev_flag(void)
 {
-	printf("invalid_vdev_flag not supported on Windows, skipping test\n");
+	printf("invalid_vdev_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_invalid_r_flag(void)
 {
-	printf("invalid_r_flag not supported on Windows, skipping test\n");
+	printf("invalid_r_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_memory_flags(void)
 {
-	printf("memory_flags not supported on Windows, skipping test\n");
+	printf("memory_flags only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_file_prefix(void)
 {
-	printf("file_prefix not supported on Windows, skipping test\n");
+	printf("file_prefix only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_misc_flags(void)
 {
-	printf("misc_flags not supported on Windows, skipping test\n");
+	printf("misc_flags only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
app/test/test_external_mem.c +2 -2
index 1c977b749b..53300983ed 100644
@@ -10,11 +10,11 @@
 #include <string.h>
 #include <fcntl.h>
 
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
 static int
 test_external_mem(void)
 {
-	printf("external_mem not supported on Windows, skipping test\n");
+	printf("external_mem only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
app/test/test_interrupts.c +1 -1
index 2eb876e65a..3a5be92cd7 100644
@@ -429,7 +429,7 @@ test_interrupt(void)
 	int ret = -1;
 	struct rte_intr_handle *test_intr_handle;
 
-	if (RTE_EXEC_ENV_IS_WINDOWS)
+	if (RTE_EXEC_ENV_IS_WINDOWS || RTE_EXEC_ENV_IS_FREEBSD)
 		return TEST_SKIPPED;
 
 	if (test_interrupt_init() < 0) {
app/test/test_mp_secondary.c +2 -2
index 218eacb3bf..93fcfd735b 100644
@@ -15,11 +15,11 @@
 #include <string.h>
 #include <unistd.h>
 
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
 int
 test_mp_secondary(void)
 {
-	printf("mp_secondary not supported on Windows, skipping test\n");
+	printf("Multiprocess support on present on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 #else
app/test/test_pdump.c +4 -0
index 824caef2d4..64f1bbf21c 100644
@@ -198,6 +198,10 @@ int
 test_pdump(void)
 {
 	int ret = 0;
+
+	if (RTE_EXEC_ENV_IS_FREEBSD)
+		return TEST_SKIPPED;
+
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		printf("IN PRIMARY PROCESS\n");
 		ret = run_pdump_server_tests();
app/test/test_timer_secondary.c +2 -2
index 0fc07dcbad..8582557035 100644
@@ -16,11 +16,11 @@
 
 #include "test.h"
 
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
 int
 test_timer_secondary(void)
 {
-	printf("timer_secondary not supported on Windows, skipping test\n");
+	printf("timer_secondary only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 #else
Signature · 1 line
2.51.0
#26 lore raw

Re: [PATCH v2 1/2] test: fix failing tests on FreeBSD

20/03/2026 17:11, Bruce Richardson:

app/test/test_mp_secondary.c line 22

Quoted 4 lines

test_mp_secondary(void)
{

app/test/test_mp_secondary.c +1 -1
-	printf("mp_secondary not supported on Windows, skipping test\n");
+	printf("Multiprocess support on present on Linux, skipping test\n");

There is a typo here.

#27 lore raw

PATCH v2 2/2 test: simplify spawning extra test processes

In reply to Bruce Richardson

A number of tests require secondary processes or additional primary process instances, so we have common code for managing that in the test binary. Simplify that code a little, in the process removing dependency on procfs on FreeBSD

---
 app/test/process.h | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)
app/test/process.h +2 -18
index df43966a2a..3ee899dbc8 100644
@@ -19,14 +19,6 @@
 #include <rte_devargs.h>
 #include <rte_eal.h>
 
-#ifdef RTE_EXEC_ENV_FREEBSD
-#define self "curproc"
-#define exe "file"
-#else
-#define self "self"
-#define exe "exe"
-#endif
-
 #ifdef RTE_LIB_PDUMP
 #ifdef RTE_NET_RING
 #include <rte_thread.h>
@@ -96,7 +88,6 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 	int driver_path_num;
 	int argv_num;
 	int i, status;
-	char path[32];
 #ifdef RTE_LIB_PDUMP
 #ifdef RTE_NET_RING
 	rte_thread_t thread;
@@ -132,7 +123,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 
 #ifdef RTE_EXEC_ENV_LINUX
 		{
-			const char *procdir = "/proc/" self "/fd/";
+			const char *procdir = "/proc/self/fd/";
 			struct dirent *dirent;
 			char *endptr;
 			int fd, fdir;
@@ -188,15 +179,8 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 		/* set the environment variable */
 		if (setenv(RECURSIVE_ENV_VAR, env_value, 1) != 0)
 			rte_panic("Cannot export environment variable\n");
-
-		strlcpy(path, "/proc/" self "/" exe, sizeof(path));
-		if (execv(path, argv_cpy) < 0) {
-			if (errno == ENOENT) {
-				printf("Could not find '%s', is procfs mounted?\n",
-						path);
-			}
+		if (execv(argv_cpy[0], argv_cpy) < 0)
 			rte_panic("Cannot exec: %s\n", strerror(errno));
-		}
 	}
 	/* parent process does a wait */
 #ifdef RTE_LIB_PDUMP
Signature · 1 line
2.51.0
#28 lore raw

Re: [PATCH v2 2/2] test: simplify spawning extra test processes

20/03/2026 17:11, Bruce Richardson:

Quoted 4 lines

A number of tests require secondary processes or additional primary process instances, so we have common code for managing that in the test binary. Simplify that code a little, in the process removing dependency on procfs on FreeBSD

This commit deserves a bit more explanations I think,
saying the obvious about lacking MP support on FreeBSD and resulting dead code.

#30 lore raw

v3 cover Get fast-test suite to run on FreeBSD

In reply to Bruce Richardson

The standard "fast-tests" suite is used to sanity-check large parts of the DPDK codebase, but it failed to run successfully on FreeBSD, with large numbers of failures. This is a long-standing issue reported in Bugzilla back in 2021 as issue 761.

This set attempts to rectify this situation by allowing the suite to run without errors. Mostly it does this by disabling test suites that rely on features like multi-process which are unsupported on FreeBSD. It also fixes the test_debug suite which should run on BSD but was failing.

V3:
* fix typo in patch 1
* expand explanation in commit log of patch 2

v2:
* squash patches for fixes into patch 1
* separate patch for some cleanup of process spawning into patch 2 which does not need backport

Bruce Richardson (2):
test: fix failing tests on FreeBSD
test: simplify spawning extra test processes

 app/test/process.h              | 20 ++------------------
 app/test/test_debug.c           |  6 +++---
 app/test/test_eal_flags.c       | 26 +++++++++++++-------------
 app/test/test_external_mem.c    |  4 ++--
 app/test/test_interrupts.c      |  2 +-
 app/test/test_mp_secondary.c    |  4 ++--
 app/test/test_pdump.c           |  4 ++++
 app/test/test_timer_secondary.c |  4 ++--
 8 files changed, 29 insertions(+), 41 deletions(-)

--
2.51.0

#31 lore raw

PATCH v3 1/2 test: fix failing tests on FreeBSD

Many autotests were failing on FreeBSD, mostly because of the lack of secondary process support. Skip these tests, and also fix the debug autotest which crashes on FreeBSD if telemetry is not disabled for the extra spawned process.

Bugzilla ID: 761

Fixes 764bf26873b9 ("add FreeBSD support")
Fixes 50247fe03fe0 ("test/timer: exercise new APIs in secondary process")
Fixes 086eb64db39e ("test/pdump: add unit test for pdump library")
Fixes b270daa43b3d ("test: support external memory")
---
 app/test/test_debug.c           |  6 +++---
 app/test/test_eal_flags.c       | 26 +++++++++++++-------------
 app/test/test_external_mem.c    |  4 ++--
 app/test/test_interrupts.c      |  2 +-
 app/test/test_mp_secondary.c    |  4 ++--
 app/test/test_pdump.c           |  4 ++++
 app/test/test_timer_secondary.c |  4 ++--
 7 files changed, 27 insertions(+), 23 deletions(-)
app/test/test_debug.c +3 -3
index bfda4d1aa3..eda9c3e0e1 100644
@@ -154,15 +154,15 @@ test_debug(void)
 	test_args[2] = "-l";
 	test_args[3] = core;
 
-	if (rte_eal_has_hugepages()) {
+	if (rte_eal_has_hugepages() && RTE_EXEC_ENV_IS_LINUX) {
 		test_args[4] = "";
 		test_args[5] = "";
 		test_args[6] = "";
 		test_args[7] = "";
 	} else {
 		test_args[4] = "--no-huge";
-		test_args[5] = "-m";
-		test_args[6] = "2048";
+		test_args[5] = "-m2048";
+		test_args[6] = "--no-telemetry";
 #ifdef RTE_ARCH_PPC_64
 		/* iova=pa is the default, but fails on ppc64 with --no-huge */
 		test_args[7] = "--iova-mode=va";
app/test/test_eal_flags.c +13 -13
index b3a8d0ae6f..12280e7a39 100644
@@ -10,88 +10,88 @@
 #include <string.h>
 #include <stdarg.h>
 
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
 static int
 test_missing_c_flag(void)
 {
-	printf("missing_c_flag not supported on Windows, skipping test\n");
+	printf("missing_c_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_main_lcore_flag(void)
 {
-	printf("main_lcore_flag not supported on Windows, skipping test\n");
+	printf("main_lcore_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_invalid_n_flag(void)
 {
-	printf("invalid_n_flag not supported on Windows, skipping test\n");
+	printf("invalid_n_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_no_hpet_flag(void)
 {
-	printf("no_hpet_flag not supported on Windows, skipping test\n");
+	printf("no_hpet_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_no_huge_flag(void)
 {
-	printf("no_huge_flag not supported on Windows, skipping test\n");
+	printf("no_huge_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_allow_flag(void)
 {
-	printf("allow_flag not supported on Windows, skipping test\n");
+	printf("allow_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_invalid_b_flag(void)
 {
-	printf("invalid_b_flag not supported on Windows, skipping test\n");
+	printf("invalid_b_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_invalid_vdev_flag(void)
 {
-	printf("invalid_vdev_flag not supported on Windows, skipping test\n");
+	printf("invalid_vdev_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_invalid_r_flag(void)
 {
-	printf("invalid_r_flag not supported on Windows, skipping test\n");
+	printf("invalid_r_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_memory_flags(void)
 {
-	printf("memory_flags not supported on Windows, skipping test\n");
+	printf("memory_flags only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_file_prefix(void)
 {
-	printf("file_prefix not supported on Windows, skipping test\n");
+	printf("file_prefix only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_misc_flags(void)
 {
-	printf("misc_flags not supported on Windows, skipping test\n");
+	printf("misc_flags only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
app/test/test_external_mem.c +2 -2
index 1c977b749b..53300983ed 100644
@@ -10,11 +10,11 @@
 #include <string.h>
 #include <fcntl.h>
 
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
 static int
 test_external_mem(void)
 {
-	printf("external_mem not supported on Windows, skipping test\n");
+	printf("external_mem only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
app/test/test_interrupts.c +1 -1
index 2eb876e65a..3a5be92cd7 100644
@@ -429,7 +429,7 @@ test_interrupt(void)
 	int ret = -1;
 	struct rte_intr_handle *test_intr_handle;
 
-	if (RTE_EXEC_ENV_IS_WINDOWS)
+	if (RTE_EXEC_ENV_IS_WINDOWS || RTE_EXEC_ENV_IS_FREEBSD)
 		return TEST_SKIPPED;
 
 	if (test_interrupt_init() < 0) {
app/test/test_mp_secondary.c +2 -2
index 218eacb3bf..d89419c253 100644
@@ -15,11 +15,11 @@
 #include <string.h>
 #include <unistd.h>
 
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
 int
 test_mp_secondary(void)
 {
-	printf("mp_secondary not supported on Windows, skipping test\n");
+	printf("Multiprocess support only present on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 #else
app/test/test_pdump.c +4 -0
index 824caef2d4..64f1bbf21c 100644
@@ -198,6 +198,10 @@ int
 test_pdump(void)
 {
 	int ret = 0;
+
+	if (RTE_EXEC_ENV_IS_FREEBSD)
+		return TEST_SKIPPED;
+
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		printf("IN PRIMARY PROCESS\n");
 		ret = run_pdump_server_tests();
app/test/test_timer_secondary.c +2 -2
index 57ab39130d..529774f4d0 100644
@@ -18,11 +18,11 @@
 
 #include "test.h"
 
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
 int
 test_timer_secondary(void)
 {
-	printf("timer_secondary not supported on Windows, skipping test\n");
+	printf("timer_secondary only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 #else
Signature · 1 line
2.51.0
#32 lore raw

PATCH v3 2/2 test: simplify spawning extra test processes

In reply to Bruce Richardson

A number of tests require secondary processes or additional primary process instances, so we have common code for managing that in the test binary. Simplify that code a little, in the process removing dependency on procfs on FreeBSD, by using argv[0] as the binary to run, rather than querying procfs for /proc/self/exe (or /proc/curproc/file on FreeBSD). The unit tests should never be running in a way that leads to argv[0] not being the actual test binary.

---
 app/test/process.h | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)
app/test/process.h +2 -18
index df43966a2a..3ee899dbc8 100644
@@ -19,14 +19,6 @@
 #include <rte_devargs.h>
 #include <rte_eal.h>
 
-#ifdef RTE_EXEC_ENV_FREEBSD
-#define self "curproc"
-#define exe "file"
-#else
-#define self "self"
-#define exe "exe"
-#endif
-
 #ifdef RTE_LIB_PDUMP
 #ifdef RTE_NET_RING
 #include <rte_thread.h>
@@ -96,7 +88,6 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 	int driver_path_num;
 	int argv_num;
 	int i, status;
-	char path[32];
 #ifdef RTE_LIB_PDUMP
 #ifdef RTE_NET_RING
 	rte_thread_t thread;
@@ -132,7 +123,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 
 #ifdef RTE_EXEC_ENV_LINUX
 		{
-			const char *procdir = "/proc/" self "/fd/";
+			const char *procdir = "/proc/self/fd/";
 			struct dirent *dirent;
 			char *endptr;
 			int fd, fdir;
@@ -188,15 +179,8 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 		/* set the environment variable */
 		if (setenv(RECURSIVE_ENV_VAR, env_value, 1) != 0)
 			rte_panic("Cannot export environment variable\n");
-
-		strlcpy(path, "/proc/" self "/" exe, sizeof(path));
-		if (execv(path, argv_cpy) < 0) {
-			if (errno == ENOENT) {
-				printf("Could not find '%s', is procfs mounted?\n",
-						path);
-			}
+		if (execv(argv_cpy[0], argv_cpy) < 0)
 			rte_panic("Cannot exec: %s\n", strerror(errno));
-		}
 	}
 	/* parent process does a wait */
 #ifdef RTE_LIB_PDUMP
Signature · 1 line
2.51.0
#33 lore raw

Re: [PATCH v3 2/2] test: simplify spawning extra test processes

Quoted 8 lines · Bruce Richardson

A number of tests require secondary processes or additional primary process instances, so we have common code for managing that in the test binary. Simplify that code a little, in the process removing dependency on procfs on FreeBSD, by using argv[0] as the binary to run, rather than querying procfs for /proc/self/exe (or /proc/curproc/file on FreeBSD). The unit tests should never be running in a way that leads to argv[0] not being the actual test binary.

Quoted 6 lines
---
 app/test/process.h | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

Recheck-request: loongson-unit-loongarch64

#34 lore raw

v4 cover Get fast-test suite to run on FreeBSD

In reply to Bruce Richardson

The standard "fast-tests" suite is used to sanity-check large parts of the DPDK codebase, but it failed to run successfully on FreeBSD, with large numbers of failures. This is a long-standing issue reported in Bugzilla back in 2021 as issue 761.

This set attempts to rectify this situation by allowing the suite to run without errors. Mostly it does this by disabling test suites that rely on features like multi-process which are unsupported on FreeBSD. It also fixes the test_debug suite which should run on BSD but was failing.

V4: resubmit of v3 rebased on latest main

V3:
* fix typo in patch 1
* expand explanation in commit log of patch 2

v2:
* squash patches for fixes into patch 1
* separate patch for some cleanup of process spawning into patch 2 which does not need backport

Bruce Richardson (2):
test: fix failing tests on FreeBSD
test: simplify spawning extra test processes

 app/test/process.h              | 20 ++------------------
 app/test/test_debug.c           |  6 +++---
 app/test/test_eal_flags.c       | 26 +++++++++++++-------------
 app/test/test_external_mem.c    |  4 ++--
 app/test/test_interrupts.c      |  2 +-
 app/test/test_mp_secondary.c    |  4 ++--
 app/test/test_pdump.c           |  4 ++++
 app/test/test_timer_secondary.c |  4 ++--
 8 files changed, 29 insertions(+), 41 deletions(-)

--
2.51.0

#35 lore raw

PATCH v4 1/2 test: fix failing tests on FreeBSD

Many autotests were failing on FreeBSD, mostly because of the lack of secondary process support. Skip these tests, and also fix the debug autotest which crashes on FreeBSD if telemetry is not disabled for the extra spawned process.

Bugzilla ID: 761

Fixes 764bf26873b9 ("add FreeBSD support")
Fixes 50247fe03fe0 ("test/timer: exercise new APIs in secondary process")
Fixes 086eb64db39e ("test/pdump: add unit test for pdump library")
Fixes b270daa43b3d ("test: support external memory")
---
 app/test/test_debug.c           |  6 +++---
 app/test/test_eal_flags.c       | 26 +++++++++++++-------------
 app/test/test_external_mem.c    |  4 ++--
 app/test/test_interrupts.c      |  2 +-
 app/test/test_mp_secondary.c    |  4 ++--
 app/test/test_pdump.c           |  4 ++++
 app/test/test_timer_secondary.c |  4 ++--
 7 files changed, 27 insertions(+), 23 deletions(-)
app/test/test_debug.c +3 -3
index bfda4d1aa3..eda9c3e0e1 100644
@@ -154,15 +154,15 @@ test_debug(void)
 	test_args[2] = "-l";
 	test_args[3] = core;
 
-	if (rte_eal_has_hugepages()) {
+	if (rte_eal_has_hugepages() && RTE_EXEC_ENV_IS_LINUX) {
 		test_args[4] = "";
 		test_args[5] = "";
 		test_args[6] = "";
 		test_args[7] = "";
 	} else {
 		test_args[4] = "--no-huge";
-		test_args[5] = "-m";
-		test_args[6] = "2048";
+		test_args[5] = "-m2048";
+		test_args[6] = "--no-telemetry";
 #ifdef RTE_ARCH_PPC_64
 		/* iova=pa is the default, but fails on ppc64 with --no-huge */
 		test_args[7] = "--iova-mode=va";
app/test/test_eal_flags.c +13 -13
index 5594cc992d..b945553fcd 100644
@@ -10,88 +10,88 @@
 #include <string.h>
 #include <stdarg.h>
 
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
 static int
 test_missing_c_flag(void)
 {
-	printf("missing_c_flag not supported on Windows, skipping test\n");
+	printf("missing_c_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_main_lcore_flag(void)
 {
-	printf("main_lcore_flag not supported on Windows, skipping test\n");
+	printf("main_lcore_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_invalid_n_flag(void)
 {
-	printf("invalid_n_flag not supported on Windows, skipping test\n");
+	printf("invalid_n_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_no_hpet_flag(void)
 {
-	printf("no_hpet_flag not supported on Windows, skipping test\n");
+	printf("no_hpet_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_no_huge_flag(void)
 {
-	printf("no_huge_flag not supported on Windows, skipping test\n");
+	printf("no_huge_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_allow_flag(void)
 {
-	printf("allow_flag not supported on Windows, skipping test\n");
+	printf("allow_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_invalid_b_flag(void)
 {
-	printf("invalid_b_flag not supported on Windows, skipping test\n");
+	printf("invalid_b_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_invalid_vdev_flag(void)
 {
-	printf("invalid_vdev_flag not supported on Windows, skipping test\n");
+	printf("invalid_vdev_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_invalid_r_flag(void)
 {
-	printf("invalid_r_flag not supported on Windows, skipping test\n");
+	printf("invalid_r_flag only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_memory_flags(void)
 {
-	printf("memory_flags not supported on Windows, skipping test\n");
+	printf("memory_flags only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_file_prefix(void)
 {
-	printf("file_prefix not supported on Windows, skipping test\n");
+	printf("file_prefix only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
 test_misc_flags(void)
 {
-	printf("misc_flags not supported on Windows, skipping test\n");
+	printf("misc_flags only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
app/test/test_external_mem.c +2 -2
index 1c977b749b..53300983ed 100644
@@ -10,11 +10,11 @@
 #include <string.h>
 #include <fcntl.h>
 
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
 static int
 test_external_mem(void)
 {
-	printf("external_mem not supported on Windows, skipping test\n");
+	printf("external_mem only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 
app/test/test_interrupts.c +1 -1
index 2eb876e65a..3a5be92cd7 100644
@@ -429,7 +429,7 @@ test_interrupt(void)
 	int ret = -1;
 	struct rte_intr_handle *test_intr_handle;
 
-	if (RTE_EXEC_ENV_IS_WINDOWS)
+	if (RTE_EXEC_ENV_IS_WINDOWS || RTE_EXEC_ENV_IS_FREEBSD)
 		return TEST_SKIPPED;
 
 	if (test_interrupt_init() < 0) {
app/test/test_mp_secondary.c +2 -2
index 218eacb3bf..d89419c253 100644
@@ -15,11 +15,11 @@
 #include <string.h>
 #include <unistd.h>
 
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
 int
 test_mp_secondary(void)
 {
-	printf("mp_secondary not supported on Windows, skipping test\n");
+	printf("Multiprocess support only present on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 #else
app/test/test_pdump.c +4 -0
index 824caef2d4..64f1bbf21c 100644
@@ -198,6 +198,10 @@ int
 test_pdump(void)
 {
 	int ret = 0;
+
+	if (RTE_EXEC_ENV_IS_FREEBSD)
+		return TEST_SKIPPED;
+
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		printf("IN PRIMARY PROCESS\n");
 		ret = run_pdump_server_tests();
app/test/test_timer_secondary.c +2 -2
index 57ab39130d..529774f4d0 100644
@@ -18,11 +18,11 @@
 
 #include "test.h"
 
-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
 int
 test_timer_secondary(void)
 {
-	printf("timer_secondary not supported on Windows, skipping test\n");
+	printf("timer_secondary only supported on Linux, skipping test\n");
 	return TEST_SKIPPED;
 }
 #else
Signature · 1 line
2.51.0
Acked-by on v4 1/2
#36 lore raw

Re: [PATCH v4 1/2] test: fix failing tests on FreeBSD

________________________________
From: Bruce Richardson <[email protected]>
Sent: Tuesday, April 21, 2026 8:52 PM
To: [email protected] <[email protected]>
Cc: Richardson, Bruce <[email protected]>; [email protected] <[email protected]>; Burakov, Anatoly <[email protected]>; Adam Hassick <[email protected]>
Subject: [PATCH v4 1/2] test: fix failing tests on FreeBSD

Many autotests were failing on FreeBSD, mostly because of the lack of secondary process support. Skip these tests, and also fix the debug autotest which crashes on FreeBSD if telemetry is not disabled for the extra spawned process.

#37 lore raw

PATCH v4 2/2 test: simplify spawning extra test processes

In reply to Bruce Richardson

A number of tests require secondary processes or additional primary process instances, so we have common code for managing that in the test binary. Simplify that code a little, in the process removing dependency on procfs on FreeBSD, by using argv[0] as the binary to run, rather than querying procfs for /proc/self/exe (or /proc/curproc/file on FreeBSD). The unit tests should never be running in a way that leads to argv[0] not being the actual test binary.

---
 app/test/process.h | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)
app/test/process.h +2 -18
index df43966a2a..3ee899dbc8 100644
@@ -19,14 +19,6 @@
 #include <rte_devargs.h>
 #include <rte_eal.h>
 
-#ifdef RTE_EXEC_ENV_FREEBSD
-#define self "curproc"
-#define exe "file"
-#else
-#define self "self"
-#define exe "exe"
-#endif
-
 #ifdef RTE_LIB_PDUMP
 #ifdef RTE_NET_RING
 #include <rte_thread.h>
@@ -96,7 +88,6 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 	int driver_path_num;
 	int argv_num;
 	int i, status;
-	char path[32];
 #ifdef RTE_LIB_PDUMP
 #ifdef RTE_NET_RING
 	rte_thread_t thread;
@@ -132,7 +123,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 
 #ifdef RTE_EXEC_ENV_LINUX
 		{
-			const char *procdir = "/proc/" self "/fd/";
+			const char *procdir = "/proc/self/fd/";
 			struct dirent *dirent;
 			char *endptr;
 			int fd, fdir;
@@ -188,15 +179,8 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 		/* set the environment variable */
 		if (setenv(RECURSIVE_ENV_VAR, env_value, 1) != 0)
 			rte_panic("Cannot export environment variable\n");
-
-		strlcpy(path, "/proc/" self "/" exe, sizeof(path));
-		if (execv(path, argv_cpy) < 0) {
-			if (errno == ENOENT) {
-				printf("Could not find '%s', is procfs mounted?\n",
-						path);
-			}
+		if (execv(argv_cpy[0], argv_cpy) < 0)
 			rte_panic("Cannot exec: %s\n", strerror(errno));
-		}
 	}
 	/* parent process does a wait */
 #ifdef RTE_LIB_PDUMP
Signature · 1 line
2.51.0
Acked-by on v4 2/2
#38 lore raw

Re: [PATCH v4 2/2] test: simplify spawning extra test processes

________________________________
From: Bruce Richardson <[email protected]>
Sent: Tuesday, April 21, 2026 8:52 PM
To: [email protected] <[email protected]>
Cc: Richardson, Bruce <[email protected]>; Adam Hassick <[email protected]>
Subject: [PATCH v4 2/2] test: simplify spawning extra test processes

A number of tests require secondary processes or additional primary process instances, so we have common code for managing that in the test binary. Simplify that code a little, in the process removing dependency on procfs on FreeBSD, by using argv[0] as the binary to run, rather than querying procfs for /proc/self/exe (or /proc/curproc/file on FreeBSD). The unit tests should never be running in a way that leads to argv[0] not being the actual test binary.

#39 lore raw
In reply to Bruce Richardson
Quoted 27 lines · Bruce Richardson

The standard "fast-tests" suite is used to sanity-check large parts of the DPDK codebase, but it failed to run successfully on FreeBSD, with large numbers of failures. This is a long-standing issue reported in Bugzilla back in 2021 as issue 761.

This set attempts to rectify this situation by allowing the suite to run without errors. Mostly it does this by disabling test suites that rely on features like multi-process which are unsupported on FreeBSD. It also fixes the test_debug suite which should run on BSD but was failing.

V4: resubmit of v3 rebased on latest main

V3:
* fix typo in patch 1
* expand explanation in commit log of patch 2

v2:
* squash patches for fixes into patch 1
* separate patch for some cleanup of process spawning into patch 2 which does not need backport

Bruce Richardson (2):
test: fix failing tests on FreeBSD
test: simplify spawning extra test processes

Quoted 9 lines
 app/test/process.h              | 20 ++------------------
 app/test/test_debug.c           |  6 +++---
 app/test/test_eal_flags.c       | 26 +++++++++++++-------------
 app/test/test_external_mem.c    |  4 ++--
 app/test/test_interrupts.c      |  2 +-
 app/test/test_mp_secondary.c    |  4 ++--
 app/test/test_pdump.c           |  4 ++++
 app/test/test_timer_secondary.c |  4 ++--
 8 files changed, 29 insertions(+), 41 deletions(-)

Series applied, thanks.

Signature · 1 line
David Marchand