From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Wang Sheng-Hui <shhuiw@gmail.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] eal: parse args before any kinds of init
Date: Mon, 05 May 2014 17:50:15 +0200 [thread overview]
Message-ID: <2073730.rjlHe4Kf7A@xps13> (raw)
In-Reply-To: <534CA193.2000604@gmail.com>
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@gmail.com>
[...]
> @@ -637,6 +637,11 @@ eal_parse_args(int argc, char **argv)
> };
> struct shared_driver *solib;
>
> + /* check the no args case */
> + if (argc == 1) {
> + eal_usage(prgname);
> + return (-1);
> + }
> argvopt = argv;
I wonder if there are some use cases where default values could be used for
first tests.
If we can set some default values for coremask and memory channels, then we
can accept having no argument.
Maybe that an option -h would be needed.
> @@ -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);
> -
> if (internal_config.no_hugetlbfs == 0 &&
> internal_config.process_type != RTE_PROC_SECONDARY
> && internal_config.xen_dom0_support == 0 &&
You should move eal_parse_args() just after rte_eal_log_early_init() in order
to have logs available.
Could you send a v2 patch with this kind of change for BSD also.
Thank you
--
Thomas
next prev parent reply other threads:[~2014-05-05 15:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-15 3:03 Wang Sheng-Hui
2014-04-17 21:58 ` Thomas Monjalon
2014-04-18 0:30 ` Wang Sheng-Hui
2014-05-05 15:50 ` Thomas Monjalon [this message]
2014-05-07 13:06 ` Thomas Monjalon
-- strict thread matches above, loose matches on Subject: below --
2014-04-15 3:00 Wang Sheng-Hui
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=2073730.rjlHe4Kf7A@xps13 \
--to=thomas.monjalon@6wind.com \
--cc=dev@dpdk.org \
--cc=shhuiw@gmail.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).