From: "Gaëtan Rivet" <gaetan.rivet@6wind.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: dev@dpdk.org, Dirk-Holger Lenz <dirk.lenz@ng4t.com>
Subject: Re: [dpdk-dev] [PATCH v2] eal: read and parse device option separately
Date: Wed, 2 Aug 2017 17:23:17 +0200 [thread overview]
Message-ID: <20170802152317.GC8124@bidouze.vm.6wind.com> (raw)
In-Reply-To: <3126300.2FJSgUKTSm@xps>
On Wed, Aug 02, 2017 at 04:29:13PM +0200, Thomas Monjalon wrote:
> Hi Gaetan
>
> 02/08/2017 10:56, Gaetan Rivet:
> > When the EAL parses the common options given to the application,
> > not all subsystems are available. Some device drivers are registered
> > afterward upon dynamic plugin loading.
> >
> > Devices using those drivers are thus unable to be parsed by any drivers
> > and are rejected.
> >
> > Store the device options first and keep them for later processing.
> > Parse these right before initializing the buses, the drivers must have
> > been stabilized at this point.
> >
> > Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> > ---
> >
> > v2:
> >
> > - Fix the -w / -b incompatibility check.
> > It was checking that no two incompatible rte_devargs were inserted.
> > As rte_devargs are now generated right before buses scan, this check
> > was always correct, even when it should have failed.
>
> You are doing this check in eal_check_common_options().
> I think you can do the check earlier in eal_parse_common_option()
> with 2 static variables, instead of implementing the
> new function eal_option_device_type_count().
>
Okay, will simplify.
> > +static unsigned int
> > +eal_option_device_type_count(enum rte_devtype type)
> [...]
> > @@ -944,14 +1013,14 @@ eal_parse_common_option(int opt, const char *optarg,
> > switch (opt) {
> > /* blacklist */
> > case 'b':
> > - if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI,
> > + if (eal_option_device_add(RTE_DEVTYPE_BLACKLISTED_PCI,
> > optarg) < 0) {
> > return -1;
> > }
> > break;
> > /* whitelist */
> > case 'w':
> > - if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI,
> > + if (eal_option_device_add(RTE_DEVTYPE_WHITELISTED_PCI,
> > optarg) < 0) {
> > return -1;
> > }
> > @@ -1061,7 +1130,7 @@ eal_parse_common_option(int opt, const char *optarg,
> > break;
> >
> > case OPT_VDEV_NUM:
> > - if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL,
> > + if (eal_option_device_add(RTE_DEVTYPE_VIRTUAL,
> > optarg) < 0) {
> > return -1;
> > }
> > @@ -1187,8 +1256,8 @@ eal_check_common_options(struct internal_config *internal_cfg)
> > return -1;
> > }
> >
> > - if (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED_PCI) != 0 &&
> > - rte_eal_devargs_type_count(RTE_DEVTYPE_BLACKLISTED_PCI) != 0) {
> > + if (eal_option_device_type_count(RTE_DEVTYPE_WHITELISTED_PCI) != 0 &&
> > + eal_option_device_type_count(RTE_DEVTYPE_BLACKLISTED_PCI) != 0) {
> > RTE_LOG(ERR, EAL, "Options blacklist (-b) and whitelist (-w) "
> > "cannot be used at the same time\n");
> > return -1;
>
> [...]
> > +static int
> > +eal_option_device_add(enum rte_devtype type, const char *optarg)
> > +{
> > + struct device_option *deo;
> > + size_t optlen;
>
> Just a last comment about variable name:
> Instead of deo, opt or option would be more meaningful.
>
Will do.
> Thanks for the important fix!
--
Gaëtan Rivet
6WIND
next prev parent reply other threads:[~2017-08-02 15:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-01 18:13 [dpdk-dev] [PATCH] " Gaetan Rivet
2017-08-02 8:56 ` [dpdk-dev] [PATCH v2] " Gaetan Rivet
2017-08-02 14:29 ` Thomas Monjalon
2017-08-02 15:23 ` Gaëtan Rivet [this message]
2017-08-02 17:10 ` [dpdk-dev] [PATCH v3] " Gaetan Rivet
2017-08-03 17:57 ` Thomas Monjalon
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=20170802152317.GC8124@bidouze.vm.6wind.com \
--to=gaetan.rivet@6wind.com \
--cc=dev@dpdk.org \
--cc=dirk.lenz@ng4t.com \
--cc=thomas@monjalon.net \
/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).