From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v7 12/17] devargs: parse bus policies Date: Sun, 09 Jul 2017 16:50:28 +0200 Message-ID: <8124922.CSY8T9Vcb2@xps> References: <8816dcfaf7d7554cf1a105cf941b43dc8a9e7423.1499384590.git.gaetan.rivet@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, jblunck@infradead.org, matan@mellanox.com To: Gaetan Rivet Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id C33AF58CE for ; Sun, 9 Jul 2017 16:50:29 +0200 (CEST) In-Reply-To: <8816dcfaf7d7554cf1a105cf941b43dc8a9e7423.1499384590.git.gaetan.rivet@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, I think there is a real bug to fix in 17.08-rc2. More details below. Proposals are welcome. 07/07/2017 02:04, Gaetan Rivet: > --- a/lib/librte_eal/common/eal_common_devargs.c > +++ b/lib/librte_eal/common/eal_common_devargs.c > @@ -143,6 +143,21 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str) > > break; > } > + if (devargs->type == RTE_DEVTYPE_WHITELISTED_PCI) { > + if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) { > + bus->conf.scan_mode = RTE_BUS_SCAN_WHITELIST; > + } else if (bus->conf.scan_mode == RTE_BUS_SCAN_BLACKLIST) { > + fprintf(stderr, "ERROR: incompatible device type and bus scan mode\n"); > + goto fail; > + } > + } else if (devargs->type == RTE_DEVTYPE_BLACKLISTED_PCI) { > + if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) { > + bus->conf.scan_mode = RTE_BUS_SCAN_BLACKLIST; > + } else if (bus->conf.scan_mode == RTE_BUS_SCAN_WHITELIST) { > + fprintf(stderr, "ERROR: incompatible device type and bus scan mode\n"); > + goto fail; > + } > + } After another look, there is something wrong here. You are checking a probe policy (wrongly named scan_mode), in a function which can be not related at all with bus probing. Example with failsafe: 1/ We blacklist a device for the global EAL probe. So the probing mode is set from "undefined" to "blacklist". 2/ We add the device as a failsafe slave. 3/ The device must be plugged, no matter of the probe policy. But it is seen as a whitelist and rejected because the bus probing is in blacklist mode. I think it is a serious bug. PS: thanks Matan for having checked it