DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH v4 06/11] app/test: pass loaded driver info to secondary procs
Date: Thu, 11 Dec 2025 17:17:04 +0000	[thread overview]
Message-ID: <20251211171709.714229-7-bruce.richardson@intel.com> (raw)
In-Reply-To: <20251211171709.714229-1-bruce.richardson@intel.com>

For unit tests which run secondary processes, allow passing the driver
paths used by the primary process to that secondary. This allows use of
mempools in those secondary tests. Without this, any tests using
mempools in secondary process will fail in shared builds.

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

diff --git a/app/test/process.h b/app/test/process.h
index f948a89786..0704616c38 100644
--- a/app/test/process.h
+++ b/app/test/process.h
@@ -18,6 +18,7 @@
 
 #include <rte_string_fns.h> /* strlcpy */
 #include <rte_devargs.h>
+#include <rte_eal.h>
 
 #ifdef RTE_EXEC_ENV_FREEBSD
 #define self "curproc"
@@ -36,6 +37,7 @@ extern uint16_t flag_for_send_pkts;
 #endif
 
 #define PREFIX_ALLOW "--allow="
+#define PREFIX_DRIVER_PATH "--driver-path="
 
 static int
 add_parameter_allow(char **argv, int max_capacity)
@@ -63,6 +65,23 @@ add_parameter_allow(char **argv, int max_capacity)
 	return count;
 }
 
+static int
+add_parameter_driver_path(char **argv, int max_capacity)
+{
+	const char *driver_path;
+	int count = 0;
+
+	RTE_EAL_DRIVER_PATH_FOREACH(driver_path, true) {
+		if (asprintf(&argv[count], PREFIX_DRIVER_PATH"%s", driver_path) < 0)
+			break;
+
+		if (++count == max_capacity)
+			break;
+	}
+
+	return count;
+}
+
 /*
  * launches a second copy of the test process using the given argv parameters,
  * which should include argv[0] as the process name. To identify in the
@@ -75,6 +94,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 	int num = 0;
 	char **argv_cpy;
 	int allow_num;
+	int driver_path_num;
 	int argv_num;
 	int i, status;
 	char path[32];
@@ -90,7 +110,8 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 		return -1;
 	else if (pid == 0) {
 		allow_num = rte_devargs_type_count(RTE_DEVTYPE_ALLOWED);
-		argv_num = numargs + allow_num + 1;
+		driver_path_num = rte_eal_driver_path_count(true);
+		argv_num = numargs + allow_num + driver_path_num + 1;
 		argv_cpy = calloc(argv_num, sizeof(char *));
 		if (!argv_cpy)
 			rte_panic("Memory allocation failed\n");
@@ -105,6 +126,11 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 			num = add_parameter_allow(&argv_cpy[i], allow_num);
 		num += numargs;
 
+		if (driver_path_num > 0) {
+			int added = add_parameter_driver_path(&argv_cpy[num], driver_path_num);
+			num += added;
+		}
+
 #ifdef RTE_EXEC_ENV_LINUX
 		{
 			const char *procdir = "/proc/" self "/fd/";
-- 
2.51.0


  parent reply	other threads:[~2025-12-11 17:17 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-02 15:49 [PATCH 0/2] improve fast-tests suite Bruce Richardson
2025-12-02 15:49 ` [PATCH 1/2] app/test: add some unattached tests to fast-test suite Bruce Richardson
2025-12-02 15:49 ` [PATCH 2/2] app/test: make parameters clearer when adding fast tests Bruce Richardson
2025-12-02 16:53   ` Marat Khalili
2025-12-02 18:16     ` Bruce Richardson
2025-12-04 18:20 ` [PATCH v2 00/10] Assign all unit tests to suites Bruce Richardson
2025-12-04 18:20   ` [PATCH v2 01/10] app/test: make parameters clearer when adding fast tests Bruce Richardson
2025-12-05 10:10     ` Marat Khalili
2025-12-05 10:17       ` Bruce Richardson
2025-12-04 18:20   ` [PATCH v2 02/10] app/test: fix undefined behaviour in red autotest Bruce Richardson
2025-12-05 10:25     ` Marat Khalili
2025-12-04 18:20   ` [PATCH v2 03/10] app/test: reduce duration of secondary timer test Bruce Richardson
2025-12-04 18:20   ` [PATCH v2 04/10] app/test: fix timer loop hang on secondary process failure Bruce Richardson
2025-12-04 18:20   ` [PATCH v2 05/10] eal: add internal APIs to query loaded driver paths Bruce Richardson
2025-12-04 18:20   ` [PATCH v2 06/10] app/test: pass loaded driver info to secondary procs Bruce Richardson
2025-12-04 18:20   ` [PATCH v2 07/10] app/test: skip power capabilities test if unsupported Bruce Richardson
2025-12-04 18:20   ` [PATCH v2 08/10] app/test: add some unattached tests to fast-test suite Bruce Richardson
2025-12-05 12:37     ` David Marchand
2025-12-05 12:43       ` Bruce Richardson
2025-12-05 12:50         ` David Marchand
2025-12-05 12:53           ` Bruce Richardson
2025-12-05 13:08             ` David Marchand
2025-12-04 18:20   ` [PATCH v2 09/10] app/test: add tests to driver test suite Bruce Richardson
2025-12-04 18:20   ` [PATCH v2 10/10] buildtools/get-test-suites: suppress empty output Bruce Richardson
2025-12-05 10:29     ` Marat Khalili
2025-12-08 11:52 ` [PATCH v3 00/11] Assign all unit tests to suites Bruce Richardson
2025-12-08 11:52   ` [PATCH v3 01/11] app/test: make parameters clearer when adding fast tests Bruce Richardson
2025-12-08 11:52   ` [PATCH v3 02/11] app/test: fix undefined behaviour in red autotest Bruce Richardson
2025-12-08 11:52   ` [PATCH v3 03/11] app/test: reduce duration of secondary timer test Bruce Richardson
2025-12-08 11:52   ` [PATCH v3 04/11] app/test: fix timer loop hang on secondary process failure Bruce Richardson
2025-12-08 11:52   ` [PATCH v3 05/11] eal: add internal APIs to query loaded driver paths Bruce Richardson
2025-12-08 19:09     ` Stephen Hemminger
2025-12-09  8:41       ` Bruce Richardson
2025-12-08 11:52   ` [PATCH v3 06/11] app/test: pass loaded driver info to secondary procs Bruce Richardson
2025-12-08 11:52   ` [PATCH v3 07/11] app/test: skip power capabilities test if unsupported Bruce Richardson
2025-12-08 11:52   ` [PATCH v3 08/11] app/test: add some unattached tests to fast-test suite Bruce Richardson
2025-12-08 11:52   ` [PATCH v3 09/11] app/test: add tests to driver test suite Bruce Richardson
2025-12-08 11:52   ` [PATCH v3 10/11] buildtools/get-test-suites: suppress empty output Bruce Richardson
2025-12-08 11:52   ` [PATCH v3 11/11] app/test: move red autotest to attic Bruce Richardson
2025-12-08 19:10   ` [PATCH v3 00/11] Assign all unit tests to suites Stephen Hemminger
2025-12-09  8:50     ` Bruce Richardson
2025-12-11 17:16 ` [PATCH v4 " Bruce Richardson
2025-12-11 17:16   ` [PATCH v4 01/11] app/test: make parameters clearer when adding fast tests Bruce Richardson
2025-12-11 17:17   ` [PATCH v4 02/11] app/test: fix undefined behaviour in red autotest Bruce Richardson
2025-12-11 17:17   ` [PATCH v4 03/11] app/test: reduce duration of secondary timer test Bruce Richardson
2025-12-11 17:17   ` [PATCH v4 04/11] app/test: fix timer loop hang on secondary process failure Bruce Richardson
2025-12-11 17:17   ` [PATCH v4 05/11] eal: add internal APIs to query loaded driver paths Bruce Richardson
2025-12-11 17:17   ` Bruce Richardson [this message]
2025-12-11 17:17   ` [PATCH v4 07/11] app/test: skip power capabilities test if unsupported Bruce Richardson
2025-12-11 17:17   ` [PATCH v4 08/11] app/test: add some unattached tests to fast-test suite Bruce Richardson
2025-12-11 17:17   ` [PATCH v4 09/11] app/test: add tests to driver test suite Bruce Richardson
2025-12-11 17:17   ` [PATCH v4 10/11] buildtools/get-test-suites: suppress empty output Bruce Richardson
2025-12-11 17:17   ` [PATCH v4 11/11] app/test: move red autotest to attic Bruce Richardson

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=20251211171709.714229-7-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).