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 E08491B4EC for ; Fri, 12 Oct 2018 12:45:42 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4421722015; Fri, 12 Oct 2018 06:45:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 12 Oct 2018 06:45:42 -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=VGE8EbC9Lz8AlwZrM+EU78XOfN9pM8SVtL1IuUJvm+Y=; b=HNrxm73YhBsQ BbyAciD0DoMYbp98mwKIT1WQE8bgY1bdGUJ3Q6tXf1BRJ8fEGVnFJ7Sm80Bi9g/M 6DdrdCvZebuD2EjHNh/I9d5O8MGWQQTkyXMnlvjRQAdW5qPNzdXqa4qtWwbH8S59 xthiOrcnaj/FXJabSt5zJiib0PJVg2k= 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=VGE8EbC9Lz8AlwZrM+EU78XOfN9pM8SVtL1IuUJvm +Y=; b=Pt7vB9fYzZgmhoPJJafV0TIxcfmzMKCxyeprxzMDP01zxwTTunTxXj0Qx w5PFsG5+45oQUeurFH98MrRYSpTdvko+l0zsqMgmri9mGFkXFL8wTls5tbTfwbjF SNeH4MBYbwca7LYuFxebgWB0Dx+g0sKdUdyKqyipeAJOlrIGQPdOYpsIeFSGq5gD eH+q+3bpLnKXxjg8V1bcASLZTKC++6SY786q9+FlMUxWZfdp4MfLS/CvGVgkpcYS VZIM3QGZwAMAA0KcpsAaCUd1BREqT8F8ga070QUEUuTLmNc3O/k1JLhUSqWG4UAM /+arvTShkwlVWt2pg/LlxjCrcW6wg== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (90.87.136.77.rev.sfr.net [77.136.87.90]) by mail.messagingengine.com (Postfix) with ESMTPA id A5043102F1; Fri, 12 Oct 2018 06:45:37 -0400 (EDT) From: Thomas Monjalon To: Jan =?utf-8?B?UmVtZcWh?= , arybchenko@solarflare.com Cc: dev@dpdk.org, gaetan.rivet@6wind.com, ophirmu@mellanox.com, qi.z.zhang@intel.com, Ferruh Yigit , shahafs@mellanox.com, yskoh@mellanox.com Date: Fri, 12 Oct 2018 12:45:33 +0200 Message-ID: <2747410.AD2BYnryfn@xps> In-Reply-To: References: <20180907230958.21402-1-thomas@monjalon.net> <14058760-a35c-c991-74c1-8a86b39df5b0@solarflare.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v4 2/4] 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: Fri, 12 Oct 2018 10:45:43 -0000 12/10/2018 10:32, Jan Reme=C5=A1: > Hi Andrew, >=20 > On Fri, Oct 12, 2018 at 9:45 AM Andrew Rybchenko > wrote: > > > > Hi, Thomas, > > > > On 10/12/18 12:02 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 > > > commit 1d20a073fa5e ("bus/pci: reference driver structure before mapp= ing") > > > > > > 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 > > > Reviewed-by: Andrew Rybchenko > > > > Have you seen driver->name usage in drivers/net/szedata2/rte_eth_szedat= a2.c > > rte_szedata2_eth_dev_init() which is used from probe? > > >=20 > for szedata2, this is easily fixed by using the driver name directly > from the #define above. >=20 > diff --git a/drivers/net/szedata2/rte_eth_szedata2.c > b/drivers/net/szedata2/rte_eth_szedata2.c > index 8f92e72..4e5e01c 100644 > --- a/drivers/net/szedata2/rte_eth_szedata2.c > +++ b/drivers/net/szedata2/rte_eth_szedata2.c > @@ -1474,7 +1474,7 @@ struct szedata2_tx_queue { > PMD_INIT_FUNC_TRACE(); >=20 > PMD_INIT_LOG(INFO, "Initializing eth_dev %s (driver %s)", data->n= ame, > - dev->device->driver->name); > + RTE_STR(RTE_SZEDATA2_DRIVER_NAME)); >=20 > /* Fill internal private structure. */ > internals->dev =3D dev; > @@ -1525,7 +1525,7 @@ struct szedata2_tx_queue { > ether_addr_copy(ð_addr, data->mac_addrs); >=20 > PMD_INIT_LOG(INFO, "%s device %s successfully initialized", > - dev->device->driver->name, data->name); > + RTE_STR(RTE_SZEDATA2_DRIVER_NAME), data->name); >=20 > return 0; > } > @@ -1547,7 +1547,7 @@ struct szedata2_tx_queue { > rte_free(dev->data->mac_addrs); >=20 > PMD_DRV_LOG(INFO, "%s device %s successfully uninitialized", > - dev->device->driver->name, dev->data->name); > + RTE_STR(RTE_SZEDATA2_DRIVER_NAME), dev->data->nam= e); >=20 > return 0; > } OK, I'll include such change in next version.