From: Jan Viktorin Date: Mon, 4 Jul 2016 15:16:51 +0000 (+0200) Subject: vfio: rework initialization to be extendable X-Git-Tag: spdx-start~6207 X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=50f9de2b48404de23d3349da6ca2bd45bd38ba4a vfio: rework initialization to be extendable We can now just OR the vfio_enabled sequentially and so adding new VFIO subsystems (vfio_platform) is possible. Signed-off-by: Jan Viktorin --- diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 606b7775ac..3fb2188ff6 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -705,12 +705,14 @@ rte_eal_iopl_init(void) #ifdef VFIO_PRESENT static int rte_eal_vfio_setup(void) { - if (internal_config.no_pci) - return 0; + int vfio_enabled = 0; - pci_vfio_enable(); + if (!internal_config.no_pci) { + pci_vfio_enable(); + vfio_enabled |= pci_vfio_is_enabled(); + } - if (pci_vfio_is_enabled()) { + if (vfio_enabled) { /* if we are primary process, create a thread to communicate with * secondary processes. the thread will use a socket to wait for