From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH 08/11] ethdev: fix port visibility before initialization Date: Thu, 10 May 2018 13:40:56 -0700 Message-ID: <20180510134056.455d97dc@xeon-e3> References: <20180509094337.26112-1-thomas@monjalon.net> <20180509094337.26112-9-thomas@monjalon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, stable@dpdk.org, Matan Azrad To: Thomas Monjalon Return-path: Received: from mail-pg0-f41.google.com (mail-pg0-f41.google.com [74.125.83.41]) by dpdk.org (Postfix) with ESMTP id EBFA31B787 for ; Thu, 10 May 2018 22:40:59 +0200 (CEST) Received: by mail-pg0-f41.google.com with SMTP id n9-v6so1453169pgq.5 for ; Thu, 10 May 2018 13:40:59 -0700 (PDT) In-Reply-To: <20180509094337.26112-9-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" On Wed, 9 May 2018 11:43:34 +0200 Thomas Monjalon wrote: > The port was set to the state ATTACHED during allocation. > The consequence was to iterate over ports which are not initialized. > > The state ATTACHED is now set as the last step of probing. > > The uniqueness of port name is now checked before the availability > of a port id for allocation (order reversed). > > As the state is not set on allocation anymore, it is also not checked > in the function telling whether a port is allocated or not. > The name of the port is set on allocation, so it is enough as a check. > > Fixes: 5588909af21b ("ethdev: add device iterator") > Cc: stable@dpdk.org > > Signed-off-by: Thomas Monjalon > Signed-off-by: Matan Azrad Could these states be described somewhere in the documentation. Maybe some doc/guides? Maybe even exposed in API under rte_eth_dev_info. Ideally, the device states could be aligned to the SNMP MIB for interfaces (RFC2863) which defines complex state model appropriate for devices and tunnels.