From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: [PATCH 3/5] app/testpmd: check not configuring port twice Date: Wed, 24 Oct 2018 15:41:09 +0200 Message-ID: <20181024134111.26771-4-thomas@monjalon.net> References: <20181024134111.26771-1-thomas@monjalon.net> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, ophirmu@mellanox.com, wisamm@mellanox.com, ferruh.yigit@intel.com, arybchenko@solarflare.com To: bernard.iremonger@intel.com, jingjing.wu@intel.com, wenzhuo.lu@intel.com Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id BEAD65B26 for ; Wed, 24 Oct 2018 15:41:26 +0200 (CEST) In-Reply-To: <20181024134111.26771-1-thomas@monjalon.net> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" It is possible to request probing of a device twice, and possibly get new ports for this device. However, the ports which were already probed and setup must not be setup again. That's why it is checked whether the port is already part of fwd_ports_ids array at the beginning of the function setup_attached_port(). Signed-off-by: Thomas Monjalon --- app/test-pmd/testpmd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 21627ecb6..72b91adf5 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2295,8 +2295,11 @@ attach_port(char *identifier) return; } - RTE_ETH_FOREACH_MATCHING_DEV(pi, identifier, &iterator) + RTE_ETH_FOREACH_MATCHING_DEV(pi, identifier, &iterator) { + if (port_is_forwarding(pi)) + continue; /* port was already attached before */ setup_attached_port(pi); + } } static void -- 2.19.0