From: Bruce Richardson <bruce.richardson@intel.com>
To: David Marchand <david.marchand@redhat.com>
Cc: <dev@dpdk.org>, <lylavoie@iol.unh.edu>, <probb@iol.unh.edu>,
<stable@dpdk.org>
Subject: Re: [PATCH 7/7] test/debug: fix unit test on FreeBSD
Date: Fri, 20 Mar 2026 14:18:03 +0000 [thread overview]
Message-ID: <ab1XG_ehiP4NTUkV@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <CAJFAV8ztqM2i3QTWQV7E_fo=N3DRJpvxUBvT3ykJtXyRwQ+bEA@mail.gmail.com>
On Fri, Mar 20, 2026 at 03:02:54PM +0100, David Marchand wrote:
> On Thu, 19 Mar 2026 at 18:14, Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > 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")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> > app/test/process.h | 11 ++++++++---
> > app/test/test_debug.c | 6 +++---
> > 2 files changed, 11 insertions(+), 6 deletions(-)
> >
> > diff --git a/app/test/process.h b/app/test/process.h
> > index df43966a2a..46b69ce330 100644
> > --- a/app/test/process.h
> > +++ b/app/test/process.h
> > @@ -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
>
> You can remove the self and exe macros that makes no sense anymore
> (the only left users are Linux only).
>
>
> > 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:
> diff --git a/app/test/process.h b/app/test/process.h
> index df43966a2a..c9205992d2 100644
> --- a/app/test/process.h
> +++ b/app/test/process.h
> @@ -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].
>
>
> > if (errno == ENOENT) {
> > printf("Could not find '%s', is procfs mounted?\n",
>
> Mention of procfs makes no sense for FreeBSD.
>
>
> > diff --git a/app/test/test_debug.c b/app/test/test_debug.c
> > index bfda4d1aa3..eda9c3e0e1 100644
> > --- a/app/test/test_debug.c
> > +++ b/app/test/test_debug.c
> > @@ -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?
>
Because only one process can use them right now, so spawning a second will
fail. It's a major limitation we need to fix...
next prev parent reply other threads:[~2026-03-20 14:18 UTC|newest]
Thread overview: 33+ 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 [this message]
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 ` [PATCH v2 2/2] test: simplify spawning extra test processes Bruce Richardson
2026-03-25 22:50 ` 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
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=ab1XG_ehiP4NTUkV@bricha3-mobl1.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=lylavoie@iol.unh.edu \
--cc=probb@iol.unh.edu \
--cc=stable@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