app/testpmd: request link status interrupt
[dpdk.git] / app / test-pmd / parameters.c
index 9573a43..e3499cd 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
 #include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_launch.h>
-#include <rte_tailq.h>
 #include <rte_eal.h>
 #include <rte_per_lcore.h>
 #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>
@@ -78,6 +76,7 @@
 #ifdef RTE_LIBRTE_PMD_BOND
 #include <rte_eth_bond.h>
 #endif
+#include <rte_flow.h>
 
 #include "testpmd.h"
 
@@ -145,18 +144,22 @@ usage(char* progname)
               "(N: none  or match (default) or always).\n");
        printf("  --pkt-filter-size=N: set Flow Director mode "
               "(N: 64K (default mode) or 128K or 256K).\n");
-       printf("  --pkt-filter-flexbytes-offset=N: set flexbytes-offset. "
-              "The offset is defined in word units counted from the "
-              "first byte of the destination Ethernet MAC address. "
-              "0 <= N <= 32.\n");
        printf("  --pkt-filter-drop-queue=N: set drop-queue. "
               "In perfect mode, when you add a rule with queue = -1 "
               "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");
+#ifdef RTE_LIBRTE_LATENCY_STATS
+       printf("  --latencystats=N: enable latency and jitter statistcs "
+              "monitoring on forwarding lcore id N.\n");
+#endif
+       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");
+       printf("  --disable-hw-vlan-strip: disable hardware vlan strip.\n");
+       printf("  --disable-hw-vlan-extend: disable hardware vlan extend.\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 "
@@ -171,20 +174,14 @@ usage(char* progname)
        printf("  --txd=N: set the number of descriptors in TX rings 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 "
-              "(0 <= N <= 16).\n");
-       printf("  --rxht=N: set the host threshold register of RX rings to N "
-              "(0 <= N <= 16).\n");
+       printf("  --rxpt=N: set prefetch threshold register of RX rings to N.\n");
+       printf("  --rxht=N: set the host threshold register of RX rings to N.\n");
        printf("  --rxfreet=N: set the free threshold of RX descriptors to N "
               "(0 <= N < value of rxd).\n");
-       printf("  --rxwt=N: set the write-back threshold register of RX rings "
-              "to N (0 <= N <= 16).\n");
-       printf("  --txpt=N: set the prefetch threshold register of TX rings "
-              "to N (0 <= N <= 16).\n");
-       printf("  --txht=N: set the nhost threshold register of TX rings to N "
-              "(0 <= N <= 16).\n");
-       printf("  --txwt=N: set the write-back threshold register of TX rings "
-              "to N (0 <= N <= 16).\n");
+       printf("  --rxwt=N: set the write-back threshold register of RX rings to N.\n");
+       printf("  --txpt=N: set the prefetch threshold register of TX rings to N.\n");
+       printf("  --txht=N: set the nhost threshold register of TX rings to N.\n");
+       printf("  --txwt=N: set the write-back threshold register of TX rings to N.\n");
        printf("  --txfreet=N: set the transmit free threshold of TX rings to N "
               "(0 <= N <= value of txd).\n");
        printf("  --txrst=N: set the transmit RS bit threshold of TX rings to N "
@@ -199,9 +196,11 @@ 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");
+       printf("  --no-lsc-interrupt: disable link status change interrupt.\n");
 }
 
 #ifdef RTE_LIBRTE_CMDLINE
@@ -223,7 +222,8 @@ init_peer_eth_addrs(char *config_filename)
                if (fgets(buf, sizeof(buf), config_file) == NULL)
                        break;
 
-               if (cmdline_parse_etheraddr(NULL, buf, &peer_eth_addrs[i]) < 0 ){
+               if (cmdline_parse_etheraddr(NULL, buf, &peer_eth_addrs[i],
+                               sizeof(peer_eth_addrs[i])) < 0) {
                        printf("Bad MAC address format on line %d\n", i+1);
                        fclose(config_file);
                        return -1;
@@ -375,6 +375,7 @@ 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) {
@@ -396,14 +397,17 @@ parse_portnuma_config(const char *q_arg)
                                return -1;
                }
                port_id = (uint8_t)int_fld[FLD_PORT];
-               if (port_id >= nb_ports) {
-                       printf("Invalid port, range is [0, %d]\n", nb_ports - 1);
+               if (port_id_is_invalid(port_id, ENABLED_WARN)) {
+                       printf("Valid port range is [0");
+                       RTE_ETH_FOREACH_DEV(pid)
+                               printf(", %d", pid);
+                       printf("]\n");
                        return -1;
                }
                socket_id = (uint8_t)int_fld[FLD_SOCKET];
-               if(socket_id >= MAX_SOCKET) {
+               if(socket_id >= max_socket) {
                        printf("Invalid socket id, range is [0, %d]\n",
-                                MAX_SOCKET - 1);
+                                max_socket - 1);
                        return -1;
                }
                port_numa[port_id] = socket_id;
@@ -428,6 +432,7 @@ 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
@@ -452,14 +457,17 @@ parse_ringnuma_config(const char *q_arg)
                                return -1;
                }
                port_id = (uint8_t)int_fld[FLD_PORT];
-               if (port_id >= nb_ports) {
-                       printf("Invalid port, range is [0, %d]\n", nb_ports - 1);
+               if (port_id_is_invalid(port_id, ENABLED_WARN)) {
+                       printf("Valid port range is [0");
+                       RTE_ETH_FOREACH_DEV(pid)
+                               printf(", %d", pid);
+                       printf("]\n");
                        return -1;
                }
                socket_id = (uint8_t)int_fld[FLD_SOCKET];
-               if (socket_id >= MAX_SOCKET) {
+               if (socket_id >= max_socket) {
                        printf("Invalid socket id, range is [0, %d]\n",
-                               MAX_SOCKET - 1);
+                               max_socket - 1);
                        return -1;
                }
                ring_flag = (uint8_t)int_fld[FLD_FLAG];
@@ -490,52 +498,6 @@ parse_ringnuma_config(const char *q_arg)
        return 0;
 }
 
-static unsigned int
-parse_item_list(char* str, unsigned int max_items, unsigned int *parsed_items)
-{
-       unsigned int nb_item;
-       unsigned int value;
-       unsigned int i;
-       int value_ok;
-       char c;
-
-       /*
-        * First parse all items in the list and store their value.
-        */
-       value = 0;
-       nb_item = 0;
-       value_ok = 0;
-       for (i = 0; i < strlen(str); i++) {
-               c = str[i];
-               if ((c >= '0') && (c <= '9')) {
-                       value = (unsigned int) (value * 10 + (c - '0'));
-                       value_ok = 1;
-                       continue;
-               }
-               if (c != ',') {
-                       printf("character %c is not a decimal digit\n", c);
-                       return (0);
-               }
-               if (! value_ok) {
-                       printf("No valid value before comma\n");
-                       return (0);
-               }
-               if (nb_item < max_items) {
-                       parsed_items[nb_item] = value;
-                       value_ok = 0;
-                       value = 0;
-               }
-               nb_item++;
-       }
-
-       if (nb_item >= max_items)
-               rte_exit(EXIT_FAILURE, "too many txpkt segments!\n");
-
-       parsed_items[nb_item++] = value;
-
-       return (nb_item);
-}
-
 void
 launch_args_parse(int argc, char** argv)
 {
@@ -568,11 +530,18 @@ launch_args_parse(int argc, char** argv)
                { "pkt-filter-mode",            1, 0, 0 },
                { "pkt-filter-report-hash",     1, 0, 0 },
                { "pkt-filter-size",            1, 0, 0 },
-               { "pkt-filter-flexbytes-offset",1, 0, 0 },
                { "pkt-filter-drop-queue",      1, 0, 0 },
-               { "crc-strip",                  0, 0, 0 },
+#ifdef RTE_LIBRTE_LATENCY_STATS
+               { "latencystats",               1, 0, 0 },
+#endif
+               { "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 },
+               { "disable-hw-vlan-extend",     0, 0, 0 },
                { "enable-drop-en",            0, 0, 0 },
                { "disable-rss",                0, 0, 0 },
                { "port-topology",              1, 0, 0 },
@@ -600,6 +569,7 @@ launch_args_parse(int argc, char** argv)
                { "no-flush-rx",        0, 0, 0 },
                { "txpkts",                     1, 0, 0 },
                { "disable-link-check",         0, 0, 0 },
+               { "no-lsc-interrupt",           0, 0, 0 },
                { 0, 0, 0, 0 },
        };
 
@@ -658,7 +628,8 @@ launch_args_parse(int argc, char** argv)
                                                 "eth-peer: port %d >= RTE_MAX_ETHPORTS(%d)\n",
                                                 n, RTE_MAX_ETHPORTS);
 
-                               if (cmdline_parse_etheraddr(NULL, port_end, &peer_addr) < 0 )
+                               if (cmdline_parse_etheraddr(NULL, port_end,
+                                               &peer_addr, sizeof(peer_addr)) < 0)
                                        rte_exit(EXIT_FAILURE,
                                                 "Invalid ethernet address: %s\n",
                                                 port_end);
@@ -674,8 +645,7 @@ launch_args_parse(int argc, char** argv)
                                        nb_fwd_ports = (uint8_t) n;
                                else
                                        rte_exit(EXIT_FAILURE,
-                                                "nb-ports should be > 0 and <= %d\n",
-                                                nb_ports);
+                                                "Invalid port %d\n", n);
                        }
                        if (!strcmp(lgopts[opt_idx].name, "nb-cores")) {
                                n = atoi(optarg);
@@ -710,12 +680,12 @@ launch_args_parse(int argc, char** argv)
                                           "invalid ring-numa configuration\n");
                        if (!strcmp(lgopts[opt_idx].name, "socket-num")) {
                                n = atoi(optarg);
-                               if(n < MAX_SOCKET)
+                               if((uint8_t)n < max_socket)
                                        socket_num = (uint8_t)n;
                                else
                                        rte_exit(EXIT_FAILURE,
                                                "The socket number should be < %d\n",
-                                               MAX_SOCKET);
+                                               max_socket);
                        }
                        if (!strcmp(lgopts[opt_idx].name, "mbuf-size")) {
                                n = atoi(optarg);
@@ -750,12 +720,17 @@ launch_args_parse(int argc, char** argv)
                                                RTE_FDIR_MODE_SIGNATURE;
                                else if (!strcmp(optarg, "perfect"))
                                        fdir_conf.mode = RTE_FDIR_MODE_PERFECT;
+                               else if (!strcmp(optarg, "perfect-mac-vlan"))
+                                       fdir_conf.mode = RTE_FDIR_MODE_PERFECT_MAC_VLAN;
+                               else if (!strcmp(optarg, "perfect-tunnel"))
+                                       fdir_conf.mode = RTE_FDIR_MODE_PERFECT_TUNNEL;
                                else if (!strcmp(optarg, "none"))
                                        fdir_conf.mode = RTE_FDIR_MODE_NONE;
                                else
                                        rte_exit(EXIT_FAILURE,
                                                 "pkt-mode-invalid %s invalid - must be: "
-                                                "none, signature or perfect\n",
+                                                "none, signature, perfect, perfect-mac-vlan"
+                                                " or perfect-tunnel\n",
                                                 optarg);
                        }
                        if (!strcmp(lgopts[opt_idx].name,
@@ -790,17 +765,6 @@ launch_args_parse(int argc, char** argv)
                                                 " must be: 64K or 128K or 256K\n",
                                                 optarg);
                        }
-                       if (!strcmp(lgopts[opt_idx].name,
-                                   "pkt-filter-flexbytes-offset")) {
-                               n = atoi(optarg);
-                               if ( n >= 0 && n <= (int) 32)
-                                       fdir_conf.flexbytes_offset =
-                                               (uint8_t) n;
-                               else
-                                       rte_exit(EXIT_FAILURE,
-                                                "flexbytes %d invalid - must"
-                                                "be  >= 0 && <= 32\n", n);
-                       }
                        if (!strcmp(lgopts[opt_idx].name,
                                    "pkt-filter-drop-queue")) {
                                n = atoi(optarg);
@@ -811,8 +775,25 @@ 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;
+#ifdef RTE_LIBRTE_LATENCY_STATS
+                       if (!strcmp(lgopts[opt_idx].name,
+                                   "latencystats")) {
+                               n = atoi(optarg);
+                               if (n >= 0) {
+                                       latencystats_lcore_id = (lcoreid_t) n;
+                                       latencystats_enabled = 1;
+                               } else
+                                       rte_exit(EXIT_FAILURE,
+                                                "invalid lcore id %d for latencystats"
+                                                " must be >= 0\n", n);
+                       }
+#endif
+                       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;
 
@@ -822,6 +803,18 @@ launch_args_parse(int argc, char** argv)
                                rx_mode.hw_vlan_extend = 0;
                        }
 
+                       if (!strcmp(lgopts[opt_idx].name,
+                                       "disable-hw-vlan-filter"))
+                               rx_mode.hw_vlan_filter = 0;
+
+                       if (!strcmp(lgopts[opt_idx].name,
+                                       "disable-hw-vlan-strip"))
+                               rx_mode.hw_vlan_strip  = 0;
+
+                       if (!strcmp(lgopts[opt_idx].name,
+                                       "disable-hw-vlan-extend"))
+                               rx_mode.hw_vlan_extend = 0;
+
                        if (!strcmp(lgopts[opt_idx].name, "enable-drop-en"))
                                rx_drop_en = 1;
 
@@ -847,35 +840,25 @@ launch_args_parse(int argc, char** argv)
                                rss_hf = ETH_RSS_UDP;
                        if (!strcmp(lgopts[opt_idx].name, "rxq")) {
                                n = atoi(optarg);
-                               if (n >= 1 && n <= (int) MAX_QUEUE_ID)
+                               if (n >= 0 && n <= (int) MAX_QUEUE_ID)
                                        nb_rxq = (queueid_t) n;
                                else
                                        rte_exit(EXIT_FAILURE, "rxq %d invalid - must be"
-                                                 " >= 1 && <= %d\n", n,
+                                                 " >= 0 && <= %d\n", n,
                                                  (int) MAX_QUEUE_ID);
                        }
                        if (!strcmp(lgopts[opt_idx].name, "txq")) {
                                n = atoi(optarg);
-                               if (n >= 1 && n <= (int) MAX_QUEUE_ID)
+                               if (n >= 0 && n <= (int) MAX_QUEUE_ID)
                                        nb_txq = (queueid_t) n;
                                else
                                        rte_exit(EXIT_FAILURE, "txq %d invalid - must be"
-                                                 " >= 1 && <= %d\n", n,
+                                                 " >= 0 && <= %d\n", n,
                                                  (int) MAX_QUEUE_ID);
                        }
-                       if (!strcmp(lgopts[opt_idx].name, "rxd")) {
-                               n = atoi(optarg);
-                               if (n > 0)
-                                       nb_rxd = (uint16_t) n;
-                               else
-                                       rte_exit(EXIT_FAILURE, "rxd must be > 0\n");
-                       }
-                       if (!strcmp(lgopts[opt_idx].name, "txd")) {
-                               n = atoi(optarg);
-                               if (n > 0)
-                                       nb_txd = (uint16_t) n;
-                               else
-                                       rte_exit(EXIT_FAILURE, "txd must be in > 0\n");
+                       if (!nb_rxq && !nb_txq) {
+                               rte_exit(EXIT_FAILURE, "Either rx or tx queues should "
+                                               "be non-zero\n");
                        }
                        if (!strcmp(lgopts[opt_idx].name, "burst")) {
                                n = atoi(optarg);
@@ -896,38 +879,17 @@ launch_args_parse(int argc, char** argv)
                                                 "mbcache must be >= 0 and <= %d\n",
                                                 RTE_MEMPOOL_CACHE_MAX_SIZE);
                        }
-                       if (!strcmp(lgopts[opt_idx].name, "txpt")) {
-                               n = atoi(optarg);
-                               if (n >= 0)
-                                       tx_thresh.pthresh = (uint8_t)n;
-                               else
-                                       rte_exit(EXIT_FAILURE, "txpt must be >= 0\n");
-                       }
-                       if (!strcmp(lgopts[opt_idx].name, "txht")) {
-                               n = atoi(optarg);
-                               if (n >= 0)
-                                       tx_thresh.hthresh = (uint8_t)n;
-                               else
-                                       rte_exit(EXIT_FAILURE, "txht must be >= 0\n");
-                       }
-                       if (!strcmp(lgopts[opt_idx].name, "txwt")) {
-                               n = atoi(optarg);
-                               if (n >= 0)
-                                       tx_thresh.wthresh = (uint8_t)n;
-                               else
-                                       rte_exit(EXIT_FAILURE, "txwt must be >= 0\n");
-                       }
                        if (!strcmp(lgopts[opt_idx].name, "txfreet")) {
                                n = atoi(optarg);
                                if (n >= 0)
-                                       tx_free_thresh = (uint16_t)n;
+                                       tx_free_thresh = (int16_t)n;
                                else
                                        rte_exit(EXIT_FAILURE, "txfreet must be >= 0\n");
                        }
                        if (!strcmp(lgopts[opt_idx].name, "txrst")) {
                                n = atoi(optarg);
                                if (n >= 0)
-                                       tx_rs_thresh = (uint16_t)n;
+                                       tx_rs_thresh = (int16_t)n;
                                else
                                        rte_exit(EXIT_FAILURE, "txrst must be >= 0\n");
                        }
@@ -935,32 +897,11 @@ launch_args_parse(int argc, char** argv)
                                char *end = NULL;
                                n = strtoul(optarg, &end, 16);
                                if (n >= 0)
-                                       txq_flags = (uint32_t)n;
+                                       txq_flags = (int32_t)n;
                                else
                                        rte_exit(EXIT_FAILURE,
                                                 "txqflags must be >= 0\n");
                        }
-                       if (!strcmp(lgopts[opt_idx].name, "rxpt")) {
-                               n = atoi(optarg);
-                               if (n >= 0)
-                                       rx_thresh.pthresh = (uint8_t)n;
-                               else
-                                       rte_exit(EXIT_FAILURE, "rxpt must be >= 0\n");
-                       }
-                       if (!strcmp(lgopts[opt_idx].name, "rxht")) {
-                               n = atoi(optarg);
-                               if (n >= 0)
-                                       rx_thresh.hthresh = (uint8_t)n;
-                               else
-                                       rte_exit(EXIT_FAILURE, "rxht must be >= 0\n");
-                       }
-                       if (!strcmp(lgopts[opt_idx].name, "rxwt")) {
-                               n = atoi(optarg);
-                               if (n >= 0)
-                                       rx_thresh.wthresh = (uint8_t)n;
-                               else
-                                       rte_exit(EXIT_FAILURE, "rxwt must be >= 0\n");
-                       }
                        if (!strcmp(lgopts[opt_idx].name, "rxd")) {
                                n = atoi(optarg);
                                if (n > 0) {
@@ -986,49 +927,49 @@ launch_args_parse(int argc, char** argv)
                        if (!strcmp(lgopts[opt_idx].name, "txpt")) {
                                n = atoi(optarg);
                                if (n >= 0)
-                                       tx_thresh.pthresh = (uint8_t)n;
+                                       tx_pthresh = (int8_t)n;
                                else
                                        rte_exit(EXIT_FAILURE, "txpt must be >= 0\n");
                        }
                        if (!strcmp(lgopts[opt_idx].name, "txht")) {
                                n = atoi(optarg);
                                if (n >= 0)
-                                       tx_thresh.hthresh = (uint8_t)n;
+                                       tx_hthresh = (int8_t)n;
                                else
                                        rte_exit(EXIT_FAILURE, "txht must be >= 0\n");
                        }
                        if (!strcmp(lgopts[opt_idx].name, "txwt")) {
                                n = atoi(optarg);
                                if (n >= 0)
-                                       tx_thresh.wthresh = (uint8_t)n;
+                                       tx_wthresh = (int8_t)n;
                                else
                                        rte_exit(EXIT_FAILURE, "txwt must be >= 0\n");
                        }
                        if (!strcmp(lgopts[opt_idx].name, "rxpt")) {
                                n = atoi(optarg);
                                if (n >= 0)
-                                       rx_thresh.pthresh = (uint8_t)n;
+                                       rx_pthresh = (int8_t)n;
                                else
                                        rte_exit(EXIT_FAILURE, "rxpt must be >= 0\n");
                        }
                        if (!strcmp(lgopts[opt_idx].name, "rxht")) {
                                n = atoi(optarg);
                                if (n >= 0)
-                                       rx_thresh.hthresh = (uint8_t)n;
+                                       rx_hthresh = (int8_t)n;
                                else
                                        rte_exit(EXIT_FAILURE, "rxht must be >= 0\n");
                        }
                        if (!strcmp(lgopts[opt_idx].name, "rxwt")) {
                                n = atoi(optarg);
                                if (n >= 0)
-                                       rx_thresh.wthresh = (uint8_t)n;
+                                       rx_wthresh = (int8_t)n;
                                else
                                        rte_exit(EXIT_FAILURE, "rxwt must be >= 0\n");
                        }
                        if (!strcmp(lgopts[opt_idx].name, "rxfreet")) {
                                n = atoi(optarg);
                                if (n >= 0)
-                                       rx_free_thresh = (uint16_t)n;
+                                       rx_free_thresh = (int16_t)n;
                                else
                                        rte_exit(EXIT_FAILURE, "rxfreet must be >= 0\n");
                        }
@@ -1048,7 +989,8 @@ launch_args_parse(int argc, char** argv)
                                unsigned seg_lengths[RTE_MAX_SEGS_PER_PKT];
                                unsigned int nb_segs;
 
-                               nb_segs = parse_item_list(optarg, RTE_MAX_SEGS_PER_PKT, seg_lengths);
+                               nb_segs = parse_item_list(optarg, "txpkt segments",
+                                               RTE_MAX_SEGS_PER_PKT, seg_lengths, 0);
                                if (nb_segs > 0)
                                        set_tx_pkt_segments(seg_lengths, nb_segs);
                                else
@@ -1058,6 +1000,8 @@ launch_args_parse(int argc, char** argv)
                                no_flush_rx = 1;
                        if (!strcmp(lgopts[opt_idx].name, "disable-link-check"))
                                no_link_check = 1;
+                       if (!strcmp(lgopts[opt_idx].name, "no-lsc-interrupt"))
+                               lsc_interrupt = 0;
 
                        break;
                case 'h':