From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 62F6121B2A; Wed, 24 Oct 2018 09:41:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 24 Oct 2018 09:41:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=AkuBXU0gBz XSH9zePCBaOYQnimpb2QYAfZSNFfOjFZg=; b=kL+PJavtKdaHWwQ+GSIIshS6XY t6Yno+2Sng451egguKsi1SaBWcvkPLKdlrirZ6otwq93noa0zBG0YrD1SI2QROtZ ZwjndudFgy66xHsHMAz1yDnkQZscpAPNGd43tu5KZgMP1uCCId9+bMRlqgjcDJNc pMCg+ODnmZPPQz24A= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=AkuBXU0gBzXSH9zePCBaOYQnimpb2QYAfZSNFfOjFZg=; b=nIqNECwI o7VSshvJp2R+L2URG084jW3bnyo0GLl0Qf2aRHiFxDtVT8VVPX831HHFlcbS4QwW 1q2YPPy50ome2YAysR5lcQA1sxISYcO2oShIs3Qz50dfikA4CKPZap4VeSsui9Bp lhnI3eZTjZUW/QGSEK/cnQcU45PmJyXp+9reuXjqSV41tdda/oWv/sl4i72TGT3j VoVPdp1GT2nuA9WraUzBHYx6qhzJFAAg5XeYlnB3MSSAWpQZMuDB6GpUBTv3Z9D4 V1aC7SBLdkTbex2jUqoqxOncZt2LefAo5UXecwblTD/v8eL7l679Y+ktBFp6JmF7 nT74Z53geryyZg== X-ME-Sender: X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 12791E44D4; Wed, 24 Oct 2018 09:41:24 -0400 (EDT) From: Thomas Monjalon To: bernard.iremonger@intel.com, jingjing.wu@intel.com, wenzhuo.lu@intel.com Cc: dev@dpdk.org, ophirmu@mellanox.com, wisamm@mellanox.com, ferruh.yigit@intel.com, arybchenko@solarflare.com Date: Wed, 24 Oct 2018 15:41:09 +0200 Message-Id: <20181024134111.26771-4-thomas@monjalon.net> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181024134111.26771-1-thomas@monjalon.net> References: <20181024134111.26771-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 3/5] app/testpmd: check not configuring port twice 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: Wed, 24 Oct 2018 13:41:27 -0000 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