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 C27651B9CE for ; Fri, 12 Oct 2018 17:50:54 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 3C9AD2211B; Fri, 12 Oct 2018 11:50:54 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 12 Oct 2018 11:50:54 -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=Y5WNbDML/2v9B95sI52KDiFj3jnKDQqfN1kQF8oScLE=; b=JigSo3ofpSG8 5VmYj3Zig+iclxpiMcRzTQIAMyZTbCKoIDJIR2TvFbcm0QDxHeXUGAJAEEV3kU4M ofAsD8clCK/mo5Aqlq61gLdOz62/nX3BamXZ2X8erIatTsoPs0iPdxUKERDQgcep QhDYLXHgBf8n5kwWBEBQ1nPxzLAvQvI= 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=Y5WNbDML/2v9B95sI52KDiFj3jnKDQqfN1kQF8oSc LE=; b=PMLF2cM7eDLHmQO8p0yzgrOad0fJoV5Frs/43OIdOBlN22jDGvi5Bh0Kr TBq0ii65gXUWSQM0cqeZHnID0L12WHkcTaIzaKqyoAl6jCfQoymh8eapl1Q9daIu SnyIMQJXQ/P7p6luwariXDa1hKE+yRUi+RNzyLxE8F88uk7wOsCyvwuAfkD9ThAH AmKAIIeBnYH3JwfZ+yN6fag+IuBna2yqEQGQmRo/QisFcYjlXqcK9JatL0KJ68IL RHNDyf5X2Tev5wEqOF041Sg+FwjWbMoXXecppUs3j0eztNEFSDV/HvcXfOPNsJaf +QkUtAUMakuP3Sll6+jymJ1Z1w0eQ== 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 5362F102EA; Fri, 12 Oct 2018 11:50: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, Jan Remes , Shahaf Shuler , Yongseok Koh Date: Fri, 12 Oct 2018 17:50:50 +0200 Message-ID: <2068453.Uvx6fECcdx@xps> In-Reply-To: <14058760-a35c-c991-74c1-8a86b39df5b0@solarflare.com> References: <20180907230958.21402-1-thomas@monjalon.net> <20181011210251.7705-3-thomas@monjalon.net> <14058760-a35c-c991-74c1-8a86b39df5b0@solarflare.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 15:50:55 -0000 12/10/2018 09:44, Andrew Rybchenko: > 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 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 > > Reviewed-by: Andrew Rybchenko > > Have you seen driver->name usage in drivers/net/szedata2/rte_eth_szedata2.c > rte_szedata2_eth_dev_init() which is used from probe? > > It looks like drivers/net/mlx5/mlx5.c > mlx5_pci_probe()->mlx5_dev_spawn()->mlx5_dev_to_port_id() goes > to device->driver. Is the code OK with the move? This access in mlx5 looks useless. It is comparing driver names while already comparing rte_device pointers. If 2 devices are the same, they will have the same driver... I will remove it.