[dpdk-dev] [PATCH] eal: parse args before any kinds of init

Thomas Monjalon thomas.monjalon at 6wind.com
Wed May 7 15:06:08 CEST 2014


2014-05-05 17:50, Thomas Monjalon:
> 2014-04-15 11:03, Wang Sheng-Hui:
> > Parse args first, to resolve any invalid args and give out the usage
> > string. E.g './helloworld --invalid', the '--invalid' will be checked
> > before any init. After the options are checked, take any init actions.
> > 
> > Signed-off-by: Wang Sheng-Hui <shhuiw at gmail.com>
> 
> [...]
> > @@ -964,16 +969,16 @@ rte_eal_init(int argc, char **argv)
> > 
> >         thread_id = pthread_self();
> > 
> > +       fctret = eal_parse_args(argc, argv);
> > +       if (fctret < 0)
> > +               exit(1);
> > +
> > 
> >         if (rte_eal_log_early_init() < 0)
> >         
> >                 rte_panic("Cannot init early logs\n");
> >         
> >         if (rte_eal_cpu_init() < 0)
> >         
> >                 rte_panic("Cannot detect lcores\n");
> > 
> > -       fctret = eal_parse_args(argc, argv);
> > -       if (fctret < 0)
> > -               exit(1);
> > -
> 
> You should move eal_parse_args() just after rte_eal_log_early_init() in
> order to have logs available.

When double checking, I saw this commit which justify why rte_eal_cpu_init() 
is before eal_parse_args():
	http://dpdk.org/browse/dpdk/commit/?id=f563a3727b5dba

If the goal is to move debug lines in cpu_init, you should split 
rte_eal_log_early_init() in 2 functions: 1 to detect cores and 1 for debug 
summary.
By the way, these are debug logs which should be disabled by default.

-- 
Thomas


More information about the dev mailing list