summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJan Viktorin <viktorin@rehivetech.com>2016-07-04 17:16:51 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-07-11 13:37:12 +0200
commit50f9de2b48404de23d3349da6ca2bd45bd38ba4a (patch)
tree566cf91270059ff66096d83af9d8582d50464c9a /lib
parenta7f7adec8db2477171b03d38d1a395cb65e830b7 (diff)
downloaddpdk-50f9de2b48404de23d3349da6ca2bd45bd38ba4a.zip
dpdk-50f9de2b48404de23d3349da6ca2bd45bd38ba4a.tar.gz
dpdk-50f9de2b48404de23d3349da6ca2bd45bd38ba4a.tar.xz
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 <viktorin@rehivetech.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/librte_eal/linuxapp/eal/eal.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index 606b777..3fb2188 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