eal: revert link bonding specific initialization
authorDavid Marchand <david.marchand@6wind.com>
Tue, 26 Aug 2014 14:12:17 +0000 (16:12 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 29 Sep 2014 09:56:19 +0000 (11:56 +0200)
Revert commit a155d430119 ("support link bonding device initialization"),
except PCI probing at rte_eal_init time.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
[Thomas: merge revert with PCI probing restore]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_eal/bsdapp/eal/eal.c
lib/librte_eal/common/eal_common_dev.c
lib/librte_eal/common/eal_common_pci.c
lib/librte_eal/common/include/eal_private.h
lib/librte_eal/common/include/rte_dev.h
lib/librte_eal/linuxapp/eal/eal.c

index c4b75a4..df1946c 100644 (file)
@@ -587,7 +587,7 @@ rte_eal_init(int argc, char **argv)
 
        rte_eal_mcfg_complete();
 
-       if (rte_eal_dev_init(PMD_INIT_PRE_PCI_PROBE) < 0)
+       if (rte_eal_dev_init() < 0)
                rte_panic("Cannot init pmd devices\n");
 
        RTE_LCORE_FOREACH_SLAVE(i) {
@@ -621,11 +621,7 @@ rte_eal_init(int argc, char **argv)
 
        /* Probe & Initialize PCI devices */
        if (rte_eal_pci_probe())
-                       rte_panic("Cannot probe PCI\n");
-
-       /* Initialize any outstanding devices */
-       if (rte_eal_dev_init(PMD_INIT_POST_PCI_PROBE) < 0)
-               rte_panic("Cannot init pmd devices\n");
+               rte_panic("Cannot probe PCI\n");
 
        return fctret;
 }
index 1194419..eae5656 100644 (file)
@@ -62,7 +62,7 @@ rte_eal_driver_unregister(struct rte_driver *driver)
 }
 
 int
-rte_eal_dev_init(uint8_t init_pri)
+rte_eal_dev_init(void)
 {
        struct rte_devargs *devargs;
        struct rte_driver *driver;
@@ -80,52 +80,30 @@ rte_eal_dev_init(uint8_t init_pri)
                        continue;
 
                TAILQ_FOREACH(driver, &dev_driver_list, next) {
-                       /* RTE_DEVTYPE_VIRTUAL can only be a virtual or bonded device,
-                        * virtual devices are initialized pre PCI probing and bonded
-                        * device are post pci probing */
-                       if ((driver->type == PMD_VDEV && init_pri ==
-                                       PMD_INIT_PRE_PCI_PROBE) ||
-                               (driver->type == PMD_BDEV && init_pri ==
-                                               PMD_INIT_POST_PCI_PROBE)) {
+                       if (driver->type != PMD_VDEV)
+                               continue;
 
-                               /* search a driver prefix in virtual device name */
-                               if (!strncmp(driver->name, devargs->virtual.drv_name,
-                                               strlen(driver->name))) {
-                                       printf("init (%u) %s\n", init_pri, devargs->virtual.drv_name);
-                                       driver->init(devargs->virtual.drv_name,
-                                               devargs->args);
-                                       break;
-                               }
+                       /* search a driver prefix in virtual device name */
+                       if (!strncmp(driver->name, devargs->virtual.drv_name,
+                                       strlen(driver->name))) {
+                               driver->init(devargs->virtual.drv_name,
+                                       devargs->args);
+                               break;
                        }
                }
 
-               /* If initializing pre PCI probe, then we don't expect a bonded driver
-                * to be found */
-               if (init_pri == PMD_INIT_PRE_PCI_PROBE &&
-                               strncmp(PMD_BOND_NAME, devargs->virtual.drv_name,
-                                       strlen(PMD_BOND_NAME)) != 0) {
-                       if (driver == NULL) {
-                               rte_panic("no driver found for virtual device %s\n",
-                                       devargs->virtual.drv_name);
-                       }
-               } else if (init_pri == PMD_INIT_POST_PCI_PROBE &&
-                               strncmp(PMD_BOND_NAME, devargs->virtual.drv_name,
-                                       strlen(PMD_BOND_NAME)) == 0) {
-                       if (driver == NULL) {
-                               rte_panic("no driver found for bonded device %s\n",
-                                       devargs->virtual.drv_name);
-                       }
+               if (driver == NULL) {
+                       rte_panic("no driver found for %s\n",
+                                 devargs->virtual.drv_name);
                }
        }
 
-       /* Once the vdevs are initialized, start calling all the pdev drivers */
-       if (init_pri == PMD_INIT_PRE_PCI_PROBE) {
-               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);
-               }
+       /* 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);
        }
        return 0;
 }
index c637361..af809a8 100644 (file)
@@ -150,9 +150,6 @@ rte_eal_pci_probe(void)
                probe_all = 1;
 
        TAILQ_FOREACH(dev, &pci_device_list, next) {
-               /* check if device has already been initialized */
-               if (dev->driver != NULL)
-                       continue;
 
                /* set devargs in PCI structure */
                devargs = pci_devargs_lookup(dev);
index b440ffb..232fcec 100644 (file)
@@ -196,4 +196,11 @@ int rte_eal_intr_init(void);
  */
 int rte_eal_alarm_init(void);
 
+/**
+ * This function initialises any virtual devices
+ *
+ * This function is private to the EAL.
+ */
+int rte_eal_dev_init(void);
+
 #endif /* _EAL_PRIVATE_H_ */
index d89f1a5..f7e3a10 100644 (file)
@@ -62,16 +62,6 @@ typedef int (rte_dev_init_t)(const char *name, const char *args);
 enum pmd_type {
        PMD_VDEV = 0,
        PMD_PDEV = 1,
-       PMD_BDEV = 2,   /**< Poll Mode Driver Bonded Device*/
-};
-
-#define PMD_BOND_NAME "eth_bond"
-
-/**
- * Driver initialization */
-enum pmd_init_priority {
-       PMD_INIT_PRE_PCI_PROBE = 0,
-       PMD_INIT_POST_PCI_PROBE = 1,
 };
 
 /**
@@ -103,9 +93,9 @@ void rte_eal_driver_register(struct rte_driver *driver);
 void rte_eal_driver_unregister(struct rte_driver *driver);
 
 /**
- * Initialize all the registered drivers in this process
+ * Initalize all the registered drivers in this process
  */
-int rte_eal_dev_init(uint8_t init_priority);
+int rte_eal_dev_init(void);
 
 #define PMD_REGISTER_DRIVER(d)\
 void devinitfn_ ##d(void);\
index 05804dc..6c8e760 100644 (file)
@@ -75,7 +75,6 @@
 #include <rte_atomic.h>
 #include <malloc_heap.h>
 #include <rte_eth_ring.h>
-#include <rte_dev.h>
 
 #include "eal_private.h"
 #include "eal_thread.h"
@@ -877,7 +876,7 @@ rte_eal_init(int argc, char **argv)
        RTE_LOG(DEBUG, EAL, "Master core %u is ready (tid=%x)\n",
                rte_config.master_lcore, (int)thread_id);
 
-       if (rte_eal_dev_init(PMD_INIT_PRE_PCI_PROBE) < 0)
+       if (rte_eal_dev_init() < 0)
                rte_panic("Cannot init pmd devices\n");
 
        RTE_LCORE_FOREACH_SLAVE(i) {
@@ -909,11 +908,7 @@ rte_eal_init(int argc, char **argv)
 
        /* Probe & Initialize PCI devices */
        if (rte_eal_pci_probe())
-                       rte_panic("Cannot probe PCI\n");
-
-       /* Initialize any outstanding devices */
-       if (rte_eal_dev_init(PMD_INIT_POST_PCI_PROBE) < 0)
-               rte_panic("Cannot init pmd devices\n");
+               rte_panic("Cannot probe PCI\n");
 
        return fctret;
 }