From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 418B72C54 for ; Sun, 9 Jul 2017 10:08:13 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from vasilyf@mellanox.com) with ESMTPS (AES256-SHA encrypted); 9 Jul 2017 11:08:11 +0300 Received: from hpchead.mtr.labs.mlnx. (hpchead.mtr.labs.mlnx [10.209.44.59]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v6988BMx016487; Sun, 9 Jul 2017 11:08:11 +0300 Received: from hpchead.mtr.labs.mlnx. (localhost.localdomain [127.0.0.1]) by hpchead.mtr.labs.mlnx. (8.14.7/8.14.7) with ESMTP id v6988AU8030810; Sun, 9 Jul 2017 11:08:10 +0300 Received: (from vasilyf@localhost) by hpchead.mtr.labs.mlnx. (8.14.7/8.14.7/Submit) id v69887ZL030132; Sun, 9 Jul 2017 11:08:07 +0300 From: Vasily Philipov To: dev@dpdk.org Cc: Vasily Philipov , Jingjing Wu , Adrien Mazarguil Date: Sun, 9 Jul 2017 11:08:05 +0300 Message-Id: <2d0c842d7c1eb46845610057544dcfab08550933.1499585615.git.vasilyf@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] app/testpmd: add flow isolate all parameter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 08:08:14 -0000 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 --- 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 : " "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; /**