DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: add flow isolate all parameter
@ 2017-07-09  8:08 Vasily Philipov
  2017-07-10 12:46 ` Adrien Mazarguil
  0 siblings, 1 reply; 3+ messages in thread
From: Vasily Philipov @ 2017-07-09  8:08 UTC (permalink / raw)
  To: dev; +Cc: Vasily Philipov, Jingjing Wu, Adrien Mazarguil

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>
---
 app/test-pmd/parameters.c             |  5 +++++
 app/test-pmd/testpmd.c                | 14 ++++++++++++++
 app/test-pmd/testpmd.h                |  1 +
 doc/guides/testpmd_app_ug/run_app.rst |  8 ++++++++
 4 files changed, 28 insertions(+)

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 958b3d0..c20ce65 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -215,6 +215,8 @@
 	       "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 @@
 		{ "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 @@
 				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 308c1b7..d618651 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -271,6 +271,11 @@ struct fwd_engine * fwd_engines[] = {
 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.
  */
 uint8_t no_link_check = 0; /* check by default */
@@ -1426,6 +1431,15 @@ static int eth_event_callback(uint8_t port_id,
 		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 9ccfb6d..33ff7f2 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -306,6 +306,7 @@ struct queue_stats_mappings {
 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. */
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index e50c47f..e8303f3 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -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.
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: add flow isolate all parameter
  2017-07-09  8:08 [dpdk-dev] [PATCH] app/testpmd: add flow isolate all parameter Vasily Philipov
@ 2017-07-10 12:46 ` Adrien Mazarguil
  2017-07-13  9:50   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Adrien Mazarguil @ 2017-07-10 12:46 UTC (permalink / raw)
  To: Vasily Philipov; +Cc: dev, Jingjing Wu

On Sun, Jul 09, 2017 at 11:08:05AM +0300, Vasily Philipov wrote:
> 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>

-- 
Adrien Mazarguil
6WIND

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: add flow isolate all parameter
  2017-07-10 12:46 ` Adrien Mazarguil
@ 2017-07-13  9:50   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2017-07-13  9:50 UTC (permalink / raw)
  To: Vasily Philipov; +Cc: dev, Adrien Mazarguil, Jingjing Wu

10/07/2017 14:46, Adrien Mazarguil:
> On Sun, Jul 09, 2017 at 11:08:05AM +0300, Vasily Philipov wrote:
> > 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>

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-13  9:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-09  8:08 [dpdk-dev] [PATCH] app/testpmd: add flow isolate all parameter Vasily Philipov
2017-07-10 12:46 ` Adrien Mazarguil
2017-07-13  9:50   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).