From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wes1-so1.wedos.net (wes1-so1.wedos.net [46.28.106.15]) by dpdk.org (Postfix) with ESMTP id C35113978 for ; Mon, 4 Jul 2016 17:16:55 +0200 (CEST) Received: from pcviktorin.fit.vutbr.cz (pcviktorin.fit.vutbr.cz [147.229.13.147]) by wes1-so1.wedos.net (Postfix) with ESMTPSA id 3rjrGH4KDrzBpj; Mon, 4 Jul 2016 17:16:55 +0200 (CEST) From: Jan Viktorin To: dev@dpdk.org Cc: Jan Viktorin , Anatoly Burakov , David Marchand , Keith Wiles , Santosh Shukla , Stephen Hemminger , Shreyansh Jain Date: Mon, 4 Jul 2016 17:16:51 +0200 Message-Id: <1467645411-15494-17-git-send-email-viktorin@rehivetech.com> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1467645411-15494-1-git-send-email-viktorin@rehivetech.com> References: <1467645411-15494-1-git-send-email-viktorin@rehivetech.com> Subject: [dpdk-dev] [PATCH v3 16/16] vfio: change VFIO init to be extendable 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, 04 Jul 2016 15:16:56 -0000 We can now just OR the vfio_enabled sequentially and so adding new VFIO subsystems (vfio_platform) is possible. Signed-off-by: Jan Viktorin --- lib/librte_eal/linuxapp/eal/eal.c | 10 ++++++---- 1 file 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 -- 2.8.0