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 38F391B1BD for ; Fri, 6 Oct 2017 02:17:24 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 90FCC20B11; Thu, 5 Oct 2017 20:17:23 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Thu, 05 Oct 2017 20:17: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=SzYU5D+Qrpn+4SP ffDXD0LAOlQERVV6ZhOAcNKytAZs=; b=Fvlh8NELeGRzXg8sqs0IZ4b8IRe6RIT 7L3bUqP76vdZ5XYYzM2iISKWeAU012DAwnkrvk2vepQh+Wz4MVOfEvln/5iOlW2G ciW0O0l2VT2uMMYSUTsgKBN51SYx5Jq2tP+wSIawJzzhmeivNDNZsqyUNujZNEX4 BIt0KNNVqFHo= 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=SzYU5D+Qrpn+4SPffDXD0LAOlQERVV6ZhOAcNKytAZs=; b=JfJGRJGk n18eaUi2JslPF2SyNcNh1mE+4XpHz9jfXqHlBne+9H7Y98EuV8XsCcO34TUcX14B ro623sWqbrLCZlPBPz97PqEE/ME8rQCnBaGxepUVpKfFiL7ImVzcDz+YRTr9D0RC tNGyKBZtdWJbRuBnN37J+aL7SybsOm3KIOpN80Nfkn+JwTWndj86vz5IUlnxHTGc +wFDNQzVp6304P9uUHrsA8QggAJQXlsl2NdLVhNGPA1D3IUZVkCgp48qjXPxgfQN koZD9Reu7/GNjX7dPeXMBBU0cJ4MP6VvxaxljLEF82D4wHrLatd0hmFY5qDDkSa4 OwlOF6T7uZRS7g== X-ME-Sender: X-Sasl-enc: Cdm+0jluFw8cvbCvxPiW+dvRC1xfW++250Dk2uQn+6dk 1507249043 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 2CFF47E1D8; Thu, 5 Oct 2017 20:17:23 -0400 (EDT) From: Thomas Monjalon To: Santosh Shukla 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 02:17:22 +0200 Message-ID: <8068060.8YhcFxlhvD@xps> In-Reply-To: <20170920112356.17629-4-santosh.shukla@caviumnetworks.com> References: <20170918104234.9149-1-santosh.shukla@caviumnetworks.com> <20170920112356.17629-1-santosh.shukla@caviumnetworks.com> <20170920112356.17629-4-santosh.shukla@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 00:17:24 -0000 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 ? [...] > /* > - * Get iommu class of pci devices on the bus. This line has been added in previous patch. Please fix it earlier. [...] > +/* > + * 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. > +{ > + 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? There should be a better solution. Please try to compare drv with dev->driver.