From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GFHc3d924+PyhhSRi+rswIh9B2u3WCQkvytbJaxzGfs=; b=rOg15V2pR+dBCOLVXKiO9LpR76zYE2DAPAwt/oXTex649QGf79JWTIxNADhRO4X3Ap LxctCY7uMOt1MqQBNqmLfhPL5RKVRE2Hvxb7lnr6CcGcrPwFGfiCgp9J4RLByO/2nA75 0GTeBt5CqLpzCg/XWGhW0nPCYII7OdujuoISk3IOLH1u4/rV5lcRdp+6Ks1CE2VfmSTl BHOwyuOBAMDS2BKgrFNfTHjVpEB25KahqOJ/UxZhyqhupkK4S+30C55ltOurAyfK+Wsd 2V9Ju6wqYodcmyRZY9qVau2AxobIRCWrtLSnjnbASiPMAZNB2CsDxqsQIMc5Z9E2goZa f/Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GFHc3d924+PyhhSRi+rswIh9B2u3WCQkvytbJaxzGfs=; b=UWwvtTs/3kce5u/HOsdbFmUPlKOOPEHi+wG042XH6KR1kVU4gw9QuGX2ZOtbrUEh0P jZ84Cui6B3vCwrfdGn2CfngTNIcywKdjEWgK6k9dFlnNCiMFxXuG710XbKRjXV26/SPx Wad6Xdri6IDU5Hkf9ZII5wBWO8xhehMtny+p97/dSzJ8w9ugsZ+kHJl6JLDyeyfXnDeT EtMMeOiGj/wa/IV6Y+PybeVpMUwiZAsRf/9mpojBdBGRW+6VEXlK5dwBAIZlxt8ipzsx oCWNOwaI9zyUC5X2PEiZwe78t4Gfrfm2P0/RGPD7um9sAc3JMaCPLBBVtFOfmFI9sGEd U2Gg== X-Gm-Message-State: ALKqPwe+u0fjM+6tDjA8E0js9Am0MCL/ISSS5yPGF574UyJeYg6mwV+T OQiRvL7n7EPljrH3zHwoVQFo5A== X-Google-Smtp-Source: AB8JxZoK4mxquahJtJBJ0BFK2pYSknHqNhM+S60L/+YJsdzBdFrjdjh0SCKYqjrYYSZr3z88mqzE6g== X-Received: by 2002:a62:e04c:: with SMTP id f73-v6mr2759116pfh.88.1525984859086; Thu, 10 May 2018 13:40:59 -0700 (PDT) Received: from xeon-e3 (204-195-35-107.wavecable.com. [204.195.35.107]) by smtp.gmail.com with ESMTPSA id a10-v6sm2880653pfo.55.2018.05.10.13.40.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 May 2018 13:40:59 -0700 (PDT) Date: Thu, 10 May 2018 13:40:56 -0700 From: Stephen Hemminger To: Thomas Monjalon Cc: dev@dpdk.org, stable@dpdk.org, Matan Azrad Message-ID: <20180510134056.455d97dc@xeon-e3> In-Reply-To: <20180509094337.26112-9-thomas@monjalon.net> 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 Subject: Re: [dpdk-dev] [PATCH 08/11] ethdev: fix port visibility before initialization 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, 10 May 2018 20:41:00 -0000 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.