All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: david.marchand@redhat.com, probb@iol.unh.edu,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH v2 2/2] test: simplify spawning extra test processes
Date: Fri, 20 Mar 2026 16:11:08 +0000	[thread overview]
Message-ID: <20260320161108.331745-3-bruce.richardson@intel.com> (raw)
In-Reply-To: <20260320161108.331745-1-bruce.richardson@intel.com>

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

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/process.h | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/app/test/process.h b/app/test/process.h
index df43966a2a..3ee899dbc8 100644
--- a/app/test/process.h
+++ b/app/test/process.h
@@ -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
-- 
2.51.0


  parent reply	other threads:[~2026-03-20 16:11 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19 17:11 [PATCH 0/7] Get fast-test suite to run on FreeBSD Bruce Richardson
2026-03-19 17:11 ` [PATCH 1/7] test/timer_secondary: skip test " Bruce Richardson
2026-03-20 14:03   ` Burakov, Anatoly
2026-03-19 17:11 ` [PATCH 2/7] test/eal_flags: " Bruce Richardson
2026-03-20 14:02   ` Burakov, Anatoly
2026-03-19 17:11 ` [PATCH 3/7] test/pdump: " Bruce Richardson
2026-03-19 17:16   ` Bruce Richardson
2026-03-21 16:14     ` Stephen Hemminger
2026-03-23  9:07       ` Bruce Richardson
2026-03-19 17:11 ` [PATCH 4/7] test/secondary_process: " Bruce Richardson
2026-03-20 14:02   ` Burakov, Anatoly
2026-03-19 17:11 ` [PATCH 5/7] test/external_memory: " Bruce Richardson
2026-03-20 14:01   ` Burakov, Anatoly
2026-03-19 17:11 ` [PATCH 6/7] test/interrupts: " Bruce Richardson
2026-03-20 14:01   ` Burakov, Anatoly
2026-03-19 17:11 ` [PATCH 7/7] test/debug: fix unit " Bruce Richardson
2026-03-20 14:00   ` Burakov, Anatoly
2026-03-20 14:02   ` David Marchand
2026-03-20 14:18     ` Bruce Richardson
2026-03-19 20:15 ` [PATCH 0/7] Get fast-test suite to run " Patrick Robb
2026-03-19 20:44 ` Patrick Robb
2026-03-20  8:33   ` Bruce Richardson
2026-03-20 14:25 ` David Marchand
2026-03-20 14:31   ` Bruce Richardson
2026-03-20 16:11 ` [PATCH v2 0/2] " Bruce Richardson
2026-03-20 16:11   ` [PATCH v2 1/2] test: fix failing tests " Bruce Richardson
2026-03-25 22:48     ` Thomas Monjalon
2026-03-20 16:11   ` Bruce Richardson [this message]
2026-03-25 22:50     ` [PATCH v2 2/2] test: simplify spawning extra test processes Thomas Monjalon
2026-03-24 16:31   ` [PATCH v2 0/2] Get fast-test suite to run on FreeBSD Adam Hassick
2026-04-08 17:44 ` [PATCH v3 " Bruce Richardson
2026-04-08 17:44   ` [PATCH v3 1/2] test: fix failing tests " Bruce Richardson
2026-04-08 17:44   ` [PATCH v3 2/2] test: simplify spawning extra test processes Bruce Richardson
2026-04-21 15:27     ` Bruce Richardson
2026-04-21 19:52 ` [PATCH v4 0/2] Get fast-test suite to run on FreeBSD Bruce Richardson
2026-04-21 19:52   ` [PATCH v4 1/2] test: fix failing tests " Bruce Richardson
2026-04-22  8:19     ` Mcnamara, John
2026-04-21 19:52   ` [PATCH v4 2/2] test: simplify spawning extra test processes Bruce Richardson
2026-04-22  8:20     ` Mcnamara, John
2026-04-29 14:56   ` [PATCH v4 0/2] Get fast-test suite to run on FreeBSD David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260320161108.331745-3-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=probb@iol.unh.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.