Skip to content

Commit

Permalink
app/testpmd: fix interactive mode with no ports
Browse files Browse the repository at this point in the history
[ upstream commit 7e40372522c5a129da616d1420ff582968b81b46 ]

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: 6937d21 ("app/testpmd: add option to not start device")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
  • Loading branch information
getelson-at-mellanox authored and kevintraynor committed Feb 21, 2023
1 parent f431916 commit f6a5384
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/test-pmd/testpmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -4376,8 +4376,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) {
Expand Down

0 comments on commit f6a5384

Please sign in to comment.