From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com [209.85.192.179]) by dpdk.org (Postfix) with ESMTP id 072E35677 for ; Mon, 8 Feb 2016 11:05:17 +0100 (CET) Received: by mail-pf0-f179.google.com with SMTP id o185so107362691pfb.1 for ; Mon, 08 Feb 2016 02:05:16 -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=mortp65ue5cKEM0bheT+rvRqhSRaVznih6+4JWpcasc=; b=up82WEMKV1zX8NTD3K8eCssQU4e41BWoTKRd18yiQiQIlTE1eklDaFVF2F5wyB8Zk5 HOWd1uYAOnBcEjVCk5cCb1laO3mY7/tWqMFq6nk1Od4+bOQVVHpEGAJV+MR+NkyaXBUj JtBWMdVepH+7JHHY0zr4W2xk1FrphkT4c+9N2AZQ9qHJQaL2s6FzS6TUPBf4lI4Lrz8G xvAX8ug2xzwqFVDPLRQruaDJ9YXQkGLcJbCj8DyXpIDJorUMdHT0TgQW5kWzUEM210aV 9hxW/rFRFknDHYetNPk+CsTuzEk3M1H2aMQ91EEewRAj2dsMkAYJZvWL/T9WKPbQ1ii/ BkCQ== 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=mortp65ue5cKEM0bheT+rvRqhSRaVznih6+4JWpcasc=; b=eqkfSGXCqfl4XSbyhD1a0tHntM1r0yvylFbHdUaAmWeCck2uILMzIjAaQn/Sso2Kkf jeOOTpmPARcmbd4qORGWWP9MGLkse1SVmR4kJv+jU82OZLnS0mkoa+gaHHH+rnYf9PLq Vr4OCMI+eSs6xG7NDt7aCk5C3djrCFQvtLyfRrLoAXgokLPstPK6WnoDFPjg4Cg9mA0J 3Ub0ydyC08NmL2zEyR/zVW3Nx+cVGVbV3wkXHJXdIZqrTWTSqkl8talKKjQAb7bsjXtM 4yYf0vaQXBopIxQ/CMQJs4HiEJWgk1yVl4WTfQf6J3ODQ023/Ar9DCKeARWv0WsNVVGX dTsQ== X-Gm-Message-State: AG10YORJFUlpNdRbRfnpxVAiRVV5TzZmHcrH9e4HR7inGHKRgHXh/JWp0mRfCU0guZy+XnYJ X-Received: by 10.98.71.130 with SMTP id p2mr40847411pfi.99.1454925916321; Mon, 08 Feb 2016 02:05:16 -0800 (PST) Received: from santosh-Latitude-E5530-non-vPro.mvista.com ([110.172.16.133]) by smtp.gmail.com with ESMTPSA id r26sm42183314pfb.21.2016.02.08.02.05.12 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Feb 2016 02:05:15 -0800 (PST) From: Santosh Shukla To: dev@dpdk.org Date: Mon, 8 Feb 2016 15:33:34 +0530 Message-Id: <1454925815-14292-1-git-send-email-sshukla@mvista.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <0000-cover-letter.patch> References: <0000-cover-letter.patch> Subject: [dpdk-dev] [PATCH v8 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: Mon, 08 Feb 2016 10:05:17 -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 Acked-by: Anatoly Burakov --- v7-->v8: - included Anatoly acked-by: 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