From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f176.google.com (mail-pf0-f176.google.com [209.85.192.176]) by dpdk.org (Postfix) with ESMTP id 4B49F8E96 for ; Tue, 19 Jan 2016 12:46:42 +0100 (CET) Received: by mail-pf0-f176.google.com with SMTP id n128so174220119pfn.3 for ; Tue, 19 Jan 2016 03:46:42 -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=Lpe+dlVU1VdfJIocxcw5lC1Qfad5/yPIht9feeUKGFk=; b=08LJiwARIfk6XjtqzjvxMV5zfYg4o8bqgwK1zE3qcTWFuZ0ZkOxVmF/8eBQv7eos2J c2frG2dv9iNMKMzLAcgijRjopL5TppPkw5KCJeuLcSPKdafJJcjhSMVrm8wAikYBRmpx qrssTLLx5giDg0itEBcLVWpGAR5f13GuxSHrVV0FRGxw9bH36jzVI4EBNtcKdWftNpyw FT/GPjvG5Harq2KcWoEZS5ijJOx/lymsiml8vIp+v931DEy2PO4P1+ZeIMOib332fqxx ErCTkhPX9PNVOoZ+GBjeK8g0VyZ/VLbKA08ZDsWw+oCP/Nrp83sRzCFUYf7WtgkAQG3L ofoA== 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=Lpe+dlVU1VdfJIocxcw5lC1Qfad5/yPIht9feeUKGFk=; b=Ek47kyWSPkFdfl6hwiiQTWsVCSHYv4YzR9HwTueO2CjOB9kVk8mwPQR/29tzTDsSLJ C3MU6ZjlbiRt/nxp6aeCySjRgJz3HKLop0JqGSwdG0eRI7gJ/L0VmdKr9LdguH7ZDrIw rIO4whWJJwjFT65tmVZM+v7bEOBeVkeV3CuHOMU8b+o6ad+0E7nIK4UBSCPsBYcBtLtB gilurl4X19/4q4kdPEIaSYSnbuhiOTwcbwa2VsO0dMtHyO4uYWy54ElJqUp2dgEvFfPr LRa8PeyEPnuvEWYaTFnU6M+p8k695+fhP9dWYoB2ZrVU6a2HkXAbbz/PlBcmNg8qlasd lwtQ== X-Gm-Message-State: ALoCoQkEAspoPetuqpkIhL4kwmwsxQGJF7dB/FaUjaa59Nr8XzieFO5g8KwN2D7ZXJ2+g40nSImQH6y6NF71kCsYiNexuRbPKw== X-Received: by 10.98.73.212 with SMTP id r81mr43854487pfi.140.1453204001618; Tue, 19 Jan 2016 03:46:41 -0800 (PST) Received: from santosh-Latitude-E5530-non-vPro.mvista.com ([111.93.218.67]) by smtp.gmail.com with ESMTPSA id 75sm41014170pfj.20.2016.01.19.03.46.38 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jan 2016 03:46:40 -0800 (PST) From: Santosh Shukla To: dev@dpdk.org Date: Tue, 19 Jan 2016 17:16:04 +0530 Message-Id: <1453203972-24855-4-git-send-email-sshukla@mvista.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1453203972-24855-1-git-send-email-sshukla@mvista.com> References: <1453203972-24855-1-git-send-email-sshukla@mvista.com> Subject: [dpdk-dev] [PATCH v5 03/11] 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: Tue, 19 Jan 2016 11:46:42 -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 --- 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