* [dpdk-dev] [PATCH] eal: fix whitelists for hot plug devices
@ 2018-08-31 18:42 Tomasz Kulasek
2018-08-31 21:26 ` Gaëtan Rivet
0 siblings, 1 reply; 2+ messages in thread
From: Tomasz Kulasek @ 2018-08-31 18:42 UTC (permalink / raw)
To: dev
Cc: daniel.verkamp, james.r.harris, shuhei.matsumoto.xt,
dariuszx.stojaczyk, jblunck
Currently white/blacklists doesn't work for hotplugged devices.
This patch checks if device is on the blacklist before attempting
to attach it.
Fixes: a3ee360f4440 ("eal: add hotplug add/remove device")
Cc: jblunck@infradead.org
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
---
lib/librte_eal/common/eal_common_dev.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c
index 678dbca..5f4b600 100644
--- a/lib/librte_eal/common/eal_common_dev.c
+++ b/lib/librte_eal/common/eal_common_dev.c
@@ -147,6 +147,30 @@ int __rte_experimental rte_eal_hotplug_add(const char *busname, const char *devn
return -ENOTSUP;
}
+ /* Check if device is blacklisted */
+ if (bus->conf.scan_mode == RTE_BUS_SCAN_WHITELIST)
+ ret = -EINVAL;
+ else
+ ret = 0;
+
+ da = NULL;
+ do {
+ da = rte_devargs_next(busname, da);
+ if (da != NULL && strcmp(da->name, devname) == 0) {
+ if (da->policy == RTE_DEV_BLACKLISTED)
+ ret = -EINVAL;
+ else
+ ret = 0;
+ break;
+ }
+ } while (da != NULL);
+
+ if (ret) {
+ RTE_LOG(INFO, EAL, " Device is blacklisted (%s)\n",
+ devname);
+ return ret;
+ }
+
da = calloc(1, sizeof(*da));
if (da == NULL)
return -ENOMEM;
--
2.7.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: fix whitelists for hot plug devices
2018-08-31 18:42 [dpdk-dev] [PATCH] eal: fix whitelists for hot plug devices Tomasz Kulasek
@ 2018-08-31 21:26 ` Gaëtan Rivet
0 siblings, 0 replies; 2+ messages in thread
From: Gaëtan Rivet @ 2018-08-31 21:26 UTC (permalink / raw)
To: Tomasz Kulasek
Cc: dev, daniel.verkamp, james.r.harris, shuhei.matsumoto.xt,
dariuszx.stojaczyk, jblunck
Hi Tomasz,
On Fri, Aug 31, 2018 at 08:42:59PM +0200, Tomasz Kulasek wrote:
> Currently white/blacklists doesn't work for hotplugged devices.
>
Current behavior is the intended behavior.
A blacklisted device, then hotplugged, should be probed.
The current devargs management was designed to allow this in
Commit: 55744d83d525 ("devargs: introduce insert function")
If you think this behavior should change, there should be a discussion
about it. If the community agrees with you, then the proper way to
change this would be by rewriting the above.
--
Gaëtan Rivet
6WIND
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-31 21:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-31 18:42 [dpdk-dev] [PATCH] eal: fix whitelists for hot plug devices Tomasz Kulasek
2018-08-31 21:26 ` Gaëtan Rivet
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).