All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vfio: open VFIO container at startup rather than during init
@ 2014-06-17  9:12 Anatoly Burakov
       [not found] ` <4bf447650cc99e316e6427e3a1c134dd417af4ec.1402996488.git.anatoly.burakov-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
       [not found] ` <cover.1403096022.git.anatoly.burakov-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 2 replies; 19+ messages in thread
From: Anatoly Burakov @ 2014-06-17  9:12 UTC (permalink / raw)
  To: dev-VfR2kkLFssw


Signed-off-by: Anatoly Burakov <anatoly.burakov-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 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 related	[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 [PATCH] vfio: open VFIO container at startup rather than during init Anatoly Burakov
     [not found] ` <4bf447650cc99e316e6427e3a1c134dd417af4ec.1402996488.git.anatoly.burakov-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-06-17 16:50   ` Richardson, Bruce
2014-06-17 16:55   ` Thomas Monjalon
2014-06-18  8:57     ` Burakov, Anatoly
     [not found]       ` <C6ECDF3AB251BE4894318F4E451236976CC9CB58-kPTMFJFq+rF9qrmMLTLiibfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-18 10:08         ` Dumitrescu, Cristian
     [not found]           ` <3EB4FA525960D640B5BDFFD6A3D891261B1C6009-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-18 10:26             ` Burakov, Anatoly
     [not found]               ` <C6ECDF3AB251BE4894318F4E451236976CC9CCAC-kPTMFJFq+rF9qrmMLTLiibfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-18 11:00                 ` Neil Horman
     [not found]                   ` <20140618110018.GA7587-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2014-06-18 11:02                     ` Burakov, Anatoly
     [not found]                       ` <C6ECDF3AB251BE4894318F4E451236976CC9CCF3-kPTMFJFq+rF9qrmMLTLiibfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-18 11:07                         ` Neil Horman
2014-06-18 13:07   ` [PATCH v2 0/2] Fix issues with VFIO Anatoly Burakov
     [not found]     ` <cover.1403104031.git.anatoly.burakov-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-06-18 17:55       ` [PATCH v3 " Richardson, Bruce
     [not found]         ` <59AF69C657FD0841A61C55336867B5B01AA37B5B-kPTMFJFq+rELt2AQoY/u9bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-18 23:09           ` Thomas Monjalon
2014-06-18 18:51       ` Neil Horman
2014-06-18 13:07   ` [PATCH v2 1/2] vfio: open VFIO container at startup rather than during init Anatoly Burakov
2014-06-18 13:07   ` [PATCH v2 2/2] vfio: more verbose error messages Anatoly Burakov
     [not found] ` <cover.1403096022.git.anatoly.burakov-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-06-18 13:44   ` [PATCH v2 0/2] Fix issues with VFIO Neil Horman
2014-06-18 15:07   ` [PATCH v3 " Anatoly Burakov
2014-06-18 15:07   ` [PATCH v3 1/2] vfio: open VFIO container at startup rather than during init Anatoly Burakov
2014-06-18 15:07   ` [PATCH v3 2/2] vfio: more verbose error messages Anatoly Burakov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.