From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by dpdk.org (Postfix) with ESMTP id DD6678E9A for ; Thu, 14 Jan 2016 14:28:59 +0100 (CET) Received: by mail-pa0-f47.google.com with SMTP id ho8so116260277pac.2 for ; Thu, 14 Jan 2016 05:28:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pphyNZ/1wXhUbflQIl1TsN0Mb+po8Aj7Gw8S24inp3M=; b=Njk3h4mhNJ5U81bE5/BxstKpN+Bc+R5BHj7ezpsS9A2PTNqAgSJzEOKL+FvI09cY4p HicII+yDS098L4uoRmq4e3xOCeHkohe0TejHzBFNtOvsTBIvGWKoMm/rhY4umriKi/cC OI2Rdiz8u84+vw8/qLCPOjEnq+qjNUpywPQg6B4UA672iF0epQ3Wz4tefDSQ2kpS4GVr yyNI9yS9ao+PsXcrgg/Hx3RxvNDWFwyASAd6QyGvJ2+LrRxgcE9HtEiSnenk156vHJ3k TDod+kJAFgfbRoefFywRxMN5l/7VrVET8ims1rvEblmE6nOtPTWNXKw6pLJrwxMhU4kd TpXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pphyNZ/1wXhUbflQIl1TsN0Mb+po8Aj7Gw8S24inp3M=; b=kspkLA8DaCPLqwBcv6Y+bRuP4c+FK8dNdwPAgkm6UbikZl9xTPwIx4ySXNUhBSz1xA DcvEtk/M1Z54vL/Ky96JX4F2gfUk33iZNh5/Lsf4OtATV2I1ewsPu0wgKHydEm/gUsNM 0iecTPk+5ssXhc0UEqhOQeOcf3emD0hKbwUzLJNL02cRiU1uKBgMg0XtqQfzI9LM9Zy4 P8XohdXi595Jn2VrstMwCOZi5CrSNBvHWx1k75I4wyhOL7Al6SHFIIjhyHTIoWaEOUJp K9ueRDlh6p8rVi/nZDUCRBjVz6cCVVPwMB1VgcR53Cf74/7OuChtMjpqnHyjjtiahKwj 4WdA== X-Gm-Message-State: ALoCoQmHY34F6QkAozEzabnwuX7ERW1cLyblEpnO5+cdGpuNHqPNQgXDEP5vCW8i7MpPS23Gy46czjUvrb4YhB36QDucULyR8Q== X-Received: by 10.66.90.133 with SMTP id bw5mr5842964pab.22.1452778139233; Thu, 14 Jan 2016 05:28:59 -0800 (PST) Received: from santosh-Latitude-E5530-non-vPro.mvista.com ([111.93.218.67]) by smtp.gmail.com with ESMTPSA id v71sm9438472pfi.91.2016.01.14.05.28.56 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jan 2016 05:28:58 -0800 (PST) From: Santosh Shukla To: dev@dpdk.org Date: Thu, 14 Jan 2016 18:58:27 +0530 Message-Id: <1452778117-30178-5-git-send-email-sshukla@mvista.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1452778117-30178-1-git-send-email-sshukla@mvista.com> References: <1452778117-30178-1-git-send-email-sshukla@mvista.com> Subject: [dpdk-dev] [PATCH v4 04/14] linuxapp/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, 14 Jan 2016 13:29:00 -0000 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 --- v3->v4: per review comment from Stephen and Yuan. - removed ioport_bar var declaration with in func to top of func - rearrange log message to fit with in 80 line 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 74f91ba..abde779 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c @@ -573,6 +573,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; @@ -760,6 +761,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