From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2 0/3] ethdev: fix ports enumeration Date: Wed, 18 Apr 2018 00:22:47 +0200 Message-ID: <3054863.hexJULFvxB@xps> References: <20180309222255.27663-1-thomas@monjalon.net> <20180405153322.5488-1-thomas@monjalon.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: ferruh.yigit@intel.com To: dev@dpdk.org 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) In-Reply-To: <20180405153322.5488-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" 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