On Thu, Oct 10, 2024 at 10:56:24AM +0200, David Marchand wrote: > Hello Bruce, Ferruh, > > On Tue, Oct 8, 2024 at 3:33 AM Ferruh Yigit <ferruh.yi...@amd.com> wrote: > > > > On 10/4/2024 5:56 AM, Ferruh Yigit wrote: > > > On 8/22/2024 11:41 AM, Bruce Richardson wrote: > > >> Testpmd supports the "--cmdline-file" parameter to read a set of initial > > >> commands from a file. However, the only indication that this has been > > >> done successfully on startup is a single-line message, no output from > > >> the commands is seen. > > >> > > >> To improve usability here, we can use cmdline_new rather than > > >> cmdline_file_new and have the output from the various commands sent to > > >> stdout, allowing the user to see better what is happening. > > >> > > >> Signed-off-by: Bruce Richardson <bruce.richard...@intel.com> > > >> > > >> --- > > >> v2: use STDOUT_FILENO in place of hard-coded "1" > > >> --- > > >> > > > > > > After discussion, I think it is OK to have the update in the testpmd > > > (instead of a new function in cmdline), hence; > > > > > > Acked-by: Ferruh Yigit <ferruh.yi...@amd.com> > > Applied to dpdk-next-net/main, thanks. > > This patch triggers an error in UNH for Windows builds. > Can you have a look? > > https://lab.dpdk.org/results/dashboard/testruns/logs/1386705/ > Looks like I should have kept the hard-coded 1 after all! :-(
Anyway, something like this should fix the issue, I think: diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 1fc1cce5fe..bfa0e77dce 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -68,6 +68,10 @@ #include "cmdline_tm.h" #include "bpf_cmd.h" +#ifndef STDOUT_FILENO +#define STDOUT_FILENO _fileno(stdout) +#endif + static struct cmdline *testpmd_cl; static cmdline_parse_ctx_t *main_ctx; static TAILQ_HEAD(, testpmd_driver_commands) driver_commands_head = However, this is a fix only for this specific testpmd instance. I see that unistd.h is present in "lib/eal/windows/include" in DPDK, so I'm thinking maybe we add these macros there. WDYT? /Bruce