DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Montorsi, Francesco" <fmontorsi@empirix.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] rte_eal_init() alternative?
Date: Thu, 8 Oct 2015 14:58:55 +0000	[thread overview]
Message-ID: <c529a882e7f74cbdb9c58802d04e08b1@bilemail1.empirix.com> (raw)
In-Reply-To: <3003120.8bdQ5bCz5C@xps13>

Hi,

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: mercoledì 2 settembre 2015 15:10
> To: Montorsi, Francesco <fmontorsi@empirix.com>
> Cc: dev@dpdk.org; Bruce Richardson <bruce.richardson@intel.com>
> Subject: Re: [dpdk-dev] rte_eal_init() alternative?
> 
> 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.

To maintain compatibility with existing applications I think that perhaps the best would be to have a core initialization function rte_eal_init_raw() that never calls rte_panic() and returns an error code. Then we can maintain compatibility having an rte_eal_init() function that does call rte_panic() if rte_eal_init_raw() fails.

Something like the attached patch. 

Note that the attached patch exposes also a way to skip the argv/argc configuration process by directly providing a populated configuration structure...

Let me know what you think about it (the patch is just a draft and needs more work).

Thanks,
Francesco



	

  parent reply	other threads:[~2015-10-08 14:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02 12:49 Montorsi, Francesco
2015-09-02 12:56 ` Bruce Richardson
2015-09-02 13:10   ` Thomas Monjalon
2015-09-02 18:17     ` Don Provan
2015-09-02 19:00       ` Stephen Hemminger
2015-09-02 20:50         ` Marc Sune
2015-09-02 21:08         ` Thomas Monjalon
2015-09-02 22:01           ` Wiles, Keith
2015-09-08 18:01             ` Don Provan
2015-09-11 17:15               ` Wiles, Keith
2015-10-08 14:58     ` Montorsi, Francesco [this message]
2015-10-09  8:25       ` Panu Matilainen
2015-10-09 10:03         ` Montorsi, Francesco
2015-10-09 10:13           ` Montorsi, Francesco
2015-10-09 11:12             ` Panu Matilainen
2015-10-09 10:40           ` Panu Matilainen
2015-10-09 16:03             ` Thomas F Herbert
2015-09-02 14:08   ` Jay Rolette
2015-09-02 19:23     ` Zoltan Kiss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c529a882e7f74cbdb9c58802d04e08b1@bilemail1.empirix.com \
    --to=fmontorsi@empirix.com \
    --cc=dev@dpdk.org \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).