From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [dpdk-stable] [PATCH 08/11] ethdev: fix port visibility before initialization Date: Wed, 09 May 2018 21:08:21 +0200 Message-ID: <1864854.i0eoOuio3f@xps> 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: Ferruh Yigit Return-path: In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 09/05/2018 20:03, Ferruh Yigit: > On 5/9/2018 10:43 AM, 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 > > --- > > @@ -3387,6 +3385,8 @@ rte_eth_dev_probing_finish(struct rte_eth_dev *dev) > > { > > if (dev == NULL) > > return; > > + > > + dev->state = RTE_ETH_DEV_ATTACHED; > > Aren't ethdev allocation and probe in different levels? Why not make ethdev > allocation self sufficient but tie it to the device probe() ? Ethdev allocation is self sufficient. Probing is done by the PMD with these steps: 1/ allocate ethdev port 2/ initialize device 3/ notify NEW event and set ethdev status