eal/x86: add 128-bit atomic compare exchange
[dpdk.git] / app / test-pmd / parameters.c
index 9220e1c..7b6b609 100644 (file)
@@ -173,6 +173,7 @@ usage(char* progname)
               " Used mainly with PCAP drivers.\n");
        printf("  --txpkts=X[,Y]*: set TX segment sizes"
                " or total packet length.\n");
+       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("  --no-lsc-interrupt: disable link status change interrupt.\n");
@@ -190,6 +191,17 @@ usage(char* progname)
        printf("  --vxlan-gpe-port=N: UPD port of tunnel VXLAN-GPE\n");
        printf("  --mlockall: lock all memory\n");
        printf("  --no-mlockall: do not lock all memory\n");
+       printf("  --mp-alloc <native|anon|xmem|xmemhuge>: mempool allocation method.\n"
+              "    native: use regular DPDK memory to create and populate mempool\n"
+              "    anon: use regular DPDK memory to create and anonymous memory to populate mempool\n"
+              "    xmem: use anonymous memory to create and populate mempool\n"
+              "    xmemhuge: use anonymous hugepage memory to create and populate mempool\n");
+       printf("  --noisy-tx-sw-buffer-size=N: size of FIFO buffer\n");
+       printf("  --noisy-tx-sw-buffer-flushtime=N: flush FIFO after N ms\n");
+       printf("  --noisy-lkup-memory=N: allocate N MB of VNF memory\n");
+       printf("  --noisy-lkup-num-writes=N: do N random writes per packet\n");
+       printf("  --noisy-lkup-num-reads=N: do N random reads per packet\n");
+       printf("  --noisy-lkup-num-writes=N: do N random reads and writes per packet\n");
 }
 
 #ifdef RTE_LIBRTE_CMDLINE
@@ -405,8 +417,11 @@ parse_portnuma_config(const char *q_arg)
                }
                socket_id = (uint8_t)int_fld[FLD_SOCKET];
                if (new_socket_id(socket_id)) {
-                       print_invalid_socket_id_error();
-                       return -1;
+                       if (num_sockets >= RTE_MAX_NUMA_NODES) {
+                               print_invalid_socket_id_error();
+                               return -1;
+                       }
+                       socket_ids[num_sockets++] = socket_id;
                }
                port_numa[port_id] = socket_id;
        }
@@ -462,8 +477,11 @@ parse_ringnuma_config(const char *q_arg)
                }
                socket_id = (uint8_t)int_fld[FLD_SOCKET];
                if (new_socket_id(socket_id)) {
-                       print_invalid_socket_id_error();
-                       return -1;
+                       if (num_sockets >= RTE_MAX_NUMA_NODES) {
+                               print_invalid_socket_id_error();
+                               return -1;
+                       }
+                       socket_ids[num_sockets++] = socket_id;
                }
                ring_flag = (uint8_t)int_fld[FLD_FLAG];
                if ((ring_flag < RX_RING_ONLY) || (ring_flag > RXTX_RING)) {
@@ -615,6 +633,7 @@ launch_args_parse(int argc, char** argv)
                { "no-flush-rx",        0, 0, 0 },
                { "flow-isolate-all",           0, 0, 0 },
                { "txpkts",                     1, 0, 0 },
+               { "txonly-multi-flow",          0, 0, 0 },
                { "disable-link-check",         0, 0, 0 },
                { "no-lsc-interrupt",           0, 0, 0 },
                { "no-rmv-interrupt",           0, 0, 0 },
@@ -625,6 +644,13 @@ launch_args_parse(int argc, char** argv)
                { "vxlan-gpe-port",             1, 0, 0 },
                { "mlockall",                   0, 0, 0 },
                { "no-mlockall",                0, 0, 0 },
+               { "mp-alloc",                   1, 0, 0 },
+               { "noisy-tx-sw-buffer-size",    1, 0, 0 },
+               { "noisy-tx-sw-buffer-flushtime", 1, 0, 0 },
+               { "noisy-lkup-memory",          1, 0, 0 },
+               { "noisy-lkup-num-writes",      1, 0, 0 },
+               { "noisy-lkup-num-reads",       1, 0, 0 },
+               { "noisy-lkup-num-reads-writes", 1, 0, 0 },
                { 0, 0, 0, 0 },
        };
 
@@ -743,7 +769,22 @@ launch_args_parse(int argc, char** argv)
                        if (!strcmp(lgopts[opt_idx].name, "numa"))
                                numa_support = 1;
                        if (!strcmp(lgopts[opt_idx].name, "mp-anon")) {
-                               mp_anon = 1;
+                               mp_alloc_type = MP_ALLOC_ANON;
+                       }
+                       if (!strcmp(lgopts[opt_idx].name, "mp-alloc")) {
+                               if (!strcmp(optarg, "native"))
+                                       mp_alloc_type = MP_ALLOC_NATIVE;
+                               else if (!strcmp(optarg, "anon"))
+                                       mp_alloc_type = MP_ALLOC_ANON;
+                               else if (!strcmp(optarg, "xmem"))
+                                       mp_alloc_type = MP_ALLOC_XMEM;
+                               else if (!strcmp(optarg, "xmemhuge"))
+                                       mp_alloc_type = MP_ALLOC_XMEM_HUGE;
+                               else
+                                       rte_exit(EXIT_FAILURE,
+                                               "mp-alloc %s invalid - must be: "
+                                               "native, anon, xmem or xmemhuge\n",
+                                                optarg);
                        }
                        if (!strcmp(lgopts[opt_idx].name, "port-numa-config")) {
                                if (parse_portnuma_config(optarg))
@@ -1102,6 +1143,8 @@ launch_args_parse(int argc, char** argv)
                                else
                                        rte_exit(EXIT_FAILURE, "bad txpkts\n");
                        }
+                       if (!strcmp(lgopts[opt_idx].name, "txonly-multi-flow"))
+                               txonly_multi_flow = 1;
                        if (!strcmp(lgopts[opt_idx].name, "no-flush-rx"))
                                no_flush_rx = 1;
                        if (!strcmp(lgopts[opt_idx].name, "disable-link-check"))
@@ -1145,6 +1188,60 @@ launch_args_parse(int argc, char** argv)
                                do_mlockall = 1;
                        if (!strcmp(lgopts[opt_idx].name, "no-mlockall"))
                                do_mlockall = 0;
+                       if (!strcmp(lgopts[opt_idx].name,
+                                   "noisy-tx-sw-buffer-size")) {
+                               n = atoi(optarg);
+                               if (n >= 0)
+                                       noisy_tx_sw_bufsz = n;
+                               else
+                                       rte_exit(EXIT_FAILURE,
+                                               "noisy-tx-sw-buffer-size must be >= 0\n");
+                       }
+                       if (!strcmp(lgopts[opt_idx].name,
+                                   "noisy-tx-sw-buffer-flushtime")) {
+                               n = atoi(optarg);
+                               if (n >= 0)
+                                       noisy_tx_sw_buf_flush_time = n;
+                               else
+                                       rte_exit(EXIT_FAILURE,
+                                                "noisy-tx-sw-buffer-flushtime must be >= 0\n");
+                       }
+                       if (!strcmp(lgopts[opt_idx].name,
+                                   "noisy-lkup-memory")) {
+                               n = atoi(optarg);
+                               if (n >= 0)
+                                       noisy_lkup_mem_sz = n;
+                               else
+                                       rte_exit(EXIT_FAILURE,
+                                                "noisy-lkup-memory must be >= 0\n");
+                       }
+                       if (!strcmp(lgopts[opt_idx].name,
+                                   "noisy-lkup-num-writes")) {
+                               n = atoi(optarg);
+                               if (n >= 0)
+                                       noisy_lkup_num_writes = n;
+                               else
+                                       rte_exit(EXIT_FAILURE,
+                                                "noisy-lkup-num-writes must be >= 0\n");
+                       }
+                       if (!strcmp(lgopts[opt_idx].name,
+                                   "noisy-lkup-num-reads")) {
+                               n = atoi(optarg);
+                               if (n >= 0)
+                                       noisy_lkup_num_reads = n;
+                               else
+                                       rte_exit(EXIT_FAILURE,
+                                                "noisy-lkup-num-reads must be >= 0\n");
+                       }
+                       if (!strcmp(lgopts[opt_idx].name,
+                                   "noisy-lkup-num-reads-writes")) {
+                               n = atoi(optarg);
+                               if (n >= 0)
+                                       noisy_lkup_num_reads_writes = n;
+                               else
+                                       rte_exit(EXIT_FAILURE,
+                                                "noisy-lkup-num-reads-writes must be >= 0\n");
+                       }
                        break;
                case 'h':
                        usage(argv[0]);