From patchwork Tue Jul 7 08:48:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tal Shnaiderman X-Patchwork-Id: 73375 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 738ABA00BE; Tue, 7 Jul 2020 10:49:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AC4461DB3E; Tue, 7 Jul 2020 10:48:54 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 1296C1D964 for ; Tue, 7 Jul 2020 10:48:51 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from talshn@mellanox.com) with SMTP; 7 Jul 2020 11:48:46 +0300 Received: from l-wincomp04-vm.labs.mlnx (l-wincomp04-vm.mtl.labs.mlnx [10.237.1.5]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0678mkwM021055; Tue, 7 Jul 2020 11:48:46 +0300 From: talshn@mellanox.com To: dev@dpdk.org Cc: thomas@monjalon.net, pallavi.kadam@intel.com, dmitry.kozliuk@gmail.com, david.marchand@redhat.com, grive@u256.net, ranjit.menon@intel.com, navasile@linux.microsoft.com, harini.ramakrishnan@microsoft.com, ocardona@microsoft.com, anatoly.burakov@intel.com, Tal Shnaiderman Date: Tue, 7 Jul 2020 11:48:22 +0300 Message-Id: <20200707084823.28160-2-talshn@mellanox.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20200707084823.28160-1-talshn@mellanox.com> References: <20200624145621.26604-2-talshn@mellanox.com> <20200707084823.28160-1-talshn@mellanox.com> Subject: [dpdk-dev] [PATCH v2 1/2] eal/windows: add needed calls to detect vdev PMD 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Tal Shnaiderman Add needed function calls in rte_eal_init to detect vdev PMD. eal_option_device_parse() rte_service_init() rte_bus_probe() Signed-off-by: Tal Shnaiderman Tested-by: Narcisa Vasile Acked-by: Narcisa Vasile --- lib/librte_eal/common/meson.build | 1 + lib/librte_eal/windows/eal.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/lib/librte_eal/common/meson.build b/lib/librte_eal/common/meson.build index c1d9f21488..9f32262450 100644 --- a/lib/librte_eal/common/meson.build +++ b/lib/librte_eal/common/meson.build @@ -31,6 +31,7 @@ if is_windows 'malloc_heap.c', 'rte_malloc.c', 'eal_common_timer.c', + 'rte_service.c', ) subdir_done() endif diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c index eb10b4ef96..cbbf67e253 100644 --- a/lib/librte_eal/windows/eal.c +++ b/lib/librte_eal/windows/eal.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -273,6 +274,11 @@ rte_eal_init(int argc, char **argv) if (fctret < 0) exit(1); + if (eal_option_device_parse()) { + rte_errno = ENODEV; + return -1; + } + /* Prevent creation of shared memory files. */ if (internal_conf->in_memory == 0) { RTE_LOG(WARNING, EAL, "Multi-process support is requested, " @@ -362,6 +368,20 @@ rte_eal_init(int argc, char **argv) rte_panic("Cannot create thread\n"); } + /* initialize services so vdevs register service during bus_probe. */ + if (rte_service_init()) { + rte_eal_init_alert("rte_service_init() failed"); + rte_errno = ENOEXEC; + return -1; + } + + /* Probe all the buses and devices/drivers on them */ + if (rte_bus_probe()) { + rte_eal_init_alert("Cannot probe devices"); + rte_errno = ENOTSUP; + return -1; + } + /* * Launch a dummy function on all slave lcores, so that master lcore * knows they are all ready when this function returns.