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 651C02C8 for ; Tue, 4 Jul 2017 13:29:05 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from vasilyf@mellanox.com) with ESMTPS (AES256-SHA encrypted); 4 Jul 2017 14:22:57 +0300 Received: from r-aa-dragon19.mtr.labs.mlnx (r-aa-dragon19.mtr.labs.mlnx [10.209.68.156]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v64BMtGb000323; Tue, 4 Jul 2017 14:22:55 +0300 Received: from r-aa-dragon19.mtr.labs.mlnx (localhost [127.0.0.1]) by r-aa-dragon19.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id v64BMsjB000462; Tue, 4 Jul 2017 11:22:54 GMT Received: (from vasilyf@localhost) by r-aa-dragon19.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id v64BMsfo000461; Tue, 4 Jul 2017 11:22:54 GMT From: Vasily Philipov To: dev@dpdk.org Cc: Vasily Philipov , Adrien Mazarguil , Nelio Laranjeiro Date: Tue, 4 Jul 2017 11:22:48 +0000 Message-Id: <225679c202aa0bae5c61882aef6c8117a9074029.1499166724.git.vasilyf@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <0dca86aa1372d6ff09d0aff01d522c580e0e24ab.1495717153.git.vasilyf@mellanox.com> References: <0dca86aa1372d6ff09d0aff01d522c580e0e24ab.1495717153.git.vasilyf@mellanox.com> Subject: [dpdk-dev] [PATCH v7 1/4] app/testpmd: add isolated mode 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: Tue, 04 Jul 2017 11:29:05 -0000 Content-Type: text/plain; charset="UTF-8" Message-ID: <20170704112248.PCfYaAwo1cMQ4opcAbyS7Rus_pTWz4HrS_G0vtSFqB0@z> 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 | 3 +++ app/test-pmd/testpmd.c | 14 ++++++++++++++ app/test-pmd/testpmd.h | 1 + 3 files changed, 18 insertions(+) diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index fbe6284..e313871 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -623,6 +623,7 @@ { "tx-queue-stats-mapping", 1, 0, 0 }, { "rx-queue-stats-mapping", 1, 0, 0 }, { "no-flush-rx", 0, 0, 0 }, + { "isolated-mode", 0, 0, 0 }, { "txpkts", 1, 0, 0 }, { "disable-link-check", 0, 0, 0 }, { "no-lsc-interrupt", 0, 0, 0 }, @@ -1081,6 +1082,8 @@ lsc_interrupt = 0; if (!strcmp(lgopts[opt_idx].name, "no-rmv-interrupt")) rmv_interrupt = 0; + if (!strcmp(lgopts[opt_idx].name, "isolated-mode")) + isolated_mode = 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 b3ad83b..864a2a8 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -270,6 +270,11 @@ struct fwd_engine * fwd_engines[] = { uint8_t no_flush_rx = 0; /* flush by default */ /* + * Flow API isolated mode. + */ +uint8_t isolated_mode; + +/* * Avoids to check link status when starting/stopping a port. */ uint8_t no_link_check = 0; /* check by default */ @@ -1425,6 +1430,15 @@ static int eth_event_callback(uint8_t port_id, if (port->need_reconfig > 0) { port->need_reconfig = 0; + if (isolated_mode) { + 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 364502d..d5fc9ad 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -303,6 +303,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; /**