DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vfio: open VFIO container at startup rather than during init
@ 2014-06-17  9:12 Anatoly Burakov
  2014-06-17 16:50 ` Richardson, Bruce
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Anatoly Burakov @ 2014-06-17  9:12 UTC (permalink / raw)
  To: dev


Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
index 4de6061..9eb5dcd 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
@@ -523,17 +523,6 @@ pci_vfio_map_resource(struct rte_pci_device *dev)
 	rte_snprintf(pci_addr, sizeof(pci_addr), PCI_PRI_FMT,
 			loc->domain, loc->bus, loc->devid, loc->function);
 
-	/* get container fd (needs to be done only once per initialization) */
-	if (vfio_cfg.vfio_container_fd == -1) {
-		int vfio_container_fd = pci_vfio_get_container_fd();
-		if (vfio_container_fd < 0) {
-			RTE_LOG(ERR, EAL, "  %s cannot open VFIO container!\n", pci_addr);
-			return -1;
-		}
-
-		vfio_cfg.vfio_container_fd = vfio_container_fd;
-	}
-
 	/* get group number */
 	iommu_group_no = pci_vfio_get_group_no(pci_addr);
 
@@ -770,10 +759,10 @@ pci_vfio_enable(void)
 		vfio_cfg.vfio_groups[i].fd = -1;
 		vfio_cfg.vfio_groups[i].group_no = -1;
 	}
-	vfio_cfg.vfio_container_fd = -1;
+	vfio_cfg.vfio_container_fd = pci_vfio_get_container_fd();
 
 	/* check if we have VFIO driver enabled */
-	if (access(VFIO_DIR, F_OK) == 0)
+	if (vfio_cfg.vfio_container_fd != -1)
 		vfio_cfg.vfio_enabled = 1;
 	else
 		RTE_LOG(INFO, EAL, "VFIO driver not loaded or wrong permissions\n");
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2014-06-18 23:09 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-17  9:12 [dpdk-dev] [PATCH] vfio: open VFIO container at startup rather than during init Anatoly Burakov
2014-06-17 16:50 ` Richardson, Bruce
2014-06-17 16:55 ` Thomas Monjalon
2014-06-18  8:57   ` Burakov, Anatoly
2014-06-18 10:08     ` Dumitrescu, Cristian
2014-06-18 10:26       ` Burakov, Anatoly
2014-06-18 11:00         ` Neil Horman
2014-06-18 11:02           ` Burakov, Anatoly
2014-06-18 11:07             ` Neil Horman
2014-06-18 13:07 ` [dpdk-dev] [PATCH v2 0/2] Fix issues with VFIO Anatoly Burakov
2014-06-18 13:07   ` [dpdk-dev] [PATCH v2 1/2] vfio: open VFIO container at startup rather than during init Anatoly Burakov
2014-06-18 13:07   ` [dpdk-dev] [PATCH v2 2/2] vfio: more verbose error messages Anatoly Burakov
2014-06-18 13:44   ` [dpdk-dev] [PATCH v2 0/2] Fix issues with VFIO Neil Horman
2014-06-18 15:07   ` [dpdk-dev] [PATCH v3 " Anatoly Burakov
2014-06-18 15:07     ` [dpdk-dev] [PATCH v3 1/2] vfio: open VFIO container at startup rather than during init Anatoly Burakov
2014-06-18 15:07     ` [dpdk-dev] [PATCH v3 2/2] vfio: more verbose error messages Anatoly Burakov
2014-06-18 17:55     ` [dpdk-dev] [PATCH v3 0/2] Fix issues with VFIO Richardson, Bruce
2014-06-18 23:09       ` Thomas Monjalon
2014-06-18 18:51     ` Neil Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).