From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by dpdk.org (Postfix) with ESMTP id 7CDF568CE for ; Fri, 11 Apr 2014 09:35:25 +0200 (CEST) Received: by mail-wi0-f182.google.com with SMTP id d1so531013wiv.15 for ; Fri, 11 Apr 2014 00:37:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ac4YhHO9iXBCi/Xp818p9pKdqlUrPEt4frQ2SoiiEdI=; b=Pzn0MuoKhmiSWqvZHyRQy4ZjpiPMPzfmG+GeG//Tn31yRXQXA1X5x7MCfmenIvk574 nvilo6nqDzD9AHi3CgT4MRASy/F0EmYAByYRXm60ql4VZPIRqGu7hO4DSaSFwZfWXtny iJ3XxPY5Geru5rF4LtFRjf30JUXT8LAqwb1eRH0f5ReDR+L0snFPE6Uh24QUCf/0kmZo i2Y7JlDDBBN6Wq/DpejJMcEJCHzgTrS5rNSF78usBfSd5E1C4LXTQBKK5myrVLJaS3iZ lU8pwg9GA3eJE/2MnzmOO3C3wB1lNnXThsOHz7TaWE+EWfN+J1VL+8A758ssugs2MGwr yQMA== X-Gm-Message-State: ALoCoQl46f5YXqjLkGzF5sqkwkxcJ64HnjxAs35eClIMArvMYpDMOmwuARsEKbvsolrNWvk00Hjt X-Received: by 10.180.98.1 with SMTP id ee1mr2042438wib.10.1397201822860; Fri, 11 Apr 2014 00:37:02 -0700 (PDT) Received: from glumotte.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id dd5sm2803669wib.12.2014.04.11.00.37.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Apr 2014 00:37:02 -0700 (PDT) From: Olivier Matz To: dev@dpdk.org Date: Fri, 11 Apr 2014 09:36:53 +0200 Message-Id: <1397201813-26627-2-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1397201813-26627-1-git-send-email-olivier.matz@6wind.com> References: <1460632.jOzC6OEr8u@xps13> <1397201813-26627-1-git-send-email-olivier.matz@6wind.com> Subject: [dpdk-dev] [PATCH v2 07/11 2/2] vdev: allow external registration of virtual device drivers 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: Fri, 11 Apr 2014 07:35:26 -0000 The registration of an external vdev driver (a .so library) is done in a function that has the ((constructor)) attribute. This function is called when dlopen(driver.so) is invoked. As a result, we need to do the dlopen() before calling rte_eal_vdev_init() that calls the initialization functions of all registered drivers. Signed-off-by: Olivier Matz --- lib/librte_eal/linuxapp/eal/eal.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index c015a65..3ded563 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -1046,10 +1046,8 @@ rte_eal_init(int argc, char **argv) rte_eal_mcfg_complete(); - if (rte_eal_vdev_init() < 0) - rte_panic("Cannot init virtual devices\n"); - TAILQ_FOREACH(solib, &solib_list, next) { + RTE_LOG(INFO, EAL, "open shared lib %s\n", solib->name); solib->lib_handle = dlopen(solib->name, RTLD_NOW); if ((solib->lib_handle == NULL) && (solib->name[0] != '/')) { /* relative path: try again with "./" prefix */ @@ -1061,6 +1059,9 @@ rte_eal_init(int argc, char **argv) RTE_LOG(WARNING, EAL, "%s\n", dlerror()); } + if (rte_eal_vdev_init() < 0) + rte_panic("Cannot init virtual devices\n"); + RTE_LOG(DEBUG, EAL, "Master core %u is ready (tid=%x)\n", rte_config.master_lcore, (int)thread_id); -- 1.8.5.3