From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 6235C1BA60 for ; Thu, 26 Oct 2017 00:39:21 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id u138so4535677wmu.5 for ; Wed, 25 Oct 2017 15:39:21 -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=AXSSkpv6fJP/zN8juJjMjAl25LrMcysyyF6u2YJ9rLxoz/ybuz7bHekpzEeG2SpvV7 LfcAkpF5dL7VXewJQtIPuvKbc9/69+bA6jIprqj0s64YCmWyxpsfUsz7519Zvx7UcCjr 3DsnzWNtasOsldphNqwd39asq50mWLN6lT8TksTuOYcXQ6pdpCw1R/Y/Ajqq974iV8S4 FPHrL5SA+4pooSDY7Cf+zBv2CGIAco38G3lCkS67cCxnzUEi/uRIlbrz71VHDvera86r PXD13LGFCWS/90uuKzl/CkZUiwyQ7wmch9UG9OWQ+Y/QcaWR47q5K8WnFj0uFtOCQG/u T1fw== 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=ZMezE857D/72kVGhmIbYZDNtadpNvJAhd6Xnuv5xgzHPDDoMqHsPwtAZCEOFy3fjji /IbCk0pSo4zdhHWPpLa3Yvfa5FNJj/rDpJ+wiug+TWbgR77qk78ocYvX7fFWVW13OVXe qr69qhjJwAb2JjqugTACj6HBzVvRD03/u99AM42xjf80VaPRYxJVtioldei+5Jjpxm68 vpp7R6D3WFoSVHsJE7bN9eg+VO9K20Jmuk7EKJ3TzxeBSM8CO0oPDlOm2sZlxvWM+z1Q 8UJ2kg7Mxn5AuBXoS4xOWTgrbSzTmJC1IqC988bbSNbVPeMxomOo9dUQC/0LDm/DwGkH Rmzw== X-Gm-Message-State: AMCzsaXay0SLuVuKYUZTX9uqs5zcvKbmzsgExQGyM88i8QgPgEsNHuNn Fcwt+atGo7Z4/y6tZxuE/zcQf+fM X-Google-Smtp-Source: ABhQp+QTK7qHgnDtJ/yx6/zD/Sf+D9H7kIvLjkVCX9c0g633eZvUbBSPjwOHXwI/1lmiEse1i6lnWw== X-Received: by 10.28.12.75 with SMTP id 72mr2970814wmm.133.1508971160759; Wed, 25 Oct 2017 15:39:20 -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 r63sm4466124wmg.13.2017.10.25.15.39.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Oct 2017 15:39:19 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 26 Oct 2017 00:38:31 +0200 Message-Id: <7b5fbd6d2ff2d80347bf68b95fa78980c5aeb967.1508970254.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v7 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: Wed, 25 Oct 2017 22:39:21 -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