app/testpmd: request device removal interrupt
[dpdk.git] / app / test-pmd / parameters.c
index 08e5a76..73da65a 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2016 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
@@ -76,6 +76,7 @@
 #ifdef RTE_LIBRTE_PMD_BOND
 #include <rte_eth_bond.h>
 #endif
+#include <rte_flow.h>
 
 #include "testpmd.h"
 
@@ -148,7 +149,11 @@ 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");
+#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");
@@ -195,6 +200,8 @@ usage(char* progname)
                " 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");
+       printf("  --no-rmv-interrupt: disable device removal interrupt.");
 }
 
 #ifdef RTE_LIBRTE_CMDLINE
@@ -393,7 +400,7 @@ parse_portnuma_config(const char *q_arg)
                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)
+                       RTE_ETH_FOREACH_DEV(pid)
                                printf(", %d", pid);
                        printf("]\n");
                        return -1;
@@ -453,7 +460,7 @@ parse_ringnuma_config(const char *q_arg)
                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)
+                       RTE_ETH_FOREACH_DEV(pid)
                                printf(", %d", pid);
                        printf("]\n");
                        return -1;
@@ -525,7 +532,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 },
+#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 },
@@ -560,6 +570,8 @@ 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 },
+               { "no-rmv-interrupt",           0, 0, 0 },
                { 0, 0, 0, 0 },
        };
 
@@ -765,8 +777,21 @@ 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"))
@@ -977,6 +1002,10 @@ 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;
+                       if (!strcmp(lgopts[opt_idx].name, "no-rmv-interrupt"))
+                               rmv_interrupt = 0;
 
                        break;
                case 'h':