app/testpmd: fix interactive mode with no ports
Checks
Commit Message
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")
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
---
app/test-pmd/testpmd.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
@@ -4433,8 +4433,11 @@ 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) {
+ fprintf(stderr, "Start ports failed\n");
+ if (!interactive)
+ goto eal_out;
+ }
/* set all ports to promiscuous mode by default */
RTE_ETH_FOREACH_DEV(port_id) {
@@ -4526,6 +4529,7 @@ main(int argc, char** argv)
return 1;
}
+eal_out:
ret = rte_eal_cleanup();
if (ret != 0)
rte_exit(EXIT_FAILURE,