app/testpmd: add --flow-isolate-all option
authorVasily Philipov <vasilyf@mellanox.com>
Sun, 9 Jul 2017 08:08:05 +0000 (11:08 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 13 Jul 2017 09:48:48 +0000 (11:48 +0200)
Providing this parameter requests flow API isolated mode on all ports at
initialization time. It ensures all traffic is received through the
configured flow rules only (see flow command).

Ports that do not support this mode are automatically discarded.

Signed-off-by: Vasily Philipov <vasilyf@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
app/test-pmd/parameters.c
app/test-pmd/testpmd.c
app/test-pmd/testpmd.h
doc/guides/testpmd_app_ug/run_app.rst

index 958b3d0485097818c43c7f8c4d771aa7a320e3a1..c20ce65737914bd1f6ee904df8917135aa6ee1df 100644 (file)
@@ -215,6 +215,8 @@ usage(char* progname)
               "enable print of designated event or all of them.");
        printf("  --mask-event <unknown|intr_lsc|queue_state|intr_reset|vf_mbox|macsec|intr_rmv|all>: "
               "disable print of designated event or all of them.");
+       printf("  --flow-isolate-all: "
+              "requests flow API isolated mode on all ports at initialization time.");
 }
 
 #ifdef RTE_LIBRTE_CMDLINE
@@ -630,6 +632,7 @@ launch_args_parse(int argc, char** argv)
                { "tx-queue-stats-mapping",     1, 0, 0 },
                { "rx-queue-stats-mapping",     1, 0, 0 },
                { "no-flush-rx",        0, 0, 0 },
+               { "flow-isolate-all",           0, 0, 0 },
                { "txpkts",                     1, 0, 0 },
                { "disable-link-check",         0, 0, 0 },
                { "no-lsc-interrupt",           0, 0, 0 },
@@ -1105,6 +1108,8 @@ launch_args_parse(int argc, char** argv)
                                lsc_interrupt = 0;
                        if (!strcmp(lgopts[opt_idx].name, "no-rmv-interrupt"))
                                rmv_interrupt = 0;
+                       if (!strcmp(lgopts[opt_idx].name, "flow-isolate-all"))
+                               flow_isolate_all = 1;
                        if (!strcmp(lgopts[opt_idx].name, "print-event"))
                                if (parse_event_printing_config(optarg, 1)) {
                                        rte_exit(EXIT_FAILURE,
index e09b803832a94271fc15090f4a5b356051ba0f9e..e754d12aae5e260770436e89670a72889bdfb621 100644 (file)
@@ -271,6 +271,11 @@ uint16_t port_topology = PORT_TOPOLOGY_PAIRED; /* Ports are paired by default */
  */
 uint8_t no_flush_rx = 0; /* flush by default */
 
+/*
+ * Flow API isolated mode.
+ */
+uint8_t flow_isolate_all;
+
 /*
  * Avoids to check link status when starting/stopping a port.
  */
@@ -1429,6 +1434,15 @@ start_port(portid_t pid)
                if (port->need_reconfig > 0) {
                        port->need_reconfig = 0;
 
+                       if (flow_isolate_all) {
+                               int ret = port_flow_isolate(pi, 1);
+                               if (ret) {
+                                       printf("Failed to apply isolated"
+                                              " mode on port %d\n", pi);
+                                       return -1;
+                               }
+                       }
+
                        printf("Configuring Port %d (socket %u)\n", pi,
                                        port->socket_id);
                        /* configure port */
index 73985c3e3e21cf1e1fc6e5d4ab99e20a95d425d3..c9d7739b81b87b4c7215f2164d091dd0fe4b9fb9 100644 (file)
@@ -307,6 +307,7 @@ extern char cmdline_filename[PATH_MAX]; /**< offline commands file */
 extern uint8_t  numa_support; /**< set by "--numa" parameter */
 extern uint16_t port_topology; /**< set by "--port-topology" parameter */
 extern uint8_t no_flush_rx; /**<set by "--no-flush-rx" parameter */
+extern uint8_t flow_isolate_all; /**< set by "--flow-isolate-all */
 extern uint8_t  mp_anon; /**< set by "--mp-anon" parameter */
 extern uint8_t no_link_check; /**<set by "--disable-link-check" parameter */
 extern volatile int test_done; /* stop packet forwarding when set to 1. */
index e50c47f18e1239000f163de586d97b5283766b17..e8303f3ba38533b2e296b1c18c7e7b08b01b576f 100644 (file)
@@ -500,3 +500,11 @@ The commandline options are:
 
     Disable printing the occurrence of the designated event. Using all will
     disable all of them.
+
+*   ``--flow-isolate-all``
+
+    Providing this parameter requests flow API isolated mode on all ports at
+    initialization time. It ensures all traffic is received through the
+    configured flow rules only (see flow command).
+
+    Ports that do not support this mode are automatically discarded.