From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 5142C3DC for ; Mon, 12 Jun 2017 18:21:35 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6B9D52097C; Mon, 12 Jun 2017 12:21:34 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 12 Jun 2017 12:21:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=LczccJYWXlMCx/m ew+OoqW6+UWgw1LpZog35J4fjSmo=; b=KQotnBPcVIDFqICbV4Xdl4VrubWHCz3 jRKGFCUOYJ5fKvH+KSlM7DUbNfGuYpCaUEdFCf7/eoYigr97B8hgV3V6sl3DHHUB mHbc7NGoDrob23FqwnlUn41Th3Qfy9C+rN6EyLaiA86Msrnd1k/nmhIVerYW4qNz T7qsAESxcuH4= 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-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=LczccJYWXlMCx/mew+OoqW6+UWgw1LpZog35J4fjSmo=; b=j0nJ9jui PdwkwLYpx3ofzB5Du5MuRsyWFSVfes4Ry5Fd4Dcj3/F7V6OdbNFYauD8fdD4viaf J38SxgsQRgyE2/Mxt48G9hOH14xd0CJDa6ldcN59q42oPR93/rQf7dgrU8LkIoVV O6nDKl8xw4R4XGtMDqWlC/1xbM5/eQJUovTWx9wcxbSQ1C6/WFqHJlYYIFIg3wgr j9cQbBEX0AHu+O3nHbARl+MVzJSxKCr9n49Kf8uX3rIDD5HuRQVQf1cYqVvXF5SN zldbJoyNnETTD8AcOdU65Yn45NK0o9iOkbyAPqKzrPot+3WKdcaJRuuqfpybdQdS UCYtBpN2aXm4Mg== X-ME-Sender: X-Sasl-enc: pP/CRMGMbbAdzl4ZF7fjjeOgys/VlIBzH6t5240CcJVL 1497284494 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 21D1B7E8B7; Mon, 12 Jun 2017 12:21:34 -0400 (EDT) From: Thomas Monjalon To: Jerin Jacob Cc: dev@dpdk.org, ferruh.yigit@intel.com Date: Mon, 12 Jun 2017 18:21:33 +0200 Message-ID: <11032075.7h2FW7WDNx@xps> In-Reply-To: <20170609102746.13828-1-jerin.jacob@caviumnetworks.com> References: <20170608114414.8787-1-jerin.jacob@caviumnetworks.com> <20170609102746.13828-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 1/2] eal/pci: introduce a PCI driver flag 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: Mon, 12 Jun 2017 16:21:35 -0000 09/06/2017 12:27, Jerin Jacob: > Some ethdev devices like nicvf thunderx PMD need special treatment for > Secondary queue set(SQS) PCIe VF devices, where, it expects to not unmap > or free the memory without registering the ethdev subsystem. > > Introducing a new RTE_PCI_DRV_KEEP_MAPPED_RES > PCI driver flag to request PCI subsystem to not unmap the mapped PCI > resources(PCI BAR address) if unsupported device detected. > > Suggested-by: Ferruh Yigit > Signed-off-by: Jerin Jacob [...] > --- a/lib/librte_eal/common/eal_common_pci.c > +++ b/lib/librte_eal/common/eal_common_pci.c > @@ -221,7 +221,12 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr, > ret = dr->probe(dr, dev); > if (ret) { > dev->driver = NULL; > - if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) > + if ((dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) && > + /* Don't unmap if device is unsupported and > + * driver needs mapped resources. > + */ > + !(ret > 0 && > + (dr->drv_flags & RTE_PCI_DRV_KEEP_MAPPED_RES))) > rte_pci_unmap_device(dev); > } > > --- a/lib/librte_eal/common/include/rte_pci.h > +++ b/lib/librte_eal/common/include/rte_pci.h > +/** Device driver needs to keep mapped resources if unsupported dev detected */ > +#define RTE_PCI_DRV_KEEP_MAPPED_RES 0x0020 If I understand well, you want to map resources but not probe it? Shouldn't it be less hacky to probe it as a (new) null class?