From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by dpdk.org (Postfix) with ESMTP id 9F6CDC12E for ; Thu, 18 Feb 2016 06:26:11 +0100 (CET) Received: by mail-pa0-f50.google.com with SMTP id ho8so24910704pac.2 for ; Wed, 17 Feb 2016 21:26:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=M0tcfBrJ+Onnm5lAhZTkxadL9DhOEa1sNYaRt6knCpQ=; b=oBKhfKeCAqJMshJYgtQ4/hMe+ePo++jwtIRX/lZNVXRGAKey9TOItBN67jDwT+QoGB +CQrDZ+AFlevscn4TYGz24orR/fIgRO0QJDNDmpxwegh46luQzM2JwPiWLCtoIjyQqdO oQLjmRj7f8Cigm2CLO/n5f3UE312IOaLmnKXssIwI7khg3maE3/f/NbKsBkh4wzuf9zh DgVBNLC0DQHLAK7tUQJ/B6Rs4ky1VZBw3+TeniU5Rn9jip7Sl5/lhM78rInI3AZ1VSlg siKgKTtPFVZ7n0y9UoAukEVFkkjxJQJfVDCqDkInR344IBpfhWakqthhRbLv6XbKbzXa qzJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=M0tcfBrJ+Onnm5lAhZTkxadL9DhOEa1sNYaRt6knCpQ=; b=iYvp7ReC6v5ZQcVQyZAWrjxBCoktuAz5ANv15pTobgED2OHS6Qq7RMpSnZnFGuwru2 PM78Mb4UIJDp84A/cAQhdRMbjWW3FC11l2AB/GzC1aBjgcKnb/4wKAWEncaQIYgp7kSJ Ur3JKS5qEnjkhmEWZ8sbZogxkkHdVB3caw5yJTmQr89yYLug6ZdYh7F/gqgP8X92+3NX pnfa/SJe2iq7UFUVIl+pobCN1MkU1YLvG2oRb7t4cWUFRS6oAy5aTuq5J1qoeH86e+cY 5bxteInED2ysjDHgfQKDZ5eIMjCnNHkzaiyCouahqMzVP+aoT0xuczsjWa58vcd7hCwu Xw6w== X-Gm-Message-State: AG10YOTUVW2/eqvibu1o2HovkvuBv9ow4MIOF7D2vGwjyvJq3R8qzJsXg4nuz3TpksZeuj1TKPPKgDSFv9QmSZG8 MIME-Version: 1.0 X-Received: by 10.66.141.71 with SMTP id rm7mr7598130pab.106.1455773171069; Wed, 17 Feb 2016 21:26:11 -0800 (PST) Received: by 10.66.12.132 with HTTP; Wed, 17 Feb 2016 21:26:11 -0800 (PST) In-Reply-To: References: <1454853068-14621-1-git-send-email-sshukla@mvista.com> <1454853068-14621-4-git-send-email-sshukla@mvista.com> Date: Thu, 18 Feb 2016 10:56:11 +0530 Message-ID: From: Santosh Shukla To: "Burakov, Anatoly" Content-Type: text/plain; charset=UTF-8 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v7 3/4] eal/linux: vfio: ignore mapping for ioport region X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2016 05:26:12 -0000 On Mon, Feb 8, 2016 at 2:45 PM, Burakov, Anatoly wrote: >> vfio_pci_mmap() try to map all pci bars. ioport region are not mapped in >> vfio/kernel so ignore mmaping for ioport. >> >> Signed-off-by: Santosh Shukla >> --- >> lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 20 ++++++++++++++++++++ >> 1 file changed, 20 insertions(+) >> >> diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c >> b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c >> index ffa2dd0..4832313 100644 >> --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c >> +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c >> @@ -659,6 +659,7 @@ pci_vfio_map_resource(struct rte_pci_device *dev) >> struct pci_map *maps; >> uint32_t msix_table_offset = 0; >> uint32_t msix_table_size = 0; >> + uint32_t ioport_bar; >> >> dev->intr_handle.fd = -1; >> dev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN; @@ -853,6 >> +854,25 @@ pci_vfio_map_resource(struct rte_pci_device *dev) >> return -1; >> } >> >> + /* chk for io port region */ >> + 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 config >> space!\n", >> + PCI_BASE_ADDRESS_0 + i*4); >> + return -1; >> + } >> + >> + if (ioport_bar & PCI_BASE_ADDRESS_SPACE_IO) { >> + RTE_LOG(INFO, EAL, >> + "Ignore mapping IO port bar(%d) addr: >> %x\n", >> + i, ioport_bar); >> + continue; >> + } >> + >> /* skip non-mmapable BARs */ >> if ((reg.flags & VFIO_REGION_INFO_FLAG_MMAP) == 0) >> continue; >> -- >> 1.7.9.5 > > Acked-by: Anatoly Burakov Merge request for this one too..