DPDK patches and discussions
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 0/X v5 06/14] eal: Make vdev init path generic for both virtual and physcial devices
Date: Mon, 21 Apr 2014 10:59:31 -0400	[thread overview]
Message-ID: <1398092379-7679-7-git-send-email-nhorman@tuxdriver.com> (raw)
In-Reply-To: <1398092379-7679-1-git-send-email-nhorman@tuxdriver.com>

Currently, physical device pmds use a separate initalization path
(rte_pmd_init_all) while virtual devices use a constructor registration and
rte_eal_dev_init.  Theres no reason to have them be separate.  This patch
removes the vdev specific nomenclature from the vdev init path and makes it more
generic for use with all pmds.  This is the first step in converting the
physical device pmds to using the same constructor based registration path that
the virtual devices use

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
---
 lib/librte_eal/bsdapp/eal/Makefile          |   2 +-
 lib/librte_eal/bsdapp/eal/eal.c             |   4 +-
 lib/librte_eal/common/Makefile              |   4 +-
 lib/librte_eal/common/eal_common_dev.c      | 109 +++++++++++++++++++++++++++
 lib/librte_eal/common/eal_common_vdev.c     |  97 ------------------------
 lib/librte_eal/common/include/eal_private.h |   2 +-
 lib/librte_eal/common/include/rte_dev.h     | 111 ++++++++++++++++++++++++++++
 lib/librte_eal/common/include/rte_vdev.h    | 108 ---------------------------
 lib/librte_eal/linuxapp/eal/Makefile        |   2 +-
 lib/librte_eal/linuxapp/eal/eal.c           |   4 +-
 lib/librte_pmd_pcap/rte_eth_pcap.c          |   7 +-
 lib/librte_pmd_ring/rte_eth_ring.c          |   7 +-
 lib/librte_pmd_xenvirt/rte_eth_xenvirt.c    |   7 +-
 13 files changed, 241 insertions(+), 223 deletions(-)
 create mode 100644 lib/librte_eal/common/eal_common_dev.c
 delete mode 100644 lib/librte_eal/common/eal_common_vdev.c
 create mode 100644 lib/librte_eal/common/include/rte_dev.h
 delete mode 100644 lib/librte_eal/common/include/rte_vdev.h

diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile
index 4c2a4f1..abf1ad2 100644
--- a/lib/librte_eal/bsdapp/eal/Makefile
+++ b/lib/librte_eal/bsdapp/eal/Makefile
@@ -69,7 +69,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_errno.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_cpuflags.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_hexdump.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_whitelist.c
-SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_vdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_dev.c
 
 CFLAGS_eal.o := -D_GNU_SOURCE
 #CFLAGS_eal_thread.o := -D_GNU_SOURCE
diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index e944aba..8de3fad 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -854,8 +854,8 @@ rte_eal_init(int argc, char **argv)
 
 	rte_eal_mcfg_complete();
 
-	if (rte_eal_vdev_init() < 0)
-		rte_panic("Cannot init virtual devices\n");
+	if (rte_eal_dev_init() < 0)
+		rte_panic("Cannot init pmd devices\n");
 
 	RTE_LCORE_FOREACH_SLAVE(i) {
 
diff --git a/lib/librte_eal/common/Makefile b/lib/librte_eal/common/Makefile
index d3e7e39..0016fc5 100644
--- a/lib/librte_eal/common/Makefile
+++ b/lib/librte_eal/common/Makefile
@@ -37,8 +37,8 @@ INC += rte_log.h rte_memcpy.h rte_memory.h rte_memzone.h rte_pci.h
 INC += rte_pci_dev_ids.h rte_per_lcore.h rte_prefetch.h rte_random.h
 INC += rte_rwlock.h rte_spinlock.h rte_tailq.h rte_interrupts.h rte_alarm.h
 INC += rte_string_fns.h rte_cpuflags.h rte_version.h rte_tailq_elem.h
-INC += rte_eal_memconfig.h rte_malloc_heap.h 
-INC += rte_hexdump.h rte_devargs.h rte_vdev.h
+INC += rte_eal_memconfig.h rte_malloc_heap.h
+INC += rte_hexdump.h rte_devargs.h rte_dev.h
 
 ifeq ($(CONFIG_RTE_INSECURE_FUNCTION_WARNING),y)
 INC += rte_warnings.h
diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c
new file mode 100644
index 0000000..8c42738
--- /dev/null
+++ b/lib/librte_eal/common/eal_common_dev.c
@@ -0,0 +1,109 @@
+/*-
+ *   BSD LICENSE
+ * 
+ *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2014 6WIND S.A.
+ *   All rights reserved.
+ * 
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ * 
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *     * Neither the name of Intel Corporation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ * 
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string.h>
+#include <inttypes.h>
+#include <sys/queue.h>
+
+#include <rte_dev.h>
+#include <rte_devargs.h>
+#include <rte_debug.h>
+#include <rte_devargs.h>
+
+#include "eal_private.h"
+
+/** Global list of device drivers. */
+static struct rte_driver_list dev_driver_list =
+	TAILQ_HEAD_INITIALIZER(dev_driver_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);
+}
+
+int
+rte_eal_dev_init(void)
+{
+	struct rte_devargs *devargs;
+	struct rte_driver *driver;
+
+	/*
+	 * 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 PMD_REGISTER_DRIVER macro
+	 */
+
+	/* call the init function for each virtual device */
+	TAILQ_FOREACH(devargs, &devargs_list, next) {
+
+		if (devargs->type != RTE_DEVTYPE_VIRTUAL)
+			continue;
+
+		TAILQ_FOREACH(driver, &dev_driver_list, next) {
+			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))) {
+				driver->init(devargs->virtual.drv_name,
+					devargs->args);
+				break;
+			}
+		}
+
+		if (driver == NULL) {
+			rte_panic("no driver found for %s\n",
+				  devargs->virtual.drv_name);
+		}
+	}
+
+	/* 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;
+}
diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c
deleted file mode 100644
index 62d0302..0000000
--- a/lib/librte_eal/common/eal_common_vdev.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*-
- *   BSD LICENSE
- * 
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
- *   Copyright(c) 2014 6WIND S.A.
- *   All rights reserved.
- * 
- *   Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions
- *   are met:
- * 
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in
- *       the documentation and/or other materials provided with the
- *       distribution.
- *     * Neither the name of Intel Corporation nor the names of its
- *       contributors may be used to endorse or promote products derived
- *       from this software without specific prior written permission.
- * 
- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string.h>
-#include <inttypes.h>
-#include <sys/queue.h>
-
-#include <rte_vdev.h>
-#include <rte_devargs.h>
-#include <rte_debug.h>
-#include <rte_devargs.h>
-
-#include "eal_private.h"
-
-/** Global list of virtual device drivers. */
-static struct rte_vdev_driver_list vdev_driver_list =
-	TAILQ_HEAD_INITIALIZER(vdev_driver_list);
-
-/* register a driver */
-void
-rte_eal_vdev_driver_register(struct rte_vdev_driver *driver)
-{
-	TAILQ_INSERT_TAIL(&vdev_driver_list, driver, next);
-}
-
-/* unregister a driver */
-void
-rte_eal_vdev_driver_unregister(struct rte_vdev_driver *driver)
-{
-	TAILQ_REMOVE(&vdev_driver_list, driver, next);
-}
-
-int
-rte_eal_vdev_init(void)
-{
-	struct rte_devargs *devargs;
-	struct rte_vdev_driver *driver;
-
-	/* No need to register drivers that are embeded in DPDK
-	 * (pmd_pcap, pmd_ring, ...). The initialization function have
-	 * the ((constructor)) attribute so they will register at
-	 * startup. */
-
-	/* call the init function for each virtual device */
-	TAILQ_FOREACH(devargs, &devargs_list, next) {
-
-		if (devargs->type != RTE_DEVTYPE_VIRTUAL)
-			continue;
-
-		TAILQ_FOREACH(driver, &vdev_driver_list, next) {
-			/* 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 (driver == NULL) {
-			rte_panic("no driver found for %s\n",
-				  devargs->virtual.drv_name);
-		}
-	}
-	return 0;
-}
diff --git a/lib/librte_eal/common/include/eal_private.h b/lib/librte_eal/common/include/eal_private.h
index 22d8b08..b99ad23 100644
--- a/lib/librte_eal/common/include/eal_private.h
+++ b/lib/librte_eal/common/include/eal_private.h
@@ -201,6 +201,6 @@ int rte_eal_alarm_init(void);
  *
  * This function is private to the EAL.
  */
-int rte_eal_vdev_init(void);
+int rte_eal_dev_init(void);
 
 #endif /* _EAL_PRIVATE_H_ */
diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
new file mode 100644
index 0000000..5af36c8
--- /dev/null
+++ b/lib/librte_eal/common/include/rte_dev.h
@@ -0,0 +1,111 @@
+/*-
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2014 6WIND S.A.
+ *   All rights reserved.
+ *
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *     * Neither the name of 6WIND S.A. nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _RTE_DEV_H_
+#define _RTE_DEV_H_
+
+/**
+ * @file
+ *
+ * RTE PMD Driver Registration Interface
+ *
+ * This file manages the list of device drivers.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <sys/queue.h>
+
+/** Double linked list of device drivers. */
+TAILQ_HEAD(rte_driver_list, rte_driver);
+
+/**
+ * Initialization function called for each device driver once.
+ */
+typedef int (rte_dev_init_t)(const char *name, const char *args);
+
+/**
+ * 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. */
+	rte_dev_init_t *init;              /**< Device init. function. */
+};
+
+/**
+ * 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);
+
+/**
+ * Initalize all the registered drivers in this process
+ */
+int rte_eal_dev_init(void);
+
+#define PMD_REGISTER_DRIVER(d)\
+void devinitfn_ ##d(void);\
+void __attribute__((constructor, used)) devinitfn_ ##d(void)\
+{\
+		rte_eal_driver_register(&d);\
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTE_VDEV_H_ */
diff --git a/lib/librte_eal/common/include/rte_vdev.h b/lib/librte_eal/common/include/rte_vdev.h
deleted file mode 100644
index c7aa795..0000000
--- a/lib/librte_eal/common/include/rte_vdev.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*-
- *   BSD LICENSE
- *
- *   Copyright(c) 2014 6WIND S.A.
- *   All rights reserved.
- *
- *   Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions
- *   are met:
- *
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in
- *       the documentation and/or other materials provided with the
- *       distribution.
- *     * Neither the name of 6WIND S.A. nor the names of its
- *       contributors may be used to endorse or promote products derived
- *       from this software without specific prior written permission.
- *
- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _RTE_VDEV_H_
-#define _RTE_VDEV_H_
-
-/**
- * @file
- *
- * RTE Virtual Devices Interface
- *
- * This file manages the list of the virtual device drivers.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <sys/queue.h>
-
-/** Double linked list of virtual device drivers. */
-TAILQ_HEAD(rte_vdev_driver_list, rte_vdev_driver);
-
-/**
- * Initialization function called for each virtual device probing.
- */
-typedef int (rte_vdev_init_t)(const char *name, const char *args);
-
-/**
- * A structure describing a virtual device driver.
- */
-struct rte_vdev_driver {
-	TAILQ_ENTRY(rte_vdev_driver) next;  /**< Next in list. */
-	const char *name;                   /**< Driver name. */
-	rte_vdev_init_t *init;              /**< Device init. function. */
-};
-
-/**
- * Register a virtual device driver.
- *
- * @param driver
- *   A pointer to a rte_vdev structure describing the driver
- *   to be registered.
- */
-void rte_eal_vdev_driver_register(struct rte_vdev_driver *driver);
-
-/**
- * Unregister a virtual device driver.
- *
- * @param driver
- *   A pointer to a rte_vdev structure describing the driver
- *   to be unregistered.
- */
-void rte_eal_vdev_driver_unregister(struct rte_vdev_driver *driver);
-
-enum rte_pmd_driver_type {
-	PMD_VDEV = 1
-};
-
-extern void rte_eal_nonpci_dev_init_register(const char *name, int (*dev_initfn)(const char *, const char *));
-#define PMD_REGISTER_DRIVER(d, t)\
-void devinitfn_ ##d(void);\
-void __attribute__((constructor, used)) devinitfn_ ##d(void)\
-{\
-	enum rte_pmd_driver_type _t = (t);\
-	switch(_t)\
-	{\
-		case PMD_VDEV:\
-			rte_eal_vdev_driver_register(&d);\
-			break;\
-	};\
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _RTE_VDEV_H_ */
diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile
index 00f7367..e800e60 100644
--- a/lib/librte_eal/linuxapp/eal/Makefile
+++ b/lib/librte_eal/linuxapp/eal/Makefile
@@ -77,7 +77,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_errno.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_cpuflags.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_hexdump.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_devargs.c
-SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_vdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_dev.c
 
 CFLAGS_eal.o := -D_GNU_SOURCE
 CFLAGS_eal_thread.o := -D_GNU_SOURCE
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index 04b2b32..d95fd54 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -1058,8 +1058,8 @@ rte_eal_init(int argc, char **argv)
 			RTE_LOG(WARNING, EAL, "%s\n", dlerror());
 	}
 
-	if (rte_eal_vdev_init() < 0)
-		rte_panic("Cannot init virtual devices\n");
+	if (rte_eal_dev_init() < 0)
+		rte_panic("Cannot init pmd devices\n");
 
 	RTE_LOG(DEBUG, EAL, "Master core %u is ready (tid=%x)\n",
 		rte_config.master_lcore, (int)thread_id);
diff --git a/lib/librte_pmd_pcap/rte_eth_pcap.c b/lib/librte_pmd_pcap/rte_eth_pcap.c
index c987940..dc4670c 100644
--- a/lib/librte_pmd_pcap/rte_eth_pcap.c
+++ b/lib/librte_pmd_pcap/rte_eth_pcap.c
@@ -40,7 +40,7 @@
 #include <rte_string_fns.h>
 #include <rte_cycles.h>
 #include <rte_kvargs.h>
-#include <rte_vdev.h>
+#include <rte_dev.h>
 
 #include <net/if.h>
 
@@ -767,9 +767,10 @@ rte_pmd_pcap_devinit(const char *name, const char *params)
 
 }
 
-static struct rte_vdev_driver pmd_pcap_drv = {
+static struct rte_driver pmd_pcap_drv = {
 	.name = "eth_pcap",
+	.type = PMD_VDEV,
 	.init = rte_pmd_pcap_devinit,
 };
 
-PMD_REGISTER_DRIVER(pmd_pcap_drv, PMD_VDEV);
+PMD_REGISTER_DRIVER(pmd_pcap_drv);
diff --git a/lib/librte_pmd_ring/rte_eth_ring.c b/lib/librte_pmd_ring/rte_eth_ring.c
index 6325a3a..b761543 100644
--- a/lib/librte_pmd_ring/rte_eth_ring.c
+++ b/lib/librte_pmd_ring/rte_eth_ring.c
@@ -37,7 +37,7 @@
 #include <rte_malloc.h>
 #include <rte_memcpy.h>
 #include <rte_string_fns.h>
-#include <rte_vdev.h>
+#include <rte_dev.h>
 #include <rte_kvargs.h>
 
 #define ETH_RING_NUMA_NODE_ACTION_ARG	"nodeaction"
@@ -522,9 +522,10 @@ out:
 	return ret;
 }
 
-static struct rte_vdev_driver pmd_ring_drv = {
+static struct rte_driver pmd_ring_drv = {
 	.name = "eth_ring",
+	.type = PMD_VDEV,
 	.init = rte_pmd_ring_devinit,
 };
 
-PMD_REGISTER_DRIVER(pmd_ring_drv, PMD_VDEV);
+PMD_REGISTER_DRIVER(pmd_ring_drv);
diff --git a/lib/librte_pmd_xenvirt/rte_eth_xenvirt.c b/lib/librte_pmd_xenvirt/rte_eth_xenvirt.c
index ecafe7a..5b976d3 100644
--- a/lib/librte_pmd_xenvirt/rte_eth_xenvirt.c
+++ b/lib/librte_pmd_xenvirt/rte_eth_xenvirt.c
@@ -53,7 +53,7 @@
 #include <rte_malloc.h>
 #include <rte_memcpy.h>
 #include <rte_string_fns.h>
-#include <rte_vdev.h>
+#include <rte_dev.h>
 #include <cmdline_parse.h>
 #include <cmdline_parse_etheraddr.h>
 
@@ -706,9 +706,10 @@ rte_pmd_xenvirt_devinit(const char *name, const char *params)
 	return 0;
 }
 
-static struct rte_vdev_driver pmd_xenvirt_drv = {
+static struct rte_driver pmd_xenvirt_drv = {
 	.name = "eth_xenvirt",
+	.type = PMD_VDEV,
 	.init = rte_pmd_xenvirt_devinit,
 };
 
-PMD_REGISTER_DRIVER(pmd_xenvirt_drv, PMD_VDEV);
+PMD_REGISTER_DRIVER(pmd_xenvirt_drv);
-- 
1.8.3.1

  parent reply	other threads:[~2014-04-21 15:00 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-15 18:05 [dpdk-dev] [PATCH 0/15] dpdk: Separate compile time linkage between eal lib and pmd's Neil Horman
2014-04-15 18:05 ` [dpdk-dev] [PATCH 01/15] makefiles: Fixed -share command line option error Neil Horman
2014-04-16  9:22   ` Thomas Monjalon
2014-04-16 11:00     ` Neil Horman
2014-04-16 11:37       ` Thomas Monjalon
2014-04-16 13:51   ` [dpdk-dev] [PATCH 01/15 v2] " Neil Horman
2014-04-18 11:23     ` Thomas Monjalon
2014-04-18 13:18       ` Neil Horman
2014-04-18 13:29         ` Thomas Monjalon
2014-04-18 17:36           ` Neil Horman
2014-04-21 14:41           ` Neil Horman
2014-04-29 23:42     ` Thomas Monjalon
2014-05-02 11:09       ` Neil Horman
2014-05-02 12:22         ` Thomas Monjalon
2014-05-02 13:01           ` Neil Horman
2014-05-02 13:18             ` Thomas Monjalon
2014-04-15 18:05 ` [dpdk-dev] [PATCH 02/15] make: include whole archive on static link Neil Horman
2014-04-16  9:26   ` Thomas Monjalon
2014-04-16 11:02     ` Neil Horman
2014-04-16 11:40       ` Thomas Monjalon
2014-04-16 13:02         ` Neil Horman
2014-04-16 13:33           ` Neil Horman
2014-04-15 18:05 ` [dpdk-dev] [PATCH 03/15] pmd: Add PMD_REGISTER_DRIVER macro Neil Horman
2014-04-16 11:52   ` Thomas Monjalon
2014-04-16 12:59     ` John W. Linville
2014-04-16 13:08     ` Neil Horman
2014-04-16 16:11       ` Olivier MATZ
2014-04-16 17:15         ` John W. Linville
2014-04-16 17:29         ` Neil Horman
2014-04-17  8:08           ` Olivier MATZ
2014-04-17 10:59             ` Neil Horman
2014-04-18 11:42   ` Thomas Monjalon
2014-04-18 12:04     ` Neil Horman
2014-04-18 12:08       ` Thomas Monjalon
2014-04-18 13:20         ` Neil Horman
2014-04-18 13:32           ` Thomas Monjalon
2014-04-18 17:42             ` Neil Horman
2014-04-15 18:05 ` [dpdk-dev] [PATCH 04/15] pcap: Convert to use of PMD_REGISTER_DRIVER and fix linking Neil Horman
2014-04-15 18:05 ` [dpdk-dev] [PATCH 05/15] ring: " Neil Horman
2014-04-16 13:53   ` [dpdk-dev] [PATCH 05/15 v2] " Neil Horman
2014-04-17  9:50   ` [dpdk-dev] [PATCH 05/15] " Ananyev, Konstantin
2014-04-17 11:06     ` Neil Horman
2014-04-17 15:16     ` [dpdk-dev] [PATCH 05/15 v3] " Neil Horman
2014-06-13 13:28       ` De Lara Guarch, Pablo
2014-04-15 18:06 ` [dpdk-dev] [PATCH 06/15] xenvirt: " Neil Horman
2014-04-15 18:06 ` [dpdk-dev] [PATCH 07/15] eal: Make vdev init path generic for both virtual and physcial devices Neil Horman
2014-04-18 12:02   ` Thomas Monjalon
2014-04-15 18:06 ` [dpdk-dev] [PATCH 08/15] igb: Convert to use of PMD_REGISTER_DRIVER and fix linking Neil Horman
2014-04-15 18:06 ` [dpdk-dev] [PATCH 09/15] igbvf: " Neil Horman
2014-04-15 18:06 ` [dpdk-dev] [PATCH 10/15] e1000: " Neil Horman
2014-04-15 18:06 ` [dpdk-dev] [PATCH 11/15] ixgbe: " Neil Horman
2014-04-15 18:06 ` [dpdk-dev] [PATCH 12/15] ixgbevf: " Neil Horman
2014-04-15 18:06 ` [dpdk-dev] [PATCH 13/15] virtio: " Neil Horman
2014-04-15 18:06 ` [dpdk-dev] [PATCH 14/15] vmxnet3: " Neil Horman
2014-04-15 18:06 ` [dpdk-dev] [PATCH 15/15] pmd: Remove rte_pmd_init_all Neil Horman
2014-04-21 14:59 ` [dpdk-dev] [PATCH v5 00/14] dpdk: Separate compile time linkage between eal lib and pmd's Neil Horman
2014-04-21 14:59   ` [dpdk-dev] [PATCH 0/X v5 01/14] makefiles: Fixed -share command line option error Neil Horman
2014-04-21 14:59   ` [dpdk-dev] [PATCH 0/X v5 02/14] pmd: Add PMD_REGISTER_DRIVER macro Neil Horman
2014-04-21 14:59   ` [dpdk-dev] [PATCH 0/X v5 03/14] pcap: Convert to use of PMD_REGISTER_DRIVER and fix linking Neil Horman
2014-04-21 14:59   ` [dpdk-dev] [PATCH 0/X v5 04/14] ring: " Neil Horman
2014-04-21 14:59   ` [dpdk-dev] [PATCH 0/X v5 05/14] xenvirt: " Neil Horman
2014-04-21 14:59   ` Neil Horman [this message]
2014-04-21 14:59   ` [dpdk-dev] [PATCH 0/X v5 07/14] igb: " Neil Horman
2014-04-21 14:59   ` [dpdk-dev] [PATCH 0/X v5 08/14] igbvf: " Neil Horman
2014-04-21 14:59   ` [dpdk-dev] [PATCH 0/X v5 09/14] e1000: " Neil Horman
2014-04-21 14:59   ` [dpdk-dev] [PATCH 0/X v5 10/14] ixgbe: " Neil Horman
2014-04-21 14:59   ` [dpdk-dev] [PATCH 0/X v5 11/14] ixgbevf: " Neil Horman
2014-04-21 14:59   ` [dpdk-dev] [PATCH 0/X v5 12/14] virtio: " Neil Horman
2014-04-21 14:59   ` [dpdk-dev] [PATCH 0/X v5 13/14] vmxnet3: " Neil Horman
2014-04-21 14:59   ` [dpdk-dev] [PATCH 0/X v5 14/14] pmd: Remove rte_pmd_init_all Neil Horman
2014-04-21 17:05   ` [dpdk-dev] [PATCH v5 00/14] dpdk: Separate compile time linkage between eal lib and pmd's Neil Horman
2014-04-21 20:10   ` Stephen Hemminger
2014-04-21 20:36     ` Neil Horman
2014-05-16 15:28   ` Neil Horman
2014-05-16 15:39     ` Thomas Monjalon
2014-05-20 12:45   ` Thomas Monjalon
2014-05-20 14:13     ` Neil Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1398092379-7679-7-git-send-email-nhorman@tuxdriver.com \
    --to=nhorman@tuxdriver.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).