X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-pmd%2Fparameters.c;h=6340104d33d32b006d7d5db385946ec9da5b9125;hb=ab76e2b03d6aba12542e36488723b402e25a02f6;hp=5e55263eb4aea3ed2996b068b4878abcc01a76c3;hpb=fb1a5a0fd6eb0d1fb6478402b4f4cf99c7cdd082;p=dpdk.git diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 5e55263eb4..6340104d33 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -107,6 +107,8 @@ usage(char* progname) printf(" --total-num-mbufs=N: set the number of mbufs to be allocated " "in mbuf pools.\n"); printf(" --max-pkt-len=N: set the maximum size of packet to N bytes.\n"); + printf(" --max-lro-pkt-size=N: set the maximum LRO aggregated packet " + "size to N bytes.\n"); #ifdef RTE_LIBRTE_CMDLINE printf(" --eth-peers-configfile=name: config file with ethernet addresses " "of peer ports.\n"); @@ -139,8 +141,8 @@ usage(char* progname) printf(" --enable-hw-qinq-strip: enable hardware qinq strip.\n"); printf(" --enable-drop-en: enable per queue packet drop.\n"); printf(" --disable-rss: disable rss.\n"); - printf(" --port-topology=N: set port topology (N: paired (default) or " - "chained).\n"); + printf(" --port-topology=: set port topology (paired " + "is default).\n"); printf(" --forward-mode=N: set forwarding mode (N: %s).\n", list_pkt_forwarding_modes()); printf(" --rss-ip: set RSS functions to IPv4/IPv6 only .\n"); @@ -149,6 +151,8 @@ usage(char* progname) printf(" --rxd=N: set the number of descriptors in RX rings to N.\n"); printf(" --txq=N: set the number of TX queues per port to N.\n"); printf(" --txd=N: set the number of descriptors in TX rings to N.\n"); + printf(" --hairpinq=N: set the number of hairpin queues per port to " + "N.\n"); printf(" --burst=N: set the number of packets per burst to N.\n"); printf(" --mbcache=N: set the cache of mbuf memory pool to N.\n"); printf(" --rxpt=N: set prefetch threshold register of RX rings to N.\n"); @@ -592,6 +596,7 @@ launch_args_parse(int argc, char** argv) { "mbuf-size", 1, 0, 0 }, { "total-num-mbufs", 1, 0, 0 }, { "max-pkt-len", 1, 0, 0 }, + { "max-lro-pkt-size", 1, 0, 0 }, { "pkt-filter-mode", 1, 0, 0 }, { "pkt-filter-report-hash", 1, 0, 0 }, { "pkt-filter-size", 1, 0, 0 }, @@ -622,6 +627,7 @@ launch_args_parse(int argc, char** argv) { "txq", 1, 0, 0 }, { "rxd", 1, 0, 0 }, { "txd", 1, 0, 0 }, + { "hairpinq", 1, 0, 0 }, { "burst", 1, 0, 0 }, { "mbcache", 1, 0, 0 }, { "txpt", 1, 0, 0 }, @@ -835,6 +841,8 @@ launch_args_parse(int argc, char** argv) mp_alloc_type = MP_ALLOC_XMEM; else if (!strcmp(optarg, "xmemhuge")) mp_alloc_type = MP_ALLOC_XMEM_HUGE; + else if (!strcmp(optarg, "xbuf")) + mp_alloc_type = MP_ALLOC_XBUF; else rte_exit(EXIT_FAILURE, "mp-alloc %s invalid - must be: " @@ -888,6 +896,10 @@ launch_args_parse(int argc, char** argv) "Invalid max-pkt-len=%d - should be > %d\n", n, RTE_ETHER_MIN_LEN); } + if (!strcmp(lgopts[opt_idx].name, "max-lro-pkt-size")) { + n = atoi(optarg); + rx_mode.max_lro_pkt_size = (uint32_t) n; + } if (!strcmp(lgopts[opt_idx].name, "pkt-filter-mode")) { if (!strcmp(optarg, "signature")) fdir_conf.mode = @@ -1045,6 +1057,31 @@ launch_args_parse(int argc, char** argv) " >= 0 && <= %u\n", n, get_allowed_max_nb_txq(&pid)); } + if (!strcmp(lgopts[opt_idx].name, "hairpinq")) { + n = atoi(optarg); + if (n >= 0 && + check_nb_hairpinq((queueid_t)n) == 0) + nb_hairpinq = (queueid_t) n; + else + rte_exit(EXIT_FAILURE, "txq %d invalid - must be" + " >= 0 && <= %u\n", n, + get_allowed_max_nb_hairpinq + (&pid)); + if ((n + nb_txq) < 0 || + check_nb_txq((queueid_t)(n + nb_txq)) != 0) + rte_exit(EXIT_FAILURE, "txq + hairpinq " + "%d invalid - must be" + " >= 0 && <= %u\n", + n + nb_txq, + get_allowed_max_nb_txq(&pid)); + if ((n + nb_rxq) < 0 || + check_nb_rxq((queueid_t)(n + nb_rxq)) != 0) + rte_exit(EXIT_FAILURE, "rxq + hairpinq " + "%d invalid - must be" + " >= 0 && <= %u\n", + n + nb_rxq, + get_allowed_max_nb_rxq(&pid)); + } if (!nb_rxq && !nb_txq) { rte_exit(EXIT_FAILURE, "Either rx or tx queues should " "be non-zero\n"); @@ -1328,12 +1365,19 @@ launch_args_parse(int argc, char** argv) break; default: usage(argv[0]); + printf("Invalid option: %s\n", argv[optind]); rte_exit(EXIT_FAILURE, "Command line is incomplete or incorrect\n"); break; } } + if (optind != argc) { + usage(argv[0]); + printf("Invalid parameter: %s\n", argv[optind]); + rte_exit(EXIT_FAILURE, "Command line is incorrect\n"); + } + /* Set offload configuration from command line parameters. */ rx_mode.offloads = rx_offloads; tx_mode.offloads = tx_offloads;