X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-pmd%2Fparameters.c;h=36f7dd83375cf8770468155d9e6bd6e196578515;hb=487f9a592a273bbb0534652bc836cabc0af14100;hp=73da65a9a8c396663c04063e9a439ec0f893a98a;hpb=284c908cc588e6448e25199773aea998c7cccd78;p=dpdk.git diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 73da65a9a8..36f7dd8337 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -86,6 +86,7 @@ usage(char* progname) printf("usage: %s " #ifdef RTE_LIBRTE_CMDLINE "[--interactive|-i] " + "[--cmdline-file=FILENAME] " #endif "[--help|-h] | [--auto-start|-a] | [" "--coremask=COREMASK --portmask=PORTMASK --numa " @@ -103,6 +104,7 @@ usage(char* progname) progname); #ifdef RTE_LIBRTE_CMDLINE printf(" --interactive: run in interactive mode.\n"); + printf(" --cmdline-file: execute cli commands before startup.\n"); #endif printf(" --auto-start: start forwarding on init " "[always when non-interactive].\n"); @@ -201,7 +203,9 @@ usage(char* progname) printf(" --disable-link-check: disable check on link status when " "starting/stopping ports.\n"); printf(" --no-lsc-interrupt: disable link status change interrupt.\n"); - printf(" --no-rmv-interrupt: disable device removal interrupt."); + printf(" --no-rmv-interrupt: disable device removal interrupt.\n"); + printf(" --bitrate-stats=N: set the logical core N to perform " + "bit-rate calculation.\n"); } #ifdef RTE_LIBRTE_CMDLINE @@ -511,6 +515,7 @@ launch_args_parse(int argc, char** argv) { "help", 0, 0, 0 }, #ifdef RTE_LIBRTE_CMDLINE { "interactive", 0, 0, 0 }, + { "cmdline-file", 1, 0, 0 }, { "auto-start", 0, 0, 0 }, { "eth-peers-configfile", 1, 0, 0 }, { "eth-peer", 1, 0, 0 }, @@ -521,6 +526,7 @@ launch_args_parse(int argc, char** argv) { "coremask", 1, 0, 0 }, { "portmask", 1, 0, 0 }, { "numa", 0, 0, 0 }, + { "no-numa", 0, 0, 0 }, { "mp-anon", 0, 0, 0 }, { "port-numa-config", 1, 0, 0 }, { "ring-numa-config", 1, 0, 0 }, @@ -534,6 +540,9 @@ launch_args_parse(int argc, char** argv) { "pkt-filter-drop-queue", 1, 0, 0 }, #ifdef RTE_LIBRTE_LATENCY_STATS { "latencystats", 1, 0, 0 }, +#endif +#ifdef RTE_LIBRTE_BITRATE + { "bitrate-stats", 1, 0, 0 }, #endif { "disable-crc-strip", 0, 0, 0 }, { "enable-lro", 0, 0, 0 }, @@ -606,6 +615,13 @@ launch_args_parse(int argc, char** argv) printf("Interactive-mode selected\n"); interactive = 1; } + if (!strcmp(lgopts[opt_idx].name, "cmdline-file")) { + printf("CLI commands to be read from %s\n", + optarg); + snprintf(cmdline_filename, + sizeof(cmdline_filename), "%s", + optarg); + } if (!strcmp(lgopts[opt_idx].name, "auto-start")) { printf("Auto-start selected\n"); auto_start = 1; @@ -662,12 +678,10 @@ launch_args_parse(int argc, char** argv) parse_fwd_coremask(optarg); if (!strcmp(lgopts[opt_idx].name, "portmask")) parse_fwd_portmask(optarg); - if (!strcmp(lgopts[opt_idx].name, "numa")) { + if (!strcmp(lgopts[opt_idx].name, "no-numa")) + numa_support = 0; + if (!strcmp(lgopts[opt_idx].name, "numa")) numa_support = 1; - memset(port_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS); - memset(rxring_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS); - memset(txring_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS); - } if (!strcmp(lgopts[opt_idx].name, "mp-anon")) { mp_anon = 1; } @@ -789,6 +803,18 @@ launch_args_parse(int argc, char** argv) "invalid lcore id %d for latencystats" " must be >= 0\n", n); } +#endif +#ifdef RTE_LIBRTE_BITRATE + if (!strcmp(lgopts[opt_idx].name, "bitrate-stats")) { + n = atoi(optarg); + if (n >= 0) { + bitrate_lcore_id = (lcoreid_t) n; + bitrate_enabled = 1; + } else + rte_exit(EXIT_FAILURE, + "invalid lcore id %d for bitrate stats" + " must be >= 0\n", n); + } #endif if (!strcmp(lgopts[opt_idx].name, "disable-crc-strip")) rx_mode.hw_strip_crc = 0;