All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shreyansh Jain <shreyansh.jain@nxp.com>
To: Gaetan Rivet <gaetan.rivet@6wind.com>
Cc: <dev@dpdk.org>
Subject: Re: [PATCH v1 4/8] bus: add probe mode setter
Date: Mon, 11 Dec 2017 18:09:50 +0530	[thread overview]
Message-ID: <3f96d5f0-30d0-3e71-98f6-283d8bd05238@nxp.com> (raw)
In-Reply-To: <b197aae84700de4e2c7a1ab9e42066544c769aa7.1507796085.git.gaetan.rivet@6wind.com>

On Thursday 12 October 2017 01:48 PM, Gaetan Rivet wrote:
> Introduce new rte_bus operation to configure the probe policy.
> 
> Implementation is required from buses interested in supporting
> this configuration element.
> 

[...]

> diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
> index e40c049..630c9d2 100644
> --- a/lib/librte_eal/common/eal_common_options.c
> +++ b/lib/librte_eal/common/eal_common_options.c
> @@ -997,29 +997,24 @@ int
>   eal_parse_common_option(int opt, const char *optarg,
>   			struct internal_config *conf)
>   {
> -	static int b_used;
> -	static int w_used;
> -
>   	switch (opt) {
>   	/* blacklist */
>   	case 'b':
> -		if (w_used)
> -			goto bw_used;
> +		if (rte_bus_probe_mode_set("pci", RTE_BUS_PROBE_BLACKLIST) < 0)
> +			return -1;

Generic layer shouldn't be concerned about "pci" or other bus.
Problem would be to find which bus this option needs to be set.

What I can think of as options is:
1. Storing this configuration until we can parse the argument for which 
<bus> the argument has been created. That would mean changing the way 
the "-b" and "-w" are passed and to allow non-PCI device identifier to 
be passed.
2. Call each bus bus->ctrl and let it decide what to do based on the args.
  - so, have a wrapper over rte_bus_probe_mode_set for all buses rather 
than taking any one bus as option.

(2) sounds most plausible for now as the application will not send the 
bus name as argument.
And if brute force is not required, we need to split the argument to 
know the bus - after making the device naming standardized (<bus>:<...>)

Even before that, we need to agree that "-w' and "-b" are not more valid 
only for PCIs.

Above is more of loud thinging - I don't have concrete thought on this 
for now. I'll revisit this after reviewing the patches in this series.

>   		if (eal_option_device_add(RTE_DEVTYPE_BLACKLISTED_PCI,
>   				optarg) < 0) {
>   			return -1;
>   		}
> -		b_used = 1;
>   		break;
>   	/* whitelist */
>   	case 'w':
> -		if (b_used)
> -			goto bw_used;
> +		if (rte_bus_probe_mode_set("pci", RTE_BUS_PROBE_WHITELIST) < 0)
> +			return -1;
>   		if (eal_option_device_add(RTE_DEVTYPE_WHITELISTED_PCI,
>   				optarg) < 0) {
>   			return -1;
>   		}
> -		w_used = 1;
>   		break;
>   	/* coremask */
>   	case 'c':
> @@ -1165,10 +1160,6 @@ eal_parse_common_option(int opt, const char *optarg,

[...]

  reply	other threads:[~2017-12-11 12:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12  8:18 [PATCH v1 0/8] Bus control framework Gaetan Rivet
2017-10-12  8:18 ` [PATCH v1 1/8] bus: rename scan policy as probe policy Gaetan Rivet
2017-10-12  8:18 ` [PATCH v1 2/8] bus: introduce opaque control framework Gaetan Rivet
2017-12-11 12:00   ` Shreyansh Jain
2017-12-11 12:43     ` Gaëtan Rivet
2017-12-11 13:36       ` Shreyansh Jain
2017-12-11 14:38         ` Gaëtan Rivet
2017-12-12  7:21           ` Shreyansh Jain
2017-10-12  8:18 ` [PATCH v1 3/8] bus: remove probe mode configuration structure Gaetan Rivet
2017-10-12  8:18 ` [PATCH v1 4/8] bus: add probe mode setter Gaetan Rivet
2017-12-11 12:39   ` Shreyansh Jain [this message]
2017-12-11 12:43     ` Shreyansh Jain
2017-10-12  8:18 ` [PATCH v1 5/8] bus/pci: implement ctrl operator Gaetan Rivet
2017-10-12  8:18 ` [PATCH v1 6/8] bus: add IOVA mode as a ctrl operation Gaetan Rivet
2017-10-12  8:18 ` [PATCH v1 7/8] bus/pci: implement IOVA mode getter Gaetan Rivet
2017-10-12  8:18 ` [PATCH v1 8/8] bus: remove redundant " Gaetan Rivet
2017-12-11 11:53 ` [PATCH v1 0/8] Bus control framework Shreyansh Jain

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=3f96d5f0-30d0-3e71-98f6-283d8bd05238@nxp.com \
    --to=shreyansh.jain@nxp.com \
    --cc=dev@dpdk.org \
    --cc=gaetan.rivet@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.