[dpdk-dev,v11,22/24] eal: register EAL drivers explicitly

Message ID 1474375296-26078-23-git-send-email-shreyansh.jain@nxp.com
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show

Commit Message

Shreyansh Jain Sept. 20, 2016, 12:41 p.m.
From: Jan Viktorin <viktorin@rehivetech.com>

To register both vdev and pci drivers into the list of all rte_driver,
we have to call rte_eal_driver_register explicitly.

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 lib/librte_eal/common/eal_common_pci.c  | 2 ++
 lib/librte_eal/common/eal_common_vdev.c | 2 ++
 2 files changed, 4 insertions(+)

Patch

diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
index 79f5526..0b032d6 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -471,11 +471,13 @@  void
 rte_eal_pci_register(struct rte_pci_driver *driver)
 {
 	TAILQ_INSERT_TAIL(&pci_driver_list, driver, next);
+	rte_eal_driver_register(&driver->driver);
 }
 
 /* unregister a driver */
 void
 rte_eal_pci_unregister(struct rte_pci_driver *driver)
 {
+	rte_eal_driver_unregister(&driver->driver);
 	TAILQ_REMOVE(&pci_driver_list, driver, next);
 }
diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c
index 1a4dec6..6dab782 100644
--- a/lib/librte_eal/common/eal_common_vdev.c
+++ b/lib/librte_eal/common/eal_common_vdev.c
@@ -48,12 +48,14 @@  void
 rte_eal_vdrv_register(struct rte_vdev_driver *driver)
 {
 	TAILQ_INSERT_TAIL(&vdev_driver_list, driver, next);
+	rte_eal_driver_register(&driver->driver);
 }
 
 /* unregister a driver */
 void
 rte_eal_vdrv_unregister(struct rte_vdev_driver *driver)
 {
+	rte_eal_driver_unregister(&driver->driver);
 	TAILQ_REMOVE(&vdev_driver_list, driver, next);
 }