From 5b923dfbe6daa292a64e6b6878282b6f14e2d3de Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Tue, 2 May 2017 01:05:32 +0200 Subject: [PATCH] eal: remove generic driver and device lists These lists were unused and useless because they are maintained per bus: struct rte_driver_list dev_driver_list struct rte_device_list dev_device_list Signed-off-by: Thomas Monjalon --- lib/librte_eal/bsdapp/eal/rte_eal_version.map | 2 - lib/librte_eal/common/eal_common_dev.c | 34 ---------------- lib/librte_eal/common/eal_common_vdev.c | 11 ------ lib/librte_eal/common/include/rte_dev.h | 39 ------------------- .../linuxapp/eal/rte_eal_version.map | 2 - 5 files changed, 88 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map index 9d3338a134..183ce0f4de 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -23,8 +23,6 @@ DPDK_2.0 { rte_eal_devargs_add; rte_eal_devargs_dump; rte_eal_devargs_type_count; - rte_eal_driver_register; - rte_eal_driver_unregister; rte_eal_get_configuration; rte_eal_get_lcore_state; rte_eal_get_physmem_layout; diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c index 12a22866e8..a306e25256 100644 --- a/lib/librte_eal/common/eal_common_dev.c +++ b/lib/librte_eal/common/eal_common_dev.c @@ -45,40 +45,6 @@ #include "eal_private.h" -/** Global list of device drivers. */ -static struct rte_driver_list dev_driver_list = - TAILQ_HEAD_INITIALIZER(dev_driver_list); -/** Global list of device drivers. */ -static struct rte_device_list dev_device_list = - TAILQ_HEAD_INITIALIZER(dev_device_list); - -/* register a driver */ -void -rte_eal_driver_register(struct rte_driver *driver) -{ - TAILQ_INSERT_TAIL(&dev_driver_list, driver, next); -} - -/* unregister a driver */ -void -rte_eal_driver_unregister(struct rte_driver *driver) -{ - TAILQ_REMOVE(&dev_driver_list, driver, next); -} - -void rte_eal_device_insert(struct rte_device *dev) -{ - RTE_VERIFY(dev->name); - RTE_VERIFY(dev->name[0] != '\0'); - - TAILQ_INSERT_TAIL(&dev_device_list, dev, next); -} - -void rte_eal_device_remove(struct rte_device *dev) -{ - TAILQ_REMOVE(&dev_device_list, dev, next); -} - int rte_eal_dev_attach(const char *name, const char *devargs) { struct rte_pci_addr addr; diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c index 9158a1ca08..e436dac032 100644 --- a/lib/librte_eal/common/eal_common_vdev.c +++ b/lib/librte_eal/common/eal_common_vdev.c @@ -61,14 +61,12 @@ rte_eal_vdrv_register(struct rte_vdev_driver *driver) rte_vdev_bus_register(); 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); } @@ -232,7 +230,6 @@ rte_eal_vdev_init(const char *name, const char *args) TAILQ_INSERT_TAIL(&devargs_list, devargs, next); - rte_eal_device_insert(&dev->device); TAILQ_INSERT_TAIL(&vdev_device_list, dev, next); return 0; @@ -280,7 +277,6 @@ rte_eal_vdev_uninit(const char *name) return ret; TAILQ_REMOVE(&vdev_device_list, dev, next); - rte_eal_device_remove(&dev->device); TAILQ_REMOVE(&devargs_list, devargs, next); @@ -315,7 +311,6 @@ vdev_scan(void) dev->device.numa_node = SOCKET_ID_ANY; dev->device.name = devargs->virt.drv_name; - rte_eal_device_insert(&dev->device); TAILQ_INSERT_TAIL(&vdev_device_list, dev, next); } @@ -327,12 +322,6 @@ vdev_probe(void) { struct rte_vdev_device *dev; - /* - * Note that the dev_driver_list is populated here - * from calls made to rte_eal_driver_register from constructor functions - * embedded into PMD modules via the RTE_PMD_REGISTER_VDEV macro - */ - /* call the init function for each virtual device */ TAILQ_FOREACH(dev, &vdev_device_list, next) { diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h index d18e6b89aa..b63d0540d5 100644 --- a/lib/librte_eal/common/include/rte_dev.h +++ b/lib/librte_eal/common/include/rte_dev.h @@ -123,11 +123,6 @@ struct rte_mem_resource { void *addr; /**< Virtual address, NULL when not mapped. */ }; -/** Double linked list of device drivers. */ -TAILQ_HEAD(rte_driver_list, rte_driver); -/** Double linked list of devices. */ -TAILQ_HEAD(rte_device_list, rte_device); - /* Forward declaration */ struct rte_driver; @@ -142,22 +137,6 @@ struct rte_device { struct rte_devargs *devargs; /**< Device user arguments */ }; -/** - * Insert a device detected by a bus scanning. - * - * @param dev - * A pointer to a rte_device structure describing the detected device. - */ -void rte_eal_device_insert(struct rte_device *dev); - -/** - * Remove a device (e.g. when being unplugged). - * - * @param dev - * A pointer to a rte_device structure describing the device to be removed. - */ -void rte_eal_device_remove(struct rte_device *dev); - /** * A structure describing a device driver. */ @@ -167,24 +146,6 @@ struct rte_driver { const char *alias; /**< Driver alias. */ }; -/** - * Register a device driver. - * - * @param driver - * A pointer to a rte_dev structure describing the driver - * to be registered. - */ -void rte_eal_driver_register(struct rte_driver *driver); - -/** - * Unregister a device driver. - * - * @param driver - * A pointer to a rte_dev structure describing the driver - * to be unregistered. - */ -void rte_eal_driver_unregister(struct rte_driver *driver); - /** * Initialize a driver specified by name. * diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map index 98460cd72c..4607b76589 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map @@ -23,8 +23,6 @@ DPDK_2.0 { rte_eal_devargs_add; rte_eal_devargs_dump; rte_eal_devargs_type_count; - rte_eal_driver_register; - rte_eal_driver_unregister; rte_eal_get_configuration; rte_eal_get_lcore_state; rte_eal_get_physmem_layout; -- 2.20.1