app/testpmd: add parameter to start forwarding Tx first
[dpdk.git] / app / test-pmd / parameters.c
index fbe6284..0a88844 100644 (file)
@@ -89,6 +89,7 @@ usage(char* progname)
               "[--cmdline-file=FILENAME] "
 #endif
               "[--help|-h] | [--auto-start|-a] | ["
+              "--tx-first | "
               "--coremask=COREMASK --portmask=PORTMASK --numa "
               "--mbuf-size= | --total-num-mbufs= | "
               "--nb-cores= | --nb-ports= | "
@@ -109,6 +110,8 @@ usage(char* progname)
        printf("  --auto-start: start forwarding on init "
               "[always when non-interactive].\n");
        printf("  --help: display this message and quit.\n");
+       printf("  --tx-first: start forwarding sending a burst first "
+              "(only if interactive is disabled).\n");
        printf("  --nb-cores=N: set the number of forwarding cores "
               "(1 <= N <= %d).\n", nb_lcores);
        printf("  --nb-ports=N: set the number of forwarding ports "
@@ -566,6 +569,7 @@ launch_args_parse(int argc, char** argv)
                { "eth-peers-configfile",       1, 0, 0 },
                { "eth-peer",                   1, 0, 0 },
 #endif
+               { "tx-first",                   0, 0, 0 },
                { "ports",                      1, 0, 0 },
                { "nb-cores",                   1, 0, 0 },
                { "nb-ports",                   1, 0, 0 },
@@ -674,6 +678,11 @@ launch_args_parse(int argc, char** argv)
                                printf("Auto-start selected\n");
                                auto_start = 1;
                        }
+                       if (!strcmp(lgopts[opt_idx].name, "tx-first")) {
+                               printf("Ports to start sending a burst of "
+                                               "packets first\n");
+                               tx_first = 1;
+                       }
                        if (!strcmp(lgopts[opt_idx].name,
                                    "eth-peers-configfile")) {
                                if (init_peer_eth_addrs(optarg) != 0)