[dpdk-stable] patch 'pci: fix device registration on FreeBSD' has been queued to stable release 17.02.1

Yuanhan Liu yuanhan.liu at linux.intel.com
Thu May 25 11:47:33 CEST 2017


Hi,

FYI, your patch has been queued to stable release 17.02.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/28/17. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From 9859523c4285e13dbb291948ce6cc3fa17a270dc Mon Sep 17 00:00:00 2001
From: Ben Walker <benjamin.walker at intel.com>
Date: Tue, 21 Mar 2017 11:32:15 -0700
Subject: [PATCH] pci: fix device registration on FreeBSD

[ upstream commit 24a535796824049fab8570d0b29e658470375876 ]

The FreeBSD implementation wasn't registering new devices
with the device framework on start up. However, common
code attempts to unregister them on shutdown which causes
a SEGFAULT. This fix makes the FreeBSD code do the same
thing as the Linux code for registration.

Fixes: 13a1317d3ba7 ("pci: create device list and fallback on its members")

Signed-off-by: Ben Walker <benjamin.walker at intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain at nxp.com>
---
 lib/librte_eal/bsdapp/eal/eal_pci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c
index 3a5c315..16a1743 100644
--- a/lib/librte_eal/bsdapp/eal/eal_pci.c
+++ b/lib/librte_eal/bsdapp/eal/eal_pci.c
@@ -314,6 +314,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)
 
 	/* device is valid, add in list (sorted) */
 	if (TAILQ_EMPTY(&pci_device_list)) {
+		rte_eal_device_insert(&dev->device);
 		TAILQ_INSERT_TAIL(&pci_device_list, dev, next);
 	}
 	else {
@@ -326,7 +327,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)
 				continue;
 			else if (ret < 0) {
 				TAILQ_INSERT_BEFORE(dev2, dev, next);
-				return 0;
+				rte_eal_device_insert(&dev->device);
 			} else { /* already registered */
 				dev2->kdrv = dev->kdrv;
 				dev2->max_vfs = dev->max_vfs;
@@ -334,9 +335,10 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)
 					dev->mem_resource,
 					sizeof(dev->mem_resource));
 				free(dev);
-				return 0;
 			}
+			return 0;
 		}
+		rte_eal_device_insert(&dev->device);
 		TAILQ_INSERT_TAIL(&pci_device_list, dev, next);
 	}
 
-- 
1.9.0



More information about the stable mailing list