From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shreyansh Jain Subject: Re: [PATCH v1 4/8] bus: add probe mode setter Date: Mon, 11 Dec 2017 18:09:50 +0530 Message-ID: <3f96d5f0-30d0-3e71-98f6-283d8bd05238@nxp.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: To: Gaetan Rivet Return-path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0086.outbound.protection.outlook.com [104.47.40.86]) by dpdk.org (Postfix) with ESMTP id 6FA54E5D for ; Mon, 11 Dec 2017 13:26:18 +0100 (CET) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 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 (:<...>) 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, [...]