[dpdk-dev,v2] igb_uio: bind error if pcie bridge

Message ID 20180326204336.24236-1-ajit.khaparde@broadcom.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Ajit Khaparde March 26, 2018, 8:43 p.m. UTC
  From: Darren Edamura <darren.edamura@broadcom.com>

Probe function should exit immediately if pcie bridge detected

Signed-off-by: Darren Edamura <darren.edamura@broadcom.com>
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
v1->v2: add a log message if the condition is true.
---
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
index 4cae4dd27..cbc5ab63a 100644
--- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
+++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
@@ -473,6 +473,11 @@  igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	void *map_addr;
 	int err;
 
+	if (pci_is_bridge(dev)) {
+		dev_warn(&dev->dev, "Ignoring PCI bridge device\n");
+		return -ENODEV;
+	}
+
 	udev = kzalloc(sizeof(struct rte_uio_pci_dev), GFP_KERNEL);
 	if (!udev)
 		return -ENOMEM;