From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 586681B78E for ; Thu, 26 Oct 2017 12:06:39 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id 196so18770318wma.1 for ; Thu, 26 Oct 2017 03:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=bbRTQ9nUVP5fpARsWLstZgNk+gSEYH7A26zl3DCAQKs=; b=hGqCkdWNe/Mj8fBcw38TP+kSuwBlcUehxCS1+CIroWDbxdZbS8U9UatjCX9lMyNxEq UAo+xzleS/v4EwjiPE2i3D8a2dCpuUIcgRhdc0wrPBELR70KSDnEDACRWBxZ5kWWg41G h9bVibzgFb38Juwelx2X3MraKwweABv/rF8i8Lqfy7xWD7+C7/Zm1NLmvr0skh3qO/WL 0uP+QU9WiIa7LbpAy6AMt4h4RbUDLydQvQ0oWNvodpGdI7KdeH5AQUaMIC0aHeYr1huk WoSXUMhzzWbV0VLR9hAncloHBjv9dhPteM8vNsbgdqBkrVUOwkMPNEblvPp6dEDw0xmi kGqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=bbRTQ9nUVP5fpARsWLstZgNk+gSEYH7A26zl3DCAQKs=; b=hy6kngqgZEabcK7pWaePXotKsqaXzKcUaAIjELyFEKaj247eHv7Ulpe4FfbK9qvsvL CWzsUaTvUwJ3ik9+UUBWGw2ddCqdOk9oTM/iSnc+aDgK5FMdpk99JdCFhrLRDchW0I6Q f7wNqmMwTPQeR/dgbIBiFWdqJb1r+dOJr7excNFxX/oVr4mtW9zYt7NXmZ61K0xd3wF5 8c+v184JSdqmcuHjmNsdXUsFKUBx0iPjZIpXjEDmmdWvOu6n/GSrM7S5x0PJjkGT8HT5 et3kGJsijzkEauP1MWiEM/PdGIu0FXCt3B0Ty450bt44h8PM/5qOzLTtndgg+5as6OA4 /GeA== X-Gm-Message-State: AMCzsaVxcNfUn0P34bJcn1ToNqnYyqBlyL23qim0kxf3Tv5WDwaA0Zy3 1XpoWsW2NyOrwHHavXimjbZnqsd4 X-Google-Smtp-Source: ABhQp+Qc6eIIXSfQi+Er1d4sJkA51O9TiV4rNJyIbfJpPZVfkVhmcTWgQCsUpCHn01Qbp/SPLA+CpA== X-Received: by 10.80.240.208 with SMTP id a16mr26946082edm.288.1509012398383; Thu, 26 Oct 2017 03:06:38 -0700 (PDT) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id u12sm3339619edk.45.2017.10.26.03.06.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Oct 2017 03:06:37 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 26 Oct 2017 12:05:54 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v8 09/25] vfio: check PCI dependency from within PCI code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Oct 2017 10:06:39 -0000 PCI sometimes requires vfio to be enabled. Move the check from EAL init to PCI bus scan. Signed-off-by: Gaetan Rivet --- lib/librte_eal/linuxapp/eal/eal.c | 5 ----- lib/librte_eal/linuxapp/eal/eal_pci.c | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index bee3bbe..91c3712 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -715,11 +715,6 @@ static int rte_eal_vfio_setup(void) return -1; vfio_enabled = vfio_is_enabled("vfio"); - if (!internal_config.no_pci) { - if (!pci_vfio_is_enabled()) - RTE_LOG(DEBUG, EAL, "VFIO PCI modules not loaded\n"); - } - if (vfio_enabled) { /* if we are primary process, create a thread to communicate with diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index 8682ee6..dc65852 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -460,6 +460,11 @@ rte_pci_scan(void) if (internal_config.no_pci) return 0; +#ifdef VFIO_PRESENT + if (!pci_vfio_is_enabled()) + RTE_LOG(DEBUG, EAL, "VFIO PCI modules not loaded\n"); +#endif + dir = opendir(pci_get_sysfs_path()); if (dir == NULL) { RTE_LOG(ERR, EAL, "%s(): opendir failed: %s\n", -- 2.1.4