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 2536F567C for ; Tue, 13 Jun 2017 10:18:24 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id AB74020657; Tue, 13 Jun 2017 04:18:23 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 13 Jun 2017 04:18:23 -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=TAMqvWvYg5WtO1K XqhmK8D6YLaFgx/H4CwmzfBvnkDc=; b=lEil0bpwKLRJ4CIwa6mW9Rbxos+IQZk 0MoiyMlLQB7UAy6Q5YhU79/9rDVXeAG1x6oyrQcvXz/JNfAPd48iwmzgz1mM18pf bgwj7l3f18h2hAevbEOkSv2KmWSce2QC4QDTWj/wZU+RrR9DxS4Y49vTxSQR28HE 5w1SJGdn0mCo= 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=TAMqvWvYg5WtO1KXqhmK8D6YLaFgx/H4CwmzfBvnkDc=; b=jCJ7tiSX /ZLCTnAOYJphBtVUf4LtYD/thVpep026qPij+FXXb5VsJ4/Zcmph9WPgwRrk7LxP CmDZkDgQwOPA+j4NZ7uLFgP0gl1xDtWm8p0m3QVfVC1E3CjpYutQL3twoWGF2Vzz PtQ5O0FLeMTZD6ORSnrhFIl8KMkFD10lniclqEtqRjCKIOIcChdNIAYcWNFd0uUK Um2x+lfZL54wfl69H3ELqRO+GRheDcxzwLKPTUgICsxksSHyjLbahyE2SHJAeZtD lCQC1KRJ54I/3uATOzoAoEfiSH7poVNew6JykO4+UDunO/oSRGcloCk8dnNGVriI tNcQueSfW7BVPA== X-ME-Sender: X-Sasl-enc: IabGhVmy1gT88xrk5aJOqzjX7RHGd8VWXSTl1mdeFoID 1497341903 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 5CC7F248E7; Tue, 13 Jun 2017 04:18:23 -0400 (EDT) From: Thomas Monjalon To: Jerin Jacob Cc: dev@dpdk.org, ferruh.yigit@intel.com Date: Tue, 13 Jun 2017 10:18:22 +0200 Message-ID: <1705037.j4M6qrxloR@xps> In-Reply-To: <20170613072405.GA29658@jerin> References: <20170608114414.8787-1-jerin.jacob@caviumnetworks.com> <1987640.XeQgTMmFpU@xps> <20170613072405.GA29658@jerin> 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: Tue, 13 Jun 2017 08:18:24 -0000 13/06/2017 09:24, Jerin Jacob: > From: Thomas Monjalon > > 13/06/2017 06:43, Jerin Jacob: > > > From: Thomas Monjalon > > > > 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? > > > > > > Yes. > > > > > > > Shouldn't it be less hacky to probe it as a (new) null class? > > > > > > The Vendor and Class ID is same for those device too so we need to map > > > the PCI bar and have access to know the class of device. If you are concerned about > > > if it an common code change, My first version was without common code change. > > > http://dpdk.org/dev/patchwork/patch/24983/ > > > > > > Ferruh would like to have flag scheme, I think it make sense for > > > PMD maintenance perspective. > > > > Yes > > > > My idea was to have a new class of device interface to reserve those > > resources, so the probe function would succeed. > > Do you think it would be a good idea? > > Currently Kernel PF code creates 12 SRIOV VF devices per port(one VF device has > 8 queues === 96 queues(12VFs) for 96 cores(thunderx max cores)), out of that 1 VF > device is _primary_ which mapped to dpdk ethdev port. If probe succeeds for > another 11 VFs then too may ethdev NULL ports show up. We can support > up to 12 ports(12*12 VF = 144 ports). I think, it is not good from > end user perceptive. We already have unsupported device concept in eal device > framework(when probe returns > 0). IMHO, it OK to keep as it for > simplicity. Thanks for the explanation. So we have a flag RTE_PCI_DRV_KEEP_MAPPED_RES for this kind of device. Maybe someone else will think to another usage of a null interface, so I would like to keep this idea floating in the air, just in case :)