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 0AA51AAC1 for ; Wed, 18 Apr 2018 00:22:50 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B10FF21EE4; Tue, 17 Apr 2018 18:22:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 17 Apr 2018 18:22:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=SbCSj5m4Gyj6iYBArCH5pXkvHn K2TEpcP0UciZFflNM=; b=MCfptAbP+lqnzU6usVVgY1XT8n8+k7UGRqAHEPa37w SpggD/zYdTWXXVl8xK5fsGS4JWZ7AXfDIMYHF4F60GzFWPdC/xplYzxwFAdSgp27 kbnO6twqKo58YZzkEgiu407NCCIl+H0vWzA8TwVVEv2oHFiOgowCekgirfZkeqOd k= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=SbCSj5 m4Gyj6iYBArCH5pXkvHnK2TEpcP0UciZFflNM=; b=TkPGWUawqeo/qpB8pElOEM tdNbHZ9oYtKOsfGI4BSEVw5wL+YBUQTNcRCGN80sDdZYOafmBaDEUBT5ne5+aZeh 0unoNlB7uPFBvjx14scbHHjGQFQ9ppAoWM9AgpBZ+m0LpDFmOIV66RJshT3mOe8+ cnJAo/AW4vFBgKRKWY8WRqZOfiNcKHw78WkbjHH6xRVC8ojDecaEFX0raXyxi6qL ICsvGm3/axbPBgRYyATGn8tM8umioWhlJxbhQPNor4DXe4PwUynKoLPuT581EeGt lMANEBSSeDzgiQafrOS9GRVpQOvwY1c0gC6Anmd8Pd7lkzcYaLtygNC6iL0wuj8g == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 320E9E4921; Tue, 17 Apr 2018 18:22:49 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Wed, 18 Apr 2018 00:22:47 +0200 Message-ID: <3054863.hexJULFvxB@xps> In-Reply-To: <20180405153322.5488-1-thomas@monjalon.net> References: <20180309222255.27663-1-thomas@monjalon.net> <20180405153322.5488-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2 0/3] ethdev: fix ports enumeration 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, 17 Apr 2018 22:22:50 -0000 05/04/2018 17:33, Thomas Monjalon: > Some DPDK applications wrongly assume these requirements: > - no hotplug, i.e. ports are never detached > - all allocated ports are available to the application > > Such application iterates over ports by its own mean. > The most common pattern is to request the port count and > assume ports with index in the range [0..count[ can be used. > > There are three consequences when using such wrong design: > - new ports having an index higher than the port count won't be seen > - old ports being detached (RTE_ETH_DEV_UNUSED) can be seen as ghosts > - failsafe sub-devices (RTE_ETH_DEV_DEFERRED) will be seen by the application > > Such mistake will be less common with growing hotplug awareness. > All applications and examples inside this repository - except testpmd - > must be fixed to use the iterator RTE_ETH_FOREACH_DEV, > and to use the function rte_eth_dev_is_valid_port. > > In order to fix this common mistake in all external applications, > the function rte_eth_dev_count is deprecated, while introducing > the new functions rte_eth_dev_count_avail and rte_eth_dev_count_total. The RFC was sent on 9th of March, and this v2 is available since 5th of April, without any comment. Applied