From: Vasily Philipov Date: Sun, 9 Jul 2017 08:08:05 +0000 (+0300) Subject: app/testpmd: add --flow-isolate-all option X-Git-Tag: spdx-start~2498 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7ee3e9446290;p=dpdk.git app/testpmd: add --flow-isolate-all option 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 Acked-by: Adrien Mazarguil --- diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 958b3d0485..c20ce65737 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -215,6 +215,8 @@ usage(char* progname) "enable print of designated event or all of them."); printf(" --mask-event : " "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, diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index e09b803832..e754d12aae 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -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 */ diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 73985c3e3e..c9d7739b81 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -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; /**