From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by dpdk.org (Postfix) with ESMTP id 7C8A593D8 for ; Wed, 21 Oct 2015 12:15:05 +0200 (CEST) Received: by obbda8 with SMTP id da8so36588185obb.1 for ; Wed, 21 Oct 2015 03:15:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=9+aJkX51sSom6PB6dSB87/CLdcHIg6ldxy0bM2WND5A=; b=aQGTKI2iG9m+iPnPwuEvOZ6/x6FrRAl6TuGSY6mcsoNFTjtVxSw5LOH30yehgrF9Yt At5aNcyOwXHt425IZnU79vXrT4K/gNqIi7N/wj/mPDozx0QJv1YqZ5ZFveFVtZwJHMfE o4M2Vf3SnSUApe/JnBrmi85tTFz5DZd4gXpp7HnXIE68JtAqazr4/HMTKnTq8jzmoMH1 +yDswhQ9lEEZNRMqpcxbf4jsgbN2q9VMVNxK1jKNnP9fwK7PnN3ui8K3uNs4Mn29Fdns /vLb/HW69kw7MrI+h1e4SByWB8bQbYwilNM3806Qk0/UzacgZBdFBTfNURxaNnh+azdB 379w== X-Gm-Message-State: ALoCoQks78C/EuIgzgxGKoIvJwZwsa37wUYHOB3rdf8FJ8+acyVzTzPbxVlf3yC8qkhMftoQGeuS MIME-Version: 1.0 X-Received: by 10.182.227.195 with SMTP id sc3mr5389765obc.48.1445422504887; Wed, 21 Oct 2015 03:15:04 -0700 (PDT) Received: by 10.76.131.166 with HTTP; Wed, 21 Oct 2015 03:15:04 -0700 (PDT) In-Reply-To: References: Date: Wed, 21 Oct 2015 12:15:04 +0200 Message-ID: From: David Marchand To: Panu Matilainen Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 1/2] eal: move plugin loading to eal/common 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: Wed, 21 Oct 2015 10:15:05 -0000 On Wed, Oct 21, 2015 at 10:29 AM, Panu Matilainen wrote: > There's no good reason to limit plugins to Linux, make it available > on FreeBSD too. Refactor the plugin code from Linux EAL to common > helper functions, also check for potential errors during initialization. > Not sure about this "potential errors". > > Signed-off-by: Panu Matilainen > --- > lib/librte_eal/bsdapp/eal/eal.c | 3 ++ > lib/librte_eal/common/eal_common_options.c | 53 > ++++++++++++++++++++++++++++++ > lib/librte_eal/common/eal_options.h | 1 + > lib/librte_eal/linuxapp/eal/eal.c | 39 ++-------------------- > 4 files changed, 59 insertions(+), 37 deletions(-) > > diff --git a/lib/librte_eal/bsdapp/eal/eal.c > b/lib/librte_eal/bsdapp/eal/eal.c > index 1b6f705..f07a3c3 100644 > --- a/lib/librte_eal/bsdapp/eal/eal.c > +++ b/lib/librte_eal/bsdapp/eal/eal.c > @@ -543,6 +543,9 @@ rte_eal_init(int argc, char **argv) > > rte_eal_mcfg_complete(); > > + if (eal_plugins_init() < 0) > + rte_panic("Cannot init plugins\n"); > + > Why testing for error when this cannot happen (see below) ? > eal_thread_init_master(rte_config.master_lcore); > > ret = eal_thread_dump_affinity(cpuset, RTE_CPU_AFFINITY_STR_LEN); > diff --git a/lib/librte_eal/common/eal_common_options.c > b/lib/librte_eal/common/eal_common_options.c > index 1f459ac..b542868 100644 > --- a/lib/librte_eal/common/eal_common_options.c > +++ b/lib/librte_eal/common/eal_common_options.c > [snip] + > +int > +eal_plugins_init(void) > +{ > + struct shared_driver *solib = NULL; > + > + TAILQ_FOREACH(solib, &solib_list, next) { > + RTE_LOG(DEBUG, EAL, "open shared lib %s\n", solib->name); > + solib->lib_handle = dlopen(solib->name, RTLD_NOW); > + if (solib->lib_handle == NULL) > + RTE_LOG(WARNING, EAL, "%s\n", dlerror()); > + } > + return 0; > +} I can't see a non 0 return here. Btw, returning an error here would change current behavior of dpdk loading drivers. Not sure we want this as people may rely on this loading not failing. -- David Marchand