From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v3 04/12] linuxapp/vfio: ignore mapping for ioport region Date: Thu, 7 Jan 2016 10:16:49 -0800 Message-ID: <20160107101649.3a0384d2@xeon-e3> References: <1452184390-5994-1-git-send-email-sshukla@mvista.com> <1452184390-5994-5-git-send-email-sshukla@mvista.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Santosh Shukla Return-path: Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by dpdk.org (Postfix) with ESMTP id E6465B3D6 for ; Thu, 7 Jan 2016 19:16:42 +0100 (CET) Received: by mail-pa0-f46.google.com with SMTP id cy9so264469256pac.0 for ; Thu, 07 Jan 2016 10:16:42 -0800 (PST) In-Reply-To: <1452184390-5994-5-git-send-email-sshukla@mvista.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This looks like the right thing to do. Minor nits. > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > index 74f91ba..4077eb6 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > @@ -760,6 +760,26 @@ pci_vfio_map_resource(struct rte_pci_device *dev) > return -1; > } > > + /* chk for io port region */ > + uint32_t ioport_bar; In general DPDK has followed the kernel practice of putting declarations at the start of function/basic block. It is ok by me, but just noting that the rest of the code doesn't do it. > + ret = pread64(vfio_dev_fd, &ioport_bar, sizeof(ioport_bar), > + VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) > + + PCI_BASE_ADDRESS_0 + i*4); > + > + if (ret != sizeof(ioport_bar)) { > + RTE_LOG(ERR, EAL, > + "Cannot read command (%x) from PCI config" > + "space!\n", PCI_BASE_ADDRESS_0 + i*4); Please dont split the line of a log message string in mid sentence. > + return -1; > + } > + > + if (ioport_bar & PCI_BASE_ADDRESS_SPACE_IO) { > + RTE_LOG(INFO, EAL, "\tIgnore mapping since Its a i/o" > + "port bar (%d) addr : %x\n", i, same here > + ioport_bar); > + continue; > + } > +