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 DC2FA1B10C for ; Thu, 25 Oct 2018 17:11:25 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 87E6F21D35; Thu, 25 Oct 2018 11:11:25 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 25 Oct 2018 11:11:25 -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=NFwuH2ELzl zb2f34K9HRLaQhnU6GA/HPUSTMo5V/UOY=; b=o4n85RfGZH3hsxUxQQsY1S4Y5W +crELXjKlgy/Tozvv2y9V2gabkHsuJsqLa1ywvX9RfieZ/NTkrLD6RxVs5YZxFxF URC9Mk8Oou1VTrFM7eWkP9gZZWNZlDFV/Wv0Ml+b5LUaLb8rJSpvSpPAUESM59Um 5BZhRe+NZvw/nf3lU= 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=NFwuH2ELzlzb2f34K9HRLaQhnU6GA/HPUSTMo5V/UOY=; b=WnD/FK7m XTPBv87pormTSUXnoDqEVWFxuj2z4lYvkb+cqy0wlgaMX/K/j0Jq9VBlLuQ1f6nU YokzqRZ/oAh/h+2qVWZD327QpBXUS1+r3+/1sHcG/7XEV3MCzK5w/mhX4XphLZfb s+u3/ll/RY5Cg/yQq8Z9XHWnrhr9yobmJEnUhj7l85G8zQne47H9Wxp3a9fBE1fW bBztRQXhjcLzH0JInrbrFQNOHlKEPcKDZjlBC3b4L/bvSYbn1Fla+nD40eaC8ytI ZmK9c86qTjO78vnDWKAwo4gfB49uYda/yviVoAhvtxETu/9h4iHcLBvX/U9KKyEF ZvU/LZiF9RZlrQ== 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 08FF3102DD; Thu, 25 Oct 2018 11:11:23 -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: Thu, 25 Oct 2018 17:11:15 +0200 Message-Id: <20181025151117.17132-4-thomas@monjalon.net> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181025151117.17132-1-thomas@monjalon.net> References: <20181024134111.26771-1-thomas@monjalon.net> <20181025151117.17132-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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: Thu, 25 Oct 2018 15:11:26 -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 Acked-by: Bernard Iremonger --- 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 dd6e6eacd..5706686fc 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2300,8 +2300,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