From: Stephen Hemminger Date: Tue, 16 Jul 2019 18:42:34 +0000 (-0700) Subject: app/testpmd: add option to not start device X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6937d2103e22778c4181a10092663f7ed61d17dc;p=dpdk.git app/testpmd: add option to not start device Some configuration options can not be tested properly with testpmd because it automatically starts all ports. This makes it harder to test driver handling of configuration options: (for example rx_deferred_start). Add new command line flag --disable-device-start which skips the device start. The port can then be started manually later. Signed-off-by: Stephen Hemminger Reviewed-by: Ferruh Yigit --- diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 16358ea00c..5244872c4a 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -174,6 +174,7 @@ usage(char* progname) printf(" --txonly-multi-flow: generate multiple flows in txonly mode\n"); printf(" --disable-link-check: disable check on link status when " "starting/stopping ports.\n"); + printf(" --disable-device-start: do not automatically start port\n"); printf(" --no-lsc-interrupt: disable link status change interrupt.\n"); printf(" --no-rmv-interrupt: disable device removal interrupt.\n"); printf(" --bitrate-stats=N: set the logical core N to perform " @@ -634,6 +635,7 @@ launch_args_parse(int argc, char** argv) { "txpkts", 1, 0, 0 }, { "txonly-multi-flow", 0, 0, 0 }, { "disable-link-check", 0, 0, 0 }, + { "disable-device-start", 0, 0, 0 }, { "no-lsc-interrupt", 0, 0, 0 }, { "no-rmv-interrupt", 0, 0, 0 }, { "print-event", 1, 0, 0 }, @@ -1196,6 +1198,8 @@ launch_args_parse(int argc, char** argv) no_flush_rx = 1; if (!strcmp(lgopts[opt_idx].name, "disable-link-check")) no_link_check = 1; + if (!strcmp(lgopts[opt_idx].name, "disable-device-start")) + no_device_start = 1; if (!strcmp(lgopts[opt_idx].name, "no-lsc-interrupt")) lsc_interrupt = 0; if (!strcmp(lgopts[opt_idx].name, "no-rmv-interrupt")) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index a3b1542ed3..518865a7db 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -339,6 +339,11 @@ uint8_t flow_isolate_all; */ uint8_t no_link_check = 0; /* check by default */ +/* + * Don't automatically start all ports in interactive mode. + */ +uint8_t no_device_start = 0; + /* * Enable link status change notification */ @@ -3333,7 +3338,7 @@ main(int argc, char** argv) } } - if (start_port(RTE_PORT_ALL) != 0) + if (!no_device_start && start_port(RTE_PORT_ALL) != 0) rte_exit(EXIT_FAILURE, "Start ports failed\n"); /* set all ports to promiscuous mode by default */ diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 77994546e8..ce13eb8e6a 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -323,6 +323,7 @@ extern uint8_t flow_isolate_all; /**< set by "--flow-isolate-all */ extern uint8_t mp_alloc_type; /**< set by "--mp-anon" or "--mp-alloc" parameter */ extern uint8_t no_link_check; /**