Merge branch 'upstream-16.11-stable' into 16.11.x
[deb_dpdk.git] / app / test-pmd / parameters.c
index 55572eb..4a74ada 100644 (file)
@@ -63,7 +63,6 @@
 #include <rte_lcore.h>
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
-#include <rte_ring.h>
 #include <rte_mempool.h>
 #include <rte_interrupts.h>
 #include <rte_pci.h>
@@ -149,7 +148,8 @@ usage(char* progname)
               "the packet will be enqueued into the rx drop-queue. "
               "If the drop-queue doesn't exist, the packet is dropped. "
               "By default drop-queue=127.\n");
-       printf("  --crc-strip: enable CRC stripping by hardware.\n");
+       printf("  --disable-crc-strip: disable CRC stripping by hardware.\n");
+       printf("  --enable-lro: enable large receive offload.\n");
        printf("  --enable-rx-cksum: enable rx hardware checksum offload.\n");
        printf("  --disable-hw-vlan: disable hardware vlan.\n");
        printf("  --disable-hw-vlan-filter: disable hardware vlan filter.\n");
@@ -191,7 +191,8 @@ usage(char* progname)
               "(0 <= mapping <= %d).\n", RTE_ETHDEV_QUEUE_STAT_CNTRS - 1);
        printf("  --no-flush-rx: Don't flush RX streams before forwarding."
               " Used mainly with PCAP drivers.\n");
-       printf("  --txpkts=X[,Y]*: set TX segment sizes.\n");
+       printf("  --txpkts=X[,Y]*: set TX segment sizes"
+               " or total packet length.\n");
        printf("  --disable-link-check: disable check on link status when "
               "starting/stopping ports.\n");
 }
@@ -359,7 +360,8 @@ parse_portnuma_config(const char *q_arg)
        char s[256];
        const char *p, *p0 = q_arg;
        char *end;
-       uint8_t i,port_id,socket_id;
+       uint8_t i, socket_id;
+       portid_t port_id;
        unsigned size;
        enum fieldnames {
                FLD_PORT = 0,
@@ -368,7 +370,6 @@ parse_portnuma_config(const char *q_arg)
        };
        unsigned long int_fld[_NUM_FLD];
        char *str_fld[_NUM_FLD];
-       portid_t pid;
 
        /* reset from value set at definition */
        while ((p = strchr(p0,'(')) != NULL) {
@@ -389,12 +390,10 @@ parse_portnuma_config(const char *q_arg)
                        if (errno != 0 || end == str_fld[i] || int_fld[i] > 255)
                                return -1;
                }
-               port_id = (uint8_t)int_fld[FLD_PORT];
-               if (port_id_is_invalid(port_id, ENABLED_WARN)) {
-                       printf("Valid port range is [0");
-                       FOREACH_PORT(pid, ports)
-                               printf(", %d", pid);
-                       printf("]\n");
+               port_id = (portid_t)int_fld[FLD_PORT];
+               if (port_id_is_invalid(port_id, ENABLED_WARN) ||
+                       port_id == (portid_t)RTE_PORT_ALL) {
+                       print_valid_ports();
                        return -1;
                }
                socket_id = (uint8_t)int_fld[FLD_SOCKET];
@@ -415,7 +414,8 @@ parse_ringnuma_config(const char *q_arg)
        char s[256];
        const char *p, *p0 = q_arg;
        char *end;
-       uint8_t i,port_id,ring_flag,socket_id;
+       uint8_t i, ring_flag, socket_id;
+       portid_t port_id;
        unsigned size;
        enum fieldnames {
                FLD_PORT = 0,
@@ -425,7 +425,6 @@ parse_ringnuma_config(const char *q_arg)
        };
        unsigned long int_fld[_NUM_FLD];
        char *str_fld[_NUM_FLD];
-       portid_t pid;
        #define RX_RING_ONLY 0x1
        #define TX_RING_ONLY 0x2
        #define RXTX_RING    0x3
@@ -449,12 +448,10 @@ parse_ringnuma_config(const char *q_arg)
                        if (errno != 0 || end == str_fld[i] || int_fld[i] > 255)
                                return -1;
                }
-               port_id = (uint8_t)int_fld[FLD_PORT];
-               if (port_id_is_invalid(port_id, ENABLED_WARN)) {
-                       printf("Valid port range is [0");
-                       FOREACH_PORT(pid, ports)
-                               printf(", %d", pid);
-                       printf("]\n");
+               port_id = (portid_t)int_fld[FLD_PORT];
+               if (port_id_is_invalid(port_id, ENABLED_WARN) ||
+                       port_id == (portid_t)RTE_PORT_ALL) {
+                       print_valid_ports();
                        return -1;
                }
                socket_id = (uint8_t)int_fld[FLD_SOCKET];
@@ -524,8 +521,10 @@ launch_args_parse(int argc, char** argv)
                { "pkt-filter-report-hash",     1, 0, 0 },
                { "pkt-filter-size",            1, 0, 0 },
                { "pkt-filter-drop-queue",      1, 0, 0 },
-               { "crc-strip",                  0, 0, 0 },
+               { "disable-crc-strip",                  0, 0, 0 },
+               { "enable-lro",                 0, 0, 0 },
                { "enable-rx-cksum",            0, 0, 0 },
+               { "enable-scatter",             0, 0, 0 },
                { "disable-hw-vlan",            0, 0, 0 },
                { "disable-hw-vlan-filter",     0, 0, 0 },
                { "disable-hw-vlan-strip",      0, 0, 0 },
@@ -762,8 +761,12 @@ launch_args_parse(int argc, char** argv)
                                                 "drop queue %d invalid - must"
                                                 "be >= 0 \n", n);
                        }
-                       if (!strcmp(lgopts[opt_idx].name, "crc-strip"))
-                               rx_mode.hw_strip_crc = 1;
+                       if (!strcmp(lgopts[opt_idx].name, "disable-crc-strip"))
+                               rx_mode.hw_strip_crc = 0;
+                       if (!strcmp(lgopts[opt_idx].name, "enable-lro"))
+                               rx_mode.enable_lro = 1;
+                       if (!strcmp(lgopts[opt_idx].name, "enable-scatter"))
+                               rx_mode.enable_scatter = 1;
                        if (!strcmp(lgopts[opt_idx].name, "enable-rx-cksum"))
                                rx_mode.hw_ip_checksum = 1;
 
@@ -799,7 +802,7 @@ launch_args_parse(int argc, char** argv)
                                        port_topology = PORT_TOPOLOGY_LOOP;
                                else
                                        rte_exit(EXIT_FAILURE, "port-topology %s invalid -"
-                                                " must be: paired or chained \n",
+                                                " must be: paired, chained or loop\n",
                                                 optarg);
                        }
                        if (!strcmp(lgopts[opt_idx].name, "forward-mode"))