DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: fix interactive mode with no ports
@ 2022-11-09 16:54 Gregory Etelson
  2022-11-09 17:09 ` [PATCH v2] " Gregory Etelson
  0 siblings, 1 reply; 9+ messages in thread
From: Gregory Etelson @ 2022-11-09 16:54 UTC (permalink / raw)
  To: dev
  Cc: getelson, matan, rasland, Aman Singh, Yuying Zhang, Ferruh Yigit,
	Stephen Hemminger

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(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 7381dfd9e5..8517f376db 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -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,
-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-01-27 23:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 16:54 [PATCH] app/testpmd: fix interactive mode with no ports Gregory Etelson
2022-11-09 17:09 ` [PATCH v2] " Gregory Etelson
2022-11-16  4:23   ` Singh, Aman Deep
2023-01-19 15:09     ` Ferruh Yigit
2023-01-19 17:16   ` [PATCH v3] " Gregory Etelson
2023-01-19 17:23   ` Gregory Etelson
2023-01-19 17:28     ` Stephen Hemminger
2023-01-19 17:45   ` [PATCH v4] " Gregory Etelson
2023-01-27 23:04     ` Ferruh Yigit

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).