From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com
 [209.85.212.177]) by dpdk.org (Postfix) with ESMTP id 3D7F8688E
 for <dev@dpdk.org>; Wed,  2 Sep 2015 15:11:36 +0200 (CEST)
Received: by wicfx3 with SMTP id fx3so18653776wic.0
 for <dev@dpdk.org>; Wed, 02 Sep 2015 06:11:36 -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:organization
 :user-agent:in-reply-to:references:mime-version
 :content-transfer-encoding:content-type;
 bh=2qvh3DEaQQbnswS5iIRwHdGwX3cWCj1RIkOceaJHmd0=;
 b=Ba50UH/58/a4+eBSfFhXNxbbS4O4hPbLVed5AhBPgjg6x5hjTpUQ58iVsZqUeYFBNU
 xrl3zmcB9nkhJgQQiNvCyrCUkNBDDvAayybzTKYLYqKu7+WqfBqM8COKRZiP3WVtFdIo
 +u1Uuq+4lxTg7NYRjMlMJIqU6uYUQ96zICHaiU2nBShdq4ajY7hKEAYw2q/MFEYc02Jq
 r5yzEo4KbD2PLH7coaBlbEk3mUKe8ZaR2X39LOJKoalj0lPwNuUzEniH2aElFhTHHFAQ
 aZpJcst/uMcKX1ikq336EM3UHmvdXn41eF7sD0adElBYqmbchcHnZ3eGeF+UtwtUdN1N
 GeHA==
X-Gm-Message-State: ALoCoQmR49eV4nCrphvS2EZ67vYQUy9fjEa2PNf9XgH9b+sIOuLO1mipXDxBkq9PvBVXlUNkrz92
X-Received: by 10.180.231.40 with SMTP id td8mr4117377wic.9.1441199495941;
 Wed, 02 Sep 2015 06:11:35 -0700 (PDT)
Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136])
 by smtp.gmail.com with ESMTPSA id ne7sm3568998wic.12.2015.09.02.06.11.34
 (version=TLSv1/SSLv3 cipher=OTHER);
 Wed, 02 Sep 2015 06:11:35 -0700 (PDT)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: "Montorsi, Francesco" <fmontorsi@empirix.com>
Date: Wed, 02 Sep 2015 15:10:25 +0200
Message-ID: <3003120.8bdQ5bCz5C@xps13>
Organization: 6WIND
User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; )
In-Reply-To: <20150902125650.GA10364@bricha3-MOBL3>
References: <44e664970fef4bff942eaee5c7eaca67@bilemail1.empirix.com>
 <20150902125650.GA10364@bricha3-MOBL3>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] rte_eal_init() alternative?
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 02 Sep 2015 13:11:36 -0000

2015-09-02 13:56, Bruce Richardson:
> On Wed, Sep 02, 2015 at 12:49:40PM +0000, Montorsi, Francesco wrote:
> > Hi all,
> > 
> > Currently it seems that the only way to initialize EAL is using rte_eal_init() function, correct?
> > 
> > I have the problem that rte_eal_init() will call rte_panic() whenever something fails to initialize or in other cases it will call exit().
> > In my application, I would rather like to attempt DPDK initialization. If it fails I don't want to exit.
> > Unfortunately I cannot even copy&paste the rte_eal_init() code into my application (removing rte_panic and exit calls) since it uses a lot of DPDK internal private functions.
> > 
> > I think that my requirements (avoid abort/exit calls when init fails) is a basic requirement... would you accept a patch that adds an alternative rte_eal_init() function that just returns an error code upon failure, instead of immediately exiting?
> > 
> > Thanks for your hard work!
> > 
> > Francesco Montorsi
> > 
> I, for one, would welcome such a patch. I think the code is overly quick in
> many places to panic or exit the app, when an error code would be more appropriate.
> Feel free to also look at other libraries in DPDK too, if you like :-)

Yes but please, do not create an alternative init function.
We just need to replace panic/exit with error codes and be sure that apps
and examples handle them correctly.
Thanks