From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 918751B26D for ; Fri, 6 Oct 2017 09:56:33 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B5D5B2089E; Fri, 6 Oct 2017 03:56:32 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Fri, 06 Oct 2017 03:56:32 -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=Ue96/qq+4C9Gfkl Wgbt7yVPleB8a/vPk1XFhSvEH4BU=; b=aXFEv5zNRBW5d+X4xpERHI6ouNIzci1 W9gXHFLKtCER52M6YSnXzx8+ecVS6C0rxPmf281PcQ0mFnhKG4V4+EFtdY6ESzOh HAty62qrTCoB+npNMUZGKioKhw8lEKzYe4FLZiTa9DcNTbjXX3SKJdaXaXa8xew2 /80BCXKK+NN0= 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=Ue96/qq+4C9GfklWgbt7yVPleB8a/vPk1XFhSvEH4BU=; b=lPrBwICo AoeFw8cfXHh9LhZjSeicpGhBMWNvIRtoYDP4HxRCQzu1D9FELGgH0OZxyjPhiJJr I2rwBG/V+GS82n1bg2puwPNvZap6VKA5B00209ijTYCFnaXTvEKr/Tz/wn1Tdhw6 1Suhv2Xil0GTpIT3ZngMxYAON0PsQI5dGycw/HJo8YKYNlRHtxTKa+vYO0MlBAqZ jPhb/862V24VCWjM0VLC+4gGCwpKGkvIbtap0HiddD9a/YOcL8kWOxSDKkeZON1b xksfTmeqbyQrvUjoucfHs5xDMj8gmhaWXQCEhNUwcHSriog8yhiaJrbz1zfORlFj eb/+EaYFEUGS6Q== X-ME-Sender: X-Sasl-enc: 16q7C0UEE7rgdLlcJ/4iqi1x6ut2zfE9HgrxdwU+kaXF 1507276592 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 6345C7F066; Fri, 6 Oct 2017 03:56:32 -0400 (EDT) From: Thomas Monjalon To: santosh Cc: dev@dpdk.org, olivier.matz@6wind.com, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, aconole@redhat.com, stephen@networkplumber.org, anatoly.burakov@intel.com, gaetan.rivet@6wind.com, shreyansh.jain@nxp.com, bruce.richardson@intel.com, sergio.gonzalez.monroy@intel.com, maxime.coquelin@redhat.com Date: Fri, 06 Oct 2017 09:56:31 +0200 Message-ID: <2694672.spkdGrOdmf@xps> In-Reply-To: <7e38bb97-953b-b5ac-08af-bc695e0c45d9@caviumnetworks.com> References: <20170918104234.9149-1-santosh.shukla@caviumnetworks.com> <8068060.8YhcFxlhvD@xps> <7e38bb97-953b-b5ac-08af-bc695e0c45d9@caviumnetworks.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v9 3/9] linuxapp/eal_pci: get iommu class 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, 06 Oct 2017 07:56:33 -0000 06/10/2017 05:22, santosh: > > On Friday 06 October 2017 05:47 AM, Thomas Monjalon wrote: > > 20/09/2017 13:23, Santosh Shukla: > >> +/** Device driver supports iova as va */ > >> +#define RTE_PCI_DRV_IOVA_AS_VA 0X0040 > > This flag name is surprizing and the comment does not help. > > For the comment: > > "Device driver supports I/O virtual addressing" ? > > For the flag: > > RTE_PCI_DRV_IOVA ? > > Read [1]. > > V9 series went through evolution as a result of thorough review process. > That name kept like above is - "Not for FUN", its for reason and its purpose > to be explicit by saying that "driver need iova as va" mode. So as comment > aligned on top says so. > > Aron suggested to remove [1] and squash into this patch and that I did. > > Your proposition is incorrect, Should says IOVA_AS_VA explicitly!. > Request to follow work history, sorry I agains can't find you comment > logical. Yes my proposal is not good. > [1] http://dpdk.org/dev/patchwork/patch/27000/ > > > [...] > >> /* > >> - * Get iommu class of pci devices on the bus. > > This line has been added in previous patch. > > Please fix it earlier. > > What to fix? Be more explicit, can;t understand your comment. You make this change: - * Get iommu class of pci devices on the bus. + * Get iommu class of PCI devices on the bus. It is better to write squash this uppercase change in previous commit where you introduce this comment. > > [...] > >> +/* > >> + * Any one of the device has iova as va > >> + */ > >> +static inline int > >> +pci_device_has_iova_va(void) > > The name of this function does not suggest that it scans > > every devices. > > Its not scanning, It search for kdrv match. You misunderstood. > disagree. Yes my wording is not understandable. By "scanning", I mean interating on lists. About the function name, it could be: pci_one_device_has_iova_va It better shows that the function check every devices. > >> +{ > >> + struct rte_pci_device *dev = NULL; > >> + struct rte_pci_driver *drv = NULL; > >> + > >> + FOREACH_DRIVER_ON_PCIBUS(drv) { > >> + if (drv && drv->drv_flags & RTE_PCI_DRV_IOVA_AS_VA) { > >> + FOREACH_DEVICE_ON_PCIBUS(dev) { > >> + if (dev->kdrv == RTE_KDRV_VFIO && > >> + rte_pci_match(drv, dev)) > >> + return 1; > >> + } > > This is the reason of exporting the match function? > > (note: match() is bus driver function, so it should not be exported) > > Just because you get every devices without driver filtering? > > I disagree, It is a bus function abstraction code w.r.t iommu class of device, > in case you missed reading source code and Implementation is correct. > That needs exporting rte_pci_match(). Or else > write code and show your code snippet as illustration, I doubt that you really > understood this whole topic and its design theme. OK, let's imagine I don't understand the whole topic. > > There should be a better solution. > > Please try to compare drv with dev->driver. You could have answered that dev->driver is filled on probing and you are doing the check before probing. I don't want to continue this discussion. We will rework which functions are exported when moving the PCI driver out of EAL.