Testpmd terminated unconditionally if it failed to start all ports. The patch allows testpmd to get into the command line, if the interactive mode was requested.
Fixes: 6937d2103e22 ("app/testpmd: add option to not start device") Cc: step...@networkplumber.org Cc: sta...@dpdk.org Signed-off-by: Gregory Etelson <getel...@nvidia.com> --- v2: Add Cc. v3: Update patch. v4: Update patch. --- app/test-pmd/testpmd.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 134d79a555..e366f81a0f 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -4483,8 +4483,13 @@ main(int argc, char** argv) } } - if (!no_device_start && start_port(RTE_PORT_ALL) != 0) - rte_exit(EXIT_FAILURE, "Start ports failed\n"); + if (!no_device_start && start_port(RTE_PORT_ALL) != 0) { + if (!interactive) { + rte_eal_cleanup(); + rte_exit(EXIT_FAILURE, "Start ports failed\n"); + } + fprintf(stderr, "Start ports failed\n"); + } /* set all ports to promiscuous mode by default */ RTE_ETH_FOREACH_DEV(port_id) { -- 2.34.1