DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] pci: fix check uio bind
@ 2017-10-19 11:18 Jianfeng Tan
  2017-10-19 11:42 ` Gaëtan Rivet
  2017-10-24  7:44 ` [dpdk-dev] [PATCH v2] " Jianfeng Tan
  0 siblings, 2 replies; 9+ messages in thread
From: Jianfeng Tan @ 2017-10-19 11:18 UTC (permalink / raw)
  To: dev
  Cc: santosh.shukla, jerin.jacob, anatoly.burakov, gaetan.rivet, Jianfeng Tan

When checking if any devices bound to uio, we did not exclud
those which are blacklisted (or in the case that a whitelist
is specified).

This patch fixes it by only checking whitelisted devices.

Fixes: 815c7deaed2d ("pci: get IOMMU class on Linux")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
---
 lib/librte_eal/linuxapp/eal/eal_pci.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index b4dbf95..2b23d67 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -516,8 +516,26 @@ static inline int
 pci_one_device_bound_uio(void)
 {
 	struct rte_pci_device *dev = NULL;
+	struct rte_devargs *devargs;
+	int check_all = 1;
+	int need_check;
+
+	if (rte_pci_bus.bus.conf.scan_mode == RTE_BUS_SCAN_WHITELIST)
+		check_all = 0;
 
 	FOREACH_DEVICE_ON_PCIBUS(dev) {
+		devargs = dev->device.devargs;
+
+		need_check = 0;
+		if (check_all)
+			need_check = 1;
+		else if (devargs != NULL &&
+			 devargs->policy == RTE_DEV_WHITELISTED)
+			need_check = 1;
+
+		if (!need_check)
+			continue;
+
 		if (dev->kdrv == RTE_KDRV_IGB_UIO ||
 		   dev->kdrv == RTE_KDRV_UIO_GENERIC) {
 			return 1;
-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-10-26 21:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-19 11:18 [dpdk-dev] [PATCH] pci: fix check uio bind Jianfeng Tan
2017-10-19 11:42 ` Gaëtan Rivet
2017-10-20 16:47   ` Tan, Jianfeng
2017-10-20 20:08     ` Gaëtan Rivet
2017-10-23  3:20       ` Tan, Jianfeng
2017-10-24  7:44 ` [dpdk-dev] [PATCH v2] " Jianfeng Tan
2017-10-24  8:25   ` Gaëtan Rivet
2017-10-26 21:48     ` Thomas Monjalon
2017-10-24  8:31   ` santosh

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).