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 2B98E1B54B for ; Thu, 11 Oct 2018 13:45:53 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id C8F5621E32; Thu, 11 Oct 2018 07:45:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 11 Oct 2018 07:45:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=Mbt6YBLJ0ozomHfeOTR54nNvRLO6iuelHSUYqqrcuxw=; b=YXrfZ7736j+a FGg7+oJqONQU/NDWi9Sx+JPyOD7uBq+sdliIu+rRI63I4TMUNUKTh4b9YXmqEjmI IuPQLmVXWGkO0jLO7gTvws5cy2gxGMQCBOZFLe4gLdI7WcAjrrv86HioxQZWn+Fw ica2moNIYPdUpXFYTtDptRethSzhGl8= 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-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=Mbt6YBLJ0ozomHfeOTR54nNvRLO6iuelHSUYqqrcu xw=; b=BGkcW+zAgbsbv+U9KBpDw/rEqD3tnYYWfSvBnaySwZeZ1RuSUzlro57lo O02VJ+SL3cM2saANGlCTRYZtdwIe7RT0vyCUd6Ob/CR1fQJ4yaqdCkhgdFeV1276 A+GHuJHUzKVC7Bz221N1yJgpfaQoZ1ADzIkKhqLPZm9w7yOb+GTrg1HwcbV4ih7C 29/+ATfaCCqZfwhBOf5TLkXROgTLpPCUsRYRV4B+yZmZtRlObvxOf6dO7Idyqtos LQqKgC6DmLOsyut/B06ZLIJUreQ3ocddA8np6vfZL0x+hwSvrHKLq0kbZ3oAEiOp vE/GvlAv4ZUmcVDvFUPhWtE0gPDbA== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 984D5E4799; Thu, 11 Oct 2018 07:45:51 -0400 (EDT) From: Thomas Monjalon To: Andrew Rybchenko Cc: dev@dpdk.org, gaetan.rivet@6wind.com, ophirmu@mellanox.com, qi.z.zhang@intel.com, ferruh.yigit@intel.com Date: Thu, 11 Oct 2018 13:45:50 +0200 Message-ID: <2290243.n1gutIJ8el@xps> In-Reply-To: <21a07d94-44cc-9e99-1474-a13de77915ea@solarflare.com> References: <20180907230958.21402-1-thomas@monjalon.net> <20181007220933.4533-2-thomas@monjalon.net> <21a07d94-44cc-9e99-1474-a13de77915ea@solarflare.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 1/3] drivers/bus: move driver assignment to end of probing 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, 11 Oct 2018 11:45:53 -0000 11/10/2018 12:53, Andrew Rybchenko: > On 10/8/18 1:09 AM, Thomas Monjalon wrote: > > The PCI mapping requires to know the PCI driver to use, > > even before the probing is done. That's why the PCI driver is > > referenced early inside the PCI device structure. See > > 1d20a073fa5e ("bus/pci: reference driver structure before mapping") > > > > However the rte_driver does not need to be referenced in rte_device > > before the device probing is done. > > By moving back this assignment at the end of the device probing, > > it becomes possible to make clear the status of a rte_device. > > > > Signed-off-by: Thomas Monjalon > > --- > > diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c > > index c7695d108..d63e68045 100644 > > --- a/drivers/bus/pci/pci_common.c > > +++ b/drivers/bus/pci/pci_common.c > > @@ -160,14 +160,12 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr, > > * driver flags for adjusting configuration. > > */ > > dev->driver = dr; > > - dev->device.driver = &dr->driver; > > It breaks net/sfc and I guess other drivers which use > rte_eth_dma_zone_reserve() > from probe. The function makes zone name using dev->device->driver->name. Please, can you show code line where we does such access? I checked such access before and did not find some. Anyway, it can be fixed by accessing rte_pci_driver->driver->name. Note that rte_pci_driver is referenced in rte_pci_device.