@@ -1,7 +1,7 @@
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
* Copyright(c) 2014 6WIND S.A.
* All rights reserved.
*
@@ -72,8 +72,6 @@ rte_eal_vdev_init(const char *name, const char *args)
return -EINVAL;
TAILQ_FOREACH(driver, &dev_driver_list, next) {
- if (driver->type != PMD_VDEV)
- continue;
/*
* search a driver prefix in virtual device name.
@@ -117,10 +115,18 @@ rte_eal_dev_init(void)
/* Once the vdevs are initalized, start calling all the pdev drivers */
TAILQ_FOREACH(driver, &dev_driver_list, next) {
- if (driver->type != PMD_PDEV)
- continue;
- /* PDEV drivers don't get passed any parameters */
- driver->init(NULL, NULL);
+
+ /* PCI drivers don't get passed any parameters */
+ /*
+ * Search a virtual driver prefix in device name.
+ * It should not be found for PCI devices.
+ * Use strncmp to compare.
+ */
+
+ if ((driver->name) &&
+ (strncmp(driver->name, "eth_", strlen("eth_")) != 0)) {
+ driver->init(NULL, NULL);
+ }
}
return 0;
}
@@ -134,8 +140,6 @@ rte_eal_vdev_uninit(const char *name)
return -EINVAL;
TAILQ_FOREACH(driver, &dev_driver_list, next) {
- if (driver->type != PMD_VDEV)
- continue;
/*
* search a driver prefix in virtual device name.
@@ -62,20 +62,11 @@ typedef int (rte_dev_init_t)(const char *name, const char *args);
typedef int (rte_dev_uninit_t)(const char *name);
/**
- * Driver type enumeration
- */
-enum pmd_type {
- PMD_VDEV = 0,
- PMD_PDEV = 1,
-};
-
-/**
* A structure describing a device driver.
*/
struct rte_driver {
TAILQ_ENTRY(rte_driver) next; /**< Next in list. */
- enum pmd_type type; /**< PMD Driver type */
- const char *name; /**< Driver name. */
+ const char *name; /**< Driver name. */
rte_dev_init_t *init; /**< Device init. function. */
rte_dev_uninit_t *uninit; /**< Device uninit. function. */
};
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com> --- lib/librte_eal/common/eal_common_dev.c | 22 +++++++++++++--------- lib/librte_eal/common/include/rte_dev.h | 11 +---------- 2 files changed, 14 insertions(+), 19 deletions(-)