]> git.droids-corp.org - dpdk.git/commitdiff
bus/vdev: move code from EAL into a new driver
authorJianfeng Tan <jianfeng.tan@intel.com>
Tue, 7 Nov 2017 06:54:21 +0000 (06:54 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 7 Nov 2017 15:54:07 +0000 (16:54 +0100)
Move the vdev bus from lib/librte_eal to drivers/bus.

As the crypto vdev helper function refers to data structure
in rte_vdev.h, so we move those helper function into drivers/bus
too.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
79 files changed:
MAINTAINERS
config/common_base
doc/guides/rel_notes/release_17_11.rst
drivers/bus/Makefile
drivers/bus/vdev/Makefile [new file with mode: 0644]
drivers/bus/vdev/rte_bus_vdev.h [new file with mode: 0644]
drivers/bus/vdev/rte_bus_vdev_version.map [new file with mode: 0644]
drivers/bus/vdev/vdev.c [new file with mode: 0644]
drivers/crypto/aesni_gcm/Makefile
drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
drivers/crypto/aesni_mb/Makefile
drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
drivers/crypto/armv8/Makefile
drivers/crypto/armv8/rte_armv8_pmd.c
drivers/crypto/kasumi/Makefile
drivers/crypto/kasumi/rte_kasumi_pmd.c
drivers/crypto/mrvl/Makefile
drivers/crypto/mrvl/rte_mrvl_pmd.c
drivers/crypto/null/Makefile
drivers/crypto/null/null_crypto_pmd.c
drivers/crypto/openssl/Makefile
drivers/crypto/openssl/rte_openssl_pmd.c
drivers/crypto/scheduler/Makefile
drivers/crypto/scheduler/scheduler_pmd.c
drivers/crypto/snow3g/Makefile
drivers/crypto/snow3g/rte_snow3g_pmd.c
drivers/crypto/zuc/Makefile
drivers/crypto/zuc/rte_zuc_pmd.c
drivers/event/dpaa2/Makefile
drivers/event/dpaa2/dpaa2_eventdev.c
drivers/event/octeontx/Makefile
drivers/event/octeontx/ssovf_evdev.c
drivers/event/skeleton/Makefile
drivers/event/skeleton/skeleton_eventdev.c
drivers/event/sw/Makefile
drivers/event/sw/sw_evdev.c
drivers/net/af_packet/Makefile
drivers/net/af_packet/rte_eth_af_packet.c
drivers/net/bonding/Makefile
drivers/net/bonding/rte_eth_bond_api.c
drivers/net/bonding/rte_eth_bond_pmd.c
drivers/net/failsafe/Makefile
drivers/net/failsafe/failsafe.c
drivers/net/kni/Makefile
drivers/net/kni/rte_eth_kni.c
drivers/net/mrvl/Makefile
drivers/net/mrvl/mrvl_ethdev.c
drivers/net/null/Makefile
drivers/net/null/rte_eth_null.c
drivers/net/octeontx/Makefile
drivers/net/octeontx/octeontx_ethdev.c
drivers/net/pcap/Makefile
drivers/net/pcap/rte_eth_pcap.c
drivers/net/ring/Makefile
drivers/net/ring/rte_eth_ring.c
drivers/net/softnic/Makefile
drivers/net/softnic/rte_eth_softnic.c
drivers/net/tap/Makefile
drivers/net/tap/rte_eth_tap.c
drivers/net/vhost/Makefile
drivers/net/vhost/rte_eth_vhost.c
drivers/net/virtio/Makefile
drivers/net/virtio/virtio_user_ethdev.c
lib/librte_eal/bsdapp/eal/Makefile
lib/librte_eal/common/Makefile
lib/librte_eal/common/eal_common_vdev.c [deleted file]
lib/librte_eal/common/include/rte_dev.h
lib/librte_eal/common/include/rte_vdev.h [deleted file]
lib/librte_eal/linuxapp/eal/Makefile
lib/librte_eal/rte_eal_version.map
lib/librte_ether/rte_ethdev_vdev.h
lib/librte_eventdev/rte_eventdev_pmd_vdev.h
mk/rte.app.mk
test/test/test_cryptodev.c
test/test/test_event_eth_rx_adapter.c
test/test/test_eventdev.c
test/test/test_eventdev_octeontx.c
test/test/test_eventdev_sw.c
test/test/test_link_bonding_rssconf.c

index 8ab08d2fc0f6b774532d70981e79f78764c938c3..98f51123cb55e0320d56ea5a85680d93b9efd79c 100644 (file)
@@ -293,6 +293,9 @@ Bus Drivers
 PCI bus driver
 F: drivers/bus/pci/
 
+VDEV bus driver
+F: drivers/bus/vdev/
+
 
 Networking Drivers
 ------------------
index 82ee75456d6888ed7221cb526baff4bf9cc6b71a..9ae5ec30f18e0290e805bfc98b967a339ff7416a 100644 (file)
@@ -157,6 +157,11 @@ CONFIG_RTE_ETHDEV_TX_PREPARE_NOOP=n
 #
 CONFIG_RTE_LIBRTE_PCI_BUS=y
 
+#
+# Compile the vdev bus
+#
+CONFIG_RTE_LIBRTE_VDEV_BUS=y
+
 #
 # Compile burst-oriented Amazon ENA PMD driver
 #
index f8c7f2392af24bbb4e4a7218ccfaa179a74427b5..2ea963c9681806949a5319d40cb1eeb95b83e3d3 100644 (file)
@@ -379,6 +379,14 @@ API Changes
   These functions are made available either as part of ``librte_pci`` or
   ``librte_bus_pci``.
 
+* **Moved vdev bus APIs outside of the EAL**
+
+  Moved the following APIs from ``librte_eal`` to ``librte_bus_vdev``:
+  * ``rte_vdev_init``
+  * ``rte_vdev_register``
+  * ``rte_vdev_uninit``
+  * ``rte_vdev_unregister``
+
 * **Add return value to stats_get dev op API**
 
   The ``stats_get`` dev op API return value has been changed to be int.
@@ -491,6 +499,7 @@ The libraries prepended with a plus sign were incremented in this version.
 
      librte_acl.so.2
    + librte_bitratestats.so.2
+   + librte_bus_vdev.so.1
      librte_cfgfile.so.2
      librte_cmdline.so.2
    + librte_cryptodev.so.4
index e3fbc50821ba05957a46cfc2fcde23e28979775d..c20beb438781cf3fd5a42543a61081982a5c22d0 100644 (file)
@@ -33,5 +33,6 @@ include $(RTE_SDK)/mk/rte.vars.mk
 DIRS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += dpaa
 DIRS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += fslmc
 DIRS-$(CONFIG_RTE_LIBRTE_PCI_BUS) += pci
+DIRS-$(CONFIG_RTE_LIBRTE_VDEV_BUS) += vdev
 
 include $(RTE_SDK)/mk/rte.subdir.mk
diff --git a/drivers/bus/vdev/Makefile b/drivers/bus/vdev/Makefile
new file mode 100644 (file)
index 0000000..84bd724
--- /dev/null
@@ -0,0 +1,57 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   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 $(RTE_SDK)/mk/rte.vars.mk
+
+#
+# library name
+#
+LIB = librte_bus_vdev.a
+
+CFLAGS += -O3
+CFLAGS += $(WERROR_FLAGS)
+
+# versioning export map
+EXPORT_MAP := rte_bus_vdev_version.map
+
+# library version
+LIBABIVER := 1
+
+SRCS-y += vdev.c
+
+LDLIBS += -lrte_eal
+
+#
+# Export include files
+#
+SYMLINK-y-include += rte_bus_vdev.h
+
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/bus/vdev/rte_bus_vdev.h b/drivers/bus/vdev/rte_bus_vdev.h
new file mode 100644 (file)
index 0000000..41762b8
--- /dev/null
@@ -0,0 +1,153 @@
+/*-
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2016 RehiveTech. 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 RehiveTech 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
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <sys/queue.h>
+#include <rte_dev.h>
+#include <rte_devargs.h>
+
+struct rte_vdev_device {
+       TAILQ_ENTRY(rte_vdev_device) next;      /**< Next attached vdev */
+       struct rte_device device;               /**< Inherit core device */
+};
+
+/**
+ * @internal
+ * Helper macro for drivers that need to convert to struct rte_vdev_device.
+ */
+#define RTE_DEV_TO_VDEV(ptr) \
+       container_of(ptr, struct rte_vdev_device, device)
+
+static inline const char *
+rte_vdev_device_name(const struct rte_vdev_device *dev)
+{
+       if (dev && dev->device.name)
+               return dev->device.name;
+       return NULL;
+}
+
+static inline const char *
+rte_vdev_device_args(const struct rte_vdev_device *dev)
+{
+       if (dev && dev->device.devargs)
+               return dev->device.devargs->args;
+       return "";
+}
+
+/** Double linked list of virtual device drivers. */
+TAILQ_HEAD(vdev_driver_list, rte_vdev_driver);
+
+/**
+ * Probe function called for each virtual device driver once.
+ */
+typedef int (rte_vdev_probe_t)(struct rte_vdev_device *dev);
+
+/**
+ * Remove function called for each virtual device driver once.
+ */
+typedef int (rte_vdev_remove_t)(struct rte_vdev_device *dev);
+
+/**
+ * A virtual device driver abstraction.
+ */
+struct rte_vdev_driver {
+       TAILQ_ENTRY(rte_vdev_driver) next; /**< Next in list. */
+       struct rte_driver driver;      /**< Inherited general driver. */
+       rte_vdev_probe_t *probe;       /**< Virtual device probe function. */
+       rte_vdev_remove_t *remove;     /**< Virtual device remove function. */
+};
+
+/**
+ * Register a virtual device driver.
+ *
+ * @param driver
+ *   A pointer to a rte_vdev_driver structure describing the driver
+ *   to be registered.
+ */
+void rte_vdev_register(struct rte_vdev_driver *driver);
+
+/**
+ * Unregister a virtual device driver.
+ *
+ * @param driver
+ *   A pointer to a rte_vdev_driver structure describing the driver
+ *   to be unregistered.
+ */
+void rte_vdev_unregister(struct rte_vdev_driver *driver);
+
+#define RTE_PMD_REGISTER_VDEV(nm, vdrv)\
+RTE_INIT(vdrvinitfn_ ##vdrv);\
+static const char *vdrvinit_ ## nm ## _alias;\
+static void vdrvinitfn_ ##vdrv(void)\
+{\
+       (vdrv).driver.name = RTE_STR(nm);\
+       (vdrv).driver.alias = vdrvinit_ ## nm ## _alias;\
+       rte_vdev_register(&vdrv);\
+} \
+RTE_PMD_EXPORT_NAME(nm, __COUNTER__)
+
+#define RTE_PMD_REGISTER_ALIAS(nm, alias)\
+static const char *vdrvinit_ ## nm ## _alias = RTE_STR(alias)
+
+/**
+ * Initialize a driver specified by name.
+ *
+ * @param name
+ *   The pointer to a driver name to be initialized.
+ * @param args
+ *   The pointer to arguments used by driver initialization.
+ * @return
+ *  0 on success, negative on error
+ */
+int rte_vdev_init(const char *name, const char *args);
+
+/**
+ * Uninitalize a driver specified by name.
+ *
+ * @param name
+ *   The pointer to a driver name to be initialized.
+ * @return
+ *  0 on success, negative on error
+ */
+int rte_vdev_uninit(const char *name);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/drivers/bus/vdev/rte_bus_vdev_version.map b/drivers/bus/vdev/rte_bus_vdev_version.map
new file mode 100644 (file)
index 0000000..707b870
--- /dev/null
@@ -0,0 +1,10 @@
+DPDK_17.11 {
+       global:
+
+       rte_vdev_init;
+       rte_vdev_register;
+       rte_vdev_uninit;
+       rte_vdev_unregister;
+
+       local: *;
+};
diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
new file mode 100644 (file)
index 0000000..04ed49b
--- /dev/null
@@ -0,0 +1,344 @@
+/*-
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2016 RehiveTech. 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 RehiveTech 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 <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <sys/queue.h>
+
+#include <rte_eal.h>
+#include <rte_dev.h>
+#include <rte_bus.h>
+#include <rte_common.h>
+#include <rte_devargs.h>
+#include <rte_memory.h>
+#include <rte_errno.h>
+
+#include "rte_bus_vdev.h"
+
+/* Forward declare to access virtual bus name */
+static struct rte_bus rte_vdev_bus;
+
+/** Double linked list of virtual device drivers. */
+TAILQ_HEAD(vdev_device_list, rte_vdev_device);
+
+static struct vdev_device_list vdev_device_list =
+       TAILQ_HEAD_INITIALIZER(vdev_device_list);
+struct vdev_driver_list vdev_driver_list =
+       TAILQ_HEAD_INITIALIZER(vdev_driver_list);
+
+/* register a driver */
+void
+rte_vdev_register(struct rte_vdev_driver *driver)
+{
+       TAILQ_INSERT_TAIL(&vdev_driver_list, driver, next);
+}
+
+/* unregister a driver */
+void
+rte_vdev_unregister(struct rte_vdev_driver *driver)
+{
+       TAILQ_REMOVE(&vdev_driver_list, driver, next);
+}
+
+static int
+vdev_parse(const char *name, void *addr)
+{
+       struct rte_vdev_driver **out = addr;
+       struct rte_vdev_driver *driver = NULL;
+
+       TAILQ_FOREACH(driver, &vdev_driver_list, next) {
+               if (strncmp(driver->driver.name, name,
+                           strlen(driver->driver.name)) == 0)
+                       break;
+               if (driver->driver.alias &&
+                   strncmp(driver->driver.alias, name,
+                           strlen(driver->driver.alias)) == 0)
+                       break;
+       }
+       if (driver != NULL &&
+           addr != NULL)
+               *out = driver;
+       return driver == NULL;
+}
+
+static int
+vdev_probe_all_drivers(struct rte_vdev_device *dev)
+{
+       const char *name;
+       struct rte_vdev_driver *driver;
+       int ret;
+
+       name = rte_vdev_device_name(dev);
+
+       RTE_LOG(DEBUG, EAL, "Search driver %s to probe device %s\n", name,
+               rte_vdev_device_name(dev));
+
+       if (vdev_parse(name, &driver))
+               return -1;
+       dev->device.driver = &driver->driver;
+       ret = driver->probe(dev);
+       if (ret)
+               dev->device.driver = NULL;
+       return ret;
+}
+
+static struct rte_vdev_device *
+find_vdev(const char *name)
+{
+       struct rte_vdev_device *dev;
+
+       if (!name)
+               return NULL;
+
+       TAILQ_FOREACH(dev, &vdev_device_list, next) {
+               const char *devname = rte_vdev_device_name(dev);
+
+               if (!strncmp(devname, name, strlen(name)))
+                       return dev;
+       }
+
+       return NULL;
+}
+
+static struct rte_devargs *
+alloc_devargs(const char *name, const char *args)
+{
+       struct rte_devargs *devargs;
+       int ret;
+
+       devargs = calloc(1, sizeof(*devargs));
+       if (!devargs)
+               return NULL;
+
+       devargs->bus = &rte_vdev_bus;
+       if (args)
+               devargs->args = strdup(args);
+       else
+               devargs->args = strdup("");
+
+       ret = snprintf(devargs->name, sizeof(devargs->name), "%s", name);
+       if (ret < 0 || ret >= (int)sizeof(devargs->name)) {
+               free(devargs->args);
+               free(devargs);
+               return NULL;
+       }
+
+       return devargs;
+}
+
+int
+rte_vdev_init(const char *name, const char *args)
+{
+       struct rte_vdev_device *dev;
+       struct rte_devargs *devargs;
+       int ret;
+
+       if (name == NULL)
+               return -EINVAL;
+
+       dev = find_vdev(name);
+       if (dev)
+               return -EEXIST;
+
+       devargs = alloc_devargs(name, args);
+       if (!devargs)
+               return -ENOMEM;
+
+       dev = calloc(1, sizeof(*dev));
+       if (!dev) {
+               ret = -ENOMEM;
+               goto fail;
+       }
+
+       dev->device.devargs = devargs;
+       dev->device.numa_node = SOCKET_ID_ANY;
+       dev->device.name = devargs->name;
+
+       ret = vdev_probe_all_drivers(dev);
+       if (ret) {
+               if (ret > 0)
+                       RTE_LOG(ERR, EAL, "no driver found for %s\n", name);
+               goto fail;
+       }
+
+       TAILQ_INSERT_TAIL(&devargs_list, devargs, next);
+
+       TAILQ_INSERT_TAIL(&vdev_device_list, dev, next);
+       return 0;
+
+fail:
+       free(devargs->args);
+       free(devargs);
+       free(dev);
+       return ret;
+}
+
+static int
+vdev_remove_driver(struct rte_vdev_device *dev)
+{
+       const char *name = rte_vdev_device_name(dev);
+       const struct rte_vdev_driver *driver;
+
+       if (!dev->device.driver) {
+               RTE_LOG(DEBUG, EAL, "no driver attach to device %s\n", name);
+               return 1;
+       }
+
+       driver = container_of(dev->device.driver, const struct rte_vdev_driver,
+               driver);
+       return driver->remove(dev);
+}
+
+int
+rte_vdev_uninit(const char *name)
+{
+       struct rte_vdev_device *dev;
+       struct rte_devargs *devargs;
+       int ret;
+
+       if (name == NULL)
+               return -EINVAL;
+
+       dev = find_vdev(name);
+       if (!dev)
+               return -ENOENT;
+
+       devargs = dev->device.devargs;
+
+       ret = vdev_remove_driver(dev);
+       if (ret)
+               return ret;
+
+       TAILQ_REMOVE(&vdev_device_list, dev, next);
+
+       TAILQ_REMOVE(&devargs_list, devargs, next);
+
+       free(devargs->args);
+       free(devargs);
+       free(dev);
+       return 0;
+}
+
+static int
+vdev_scan(void)
+{
+       struct rte_vdev_device *dev;
+       struct rte_devargs *devargs;
+
+       /* for virtual devices we scan the devargs_list populated via cmdline */
+       TAILQ_FOREACH(devargs, &devargs_list, next) {
+
+               if (devargs->bus != &rte_vdev_bus)
+                       continue;
+
+               dev = find_vdev(devargs->name);
+               if (dev)
+                       continue;
+
+               dev = calloc(1, sizeof(*dev));
+               if (!dev)
+                       return -1;
+
+               dev->device.devargs = devargs;
+               dev->device.numa_node = SOCKET_ID_ANY;
+               dev->device.name = devargs->name;
+
+               TAILQ_INSERT_TAIL(&vdev_device_list, dev, next);
+       }
+
+       return 0;
+}
+
+static int
+vdev_probe(void)
+{
+       struct rte_vdev_device *dev;
+
+       /* call the init function for each virtual device */
+       TAILQ_FOREACH(dev, &vdev_device_list, next) {
+
+               if (dev->device.driver)
+                       continue;
+
+               if (vdev_probe_all_drivers(dev)) {
+                       RTE_LOG(ERR, EAL, "failed to initialize %s device\n",
+                               rte_vdev_device_name(dev));
+                       return -1;
+               }
+       }
+
+       return 0;
+}
+
+static struct rte_device *
+vdev_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
+                const void *data)
+{
+       struct rte_vdev_device *dev;
+
+       TAILQ_FOREACH(dev, &vdev_device_list, next) {
+               if (start && &dev->device == start) {
+                       start = NULL;
+                       continue;
+               }
+               if (cmp(&dev->device, data) == 0)
+                       return &dev->device;
+       }
+       return NULL;
+}
+
+static int
+vdev_plug(struct rte_device *dev)
+{
+       return vdev_probe_all_drivers(RTE_DEV_TO_VDEV(dev));
+}
+
+static int
+vdev_unplug(struct rte_device *dev)
+{
+       return rte_vdev_uninit(dev->name);
+}
+
+static struct rte_bus rte_vdev_bus = {
+       .scan = vdev_scan,
+       .probe = vdev_probe,
+       .find_device = vdev_find_device,
+       .plug = vdev_plug,
+       .unplug = vdev_unplug,
+       .parse = vdev_parse,
+};
+
+RTE_REGISTER_BUS(vdev, rte_vdev_bus);
index 44979a4a6f04f343f4c5e9049e0d168bb7ca031e..ddfec4c69a8f697a9b6169cd2b8ea649a8aa0a58 100644 (file)
@@ -55,6 +55,7 @@ CFLAGS += -I$(AESNI_MULTI_BUFFER_LIB_PATH)/include
 LDLIBS += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_cryptodev
+LDLIBS += -lrte_bus_vdev
 
 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += aesni_gcm_pmd.c
index 444cfa2390834d1197d4e08397e6ae95b58d243e..08dcaccef314d962af149c283840ebd4039a307b 100644 (file)
@@ -34,7 +34,7 @@
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
 #include <rte_cryptodev_pmd.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
 #include <rte_byteorder.h>
index 7c7e97086dd0d7a058a55e1bd8cd6501935478b1..a49f06f280efecf67eb2debf7023f79cc3cf9b62 100644 (file)
@@ -55,6 +55,7 @@ CFLAGS += -I$(AESNI_MULTI_BUFFER_LIB_PATH)/include
 LDLIBS += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_cryptodev
+LDLIBS += -lrte_bus_vdev
 
 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += rte_aesni_mb_pmd.c
index a58955783d1112ce83f54f0d2a135632e948552b..7004389784076c5b05b7aa123eec1e00eea89f02 100644 (file)
@@ -36,7 +36,7 @@
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
 #include <rte_cryptodev_pmd.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
 
index 8bf60e2f080aea37a8eed953976e26cc482414eb..79c260ff254db5ec1be1e8ad254bfe37ab6009e0 100644 (file)
@@ -59,6 +59,7 @@ CFLAGS += -I$(ARMV8_CRYPTO_LIB_PATH)/asm/include
 LDLIBS += -L$(ARMV8_CRYPTO_LIB_PATH) -larmv8_crypto
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_cryptodev
+LDLIBS += -lrte_bus_vdev
 
 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += rte_armv8_pmd.c
index 2d2f3ff43aae3179c7362a62743eb2b8879fa51d..97719f278e1b84de09a43e8bb851216dcd174c0f 100644 (file)
@@ -36,7 +36,7 @@
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
 #include <rte_cryptodev_pmd.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
 
index b9daf454e1dd2a6ccb295472ca52033e9759aaaa..cf56b7a0bea31174014b5c00e5fd78427cb56e00 100644 (file)
@@ -56,6 +56,7 @@ CFLAGS += -I$(LIBSSO_KASUMI_PATH)/build
 LDLIBS += -L$(LIBSSO_KASUMI_PATH)/build -lsso_kasumi
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_cryptodev
+LDLIBS += -lrte_bus_vdev
 
 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += rte_kasumi_pmd.c
index b677e543950395c1808b5b14a4f50a8861100658..f5db5e3225c9608fb8247917ffbd9b2c05171d53 100644 (file)
@@ -34,7 +34,7 @@
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
 #include <rte_cryptodev_pmd.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
 
index abf40353979dd55918049f589013e39f40a7a482..3532f7cffd24eef386957283f4813b6d6aa1cbc9 100644 (file)
@@ -57,6 +57,7 @@ EXPORT_MAP := rte_mrvl_pmd_version.map
 
 # external library dependencies
 LDLIBS += -L$(LIBMUSDK_PATH)/lib -lmusdk
+LDLIBS += -lrte_bus_vdev
 
 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += rte_mrvl_pmd.c
index f778a80fce490bfb2fca829b581e856cc618a1b2..31f3fe581ea92f9140da8aa3967c31f07b65232b 100644 (file)
@@ -36,7 +36,7 @@
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
 #include <rte_cryptodev_pmd.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
 
index b368161c35996496a44087038039a8473096a933..49ada097223ea68be94eb5297d1b1578fef849b0 100644 (file)
@@ -39,6 +39,7 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_cryptodev
+LDLIBS += -lrte_bus_vdev
 
 # library version
 LIBABIVER := 1
index 3f2a90d105645b586e09fde1ae8688b8f97c3eb3..f031d3b8831eb89be1d02ec7cf41deca54cb669d 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <rte_common.h>
 #include <rte_cryptodev_pmd.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 
 #include "null_crypto_pmd_private.h"
index 85e5d8703a7d51870d0e3d6fc12156ecad5c473a..1a006432d950c56e660df06d5b5aca7b00644fae 100644 (file)
@@ -47,6 +47,7 @@ EXPORT_MAP := rte_pmd_openssl_version.map
 LDLIBS += -lcrypto
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_cryptodev
+LDLIBS += -lrte_bus_vdev
 
 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_OPENSSL) += rte_openssl_pmd.c
index 25c1154e565034de86872efd0e5807955409235b..06e1a6defc6daaa2c260e09a0ae12fbab9478335 100644 (file)
@@ -34,7 +34,7 @@
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
 #include <rte_cryptodev_pmd.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
 
index b1a468e0abd97d9ab07f53d6efd9085b6cbb1a1b..123b0f6d0683601a37075402f74776ed984f5aac 100644 (file)
@@ -38,6 +38,7 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_cryptodev -lrte_kvargs -lrte_reorder
+LDLIBS += -lrte_bus_vdev
 
 # library version
 LIBABIVER := 1
index 40ab3044923c49b4a38569bf971a6774516c6466..acdf6361cc94826d01357ef0540c3256c576b8d0 100644 (file)
@@ -33,7 +33,7 @@
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
 #include <rte_cryptodev_pmd.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
 #include <rte_reorder.h>
index 1fb05718222cdd01e1782e71644b9075de4f8495..183c6ce9fdc10dc02bf31408aa8c5bfad7781d79 100644 (file)
@@ -56,6 +56,7 @@ CFLAGS += -I$(LIBSSO_SNOW3G_PATH)/build
 LDLIBS += -L$(LIBSSO_SNOW3G_PATH)/build -lsso_snow3g
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_cryptodev
+LDLIBS += -lrte_bus_vdev
 
 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += rte_snow3g_pmd.c
index 094ddc4eb1df4dd207cf0a70b5ceee7caaee6b71..4cc9a94fc75c9ee98f79a5697d3f6d4f5465ee46 100644 (file)
@@ -34,7 +34,7 @@
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
 #include <rte_cryptodev_pmd.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
 
index 9d03cf022aaf9891d20aa3332e32f76cc56328e1..af77bc8a792175a639da1a2736229fd7f00d57cf 100644 (file)
@@ -56,6 +56,7 @@ CFLAGS += -I$(LIBSSO_ZUC_PATH)/build
 LDLIBS += -L$(LIBSSO_ZUC_PATH)/build -lsso_zuc
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_cryptodev
+LDLIBS += -lrte_bus_vdev
 
 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += rte_zuc_pmd.c
index 5c1f71f6fc234c4924dc584b267e4fb5b6bb755c..590224bfcff4f4be6fbbf7cbd5b723e54e62267b 100644 (file)
@@ -34,7 +34,7 @@
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
 #include <rte_cryptodev_pmd.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
 
index d268e33526245f733b6ea2f015b8fd5844ad353e..f34eebfa24bce48c91dc5b057c5cda93d46c4b62 100644 (file)
@@ -46,6 +46,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa2
 CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa2
 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal
 LDLIBS += -lrte_eal -lrte_eventdev -lrte_bus_fslmc -lrte_pmd_dpaa2
+LDLIBS += -lrte_bus_vdev
 CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2
 CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2/mc
 
index a23c7344c69d0797255905709112ab0692ac5e33..eeeb231272e3812019cf12d149095255596f61a3 100644 (file)
@@ -51,7 +51,7 @@
 #include <rte_memcpy.h>
 #include <rte_memory.h>
 #include <rte_pci.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_ethdev.h>
 #include <rte_event_eth_rx_adapter.h>
 
index ae901a3d1be748b7c103fc20b4a7cb48ff6ffb8d..fdf1b7385f272aabde211bd00ac7102021e037dc 100644 (file)
@@ -43,6 +43,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/net/octeontx/
 
 LDLIBS += -lrte_eal -lrte_eventdev -lrte_mempool_octeontx
 LDLIBS += -lrte_bus_pci
+LDLIBS += -lrte_bus_vdev
 
 EXPORT_MAP := rte_pmd_octeontx_ssovf_version.map
 
index ca866ea05946d7e3db9359dd22e03c805d82a114..117b1453ef70b77494a9ee64f9c9296bb3efb03c 100644 (file)
@@ -42,7 +42,7 @@
 #include <rte_log.h>
 #include <rte_malloc.h>
 #include <rte_memory.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 
 #include "ssovf_evdev.h"
 
index 65e164150a4623145ee989a7f1d798913250ae90..a24738b1910e235f248a9d595ee08c06bd1412d7 100644 (file)
@@ -40,6 +40,7 @@ LIB = librte_pmd_skeleton_event.a
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_eventdev
 LDLIBS += -lrte_pci -lrte_bus_pci
+LDLIBS += -lrte_bus_vdev
 
 EXPORT_MAP := rte_pmd_skeleton_event_version.map
 
index a014dcf1d5f2824320e3621f3557df2c01db3324..bb554c360f12f08d8e760ef28d5c762df67eb775 100644 (file)
@@ -46,7 +46,7 @@
 #include <rte_malloc.h>
 #include <rte_memory.h>
 #include <rte_lcore.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 
 #include "skeleton_eventdev.h"
 
index 61a108c50c16271e3dee789a26eb8548c6043064..2f2b67bac5c5ad5bfc4baa641ec9790893f3ed13 100644 (file)
@@ -44,6 +44,7 @@ CFLAGS += -Wno-missing-field-initializers
 endif
 endif
 LDLIBS += -lrte_eal -lrte_eventdev -lrte_kvargs -lrte_ring
+LDLIBS += -lrte_bus_vdev
 
 # library version
 LIBABIVER := 1
index 1ba0fb65d67914ec50faf64896840151fb13d04d..fd110797b5825e4f7fd1bdd091c0322d8a196c8c 100644 (file)
@@ -33,7 +33,7 @@
 #include <inttypes.h>
 #include <string.h>
 
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_kvargs.h>
 #include <rte_ring.h>
 #include <rte_errno.h>
index b97c2a6279d8a6754fe15c75b9eb7cf68323184c..bb37d67a10213a801bbe22f0d3517af4d0c4a88c 100644 (file)
@@ -46,6 +46,7 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
+LDLIBS += -lrte_bus_vdev
 
 #
 # all source are stored in SRCS-y
index 28e6a9466ade2b6b2ddbbd86d1addb3ed24ab3c8..fa84eb9c27746a5709578b5bd6ac96bd1e8349ea 100644 (file)
@@ -41,7 +41,7 @@
 #include <rte_ethdev_vdev.h>
 #include <rte_malloc.h>
 #include <rte_kvargs.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 
 #include <linux/if_ether.h>
 #include <linux/if_packet.h>
index b86b240ba7d809ac9c543d85e9555f759d9d470d..dea1bd5c8c739362a58eba94c68b97c29922156e 100644 (file)
@@ -41,6 +41,7 @@ CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs -lrte_cmdline
 LDLIBS += -lrte_pci -lrte_bus_pci
+LDLIBS += -lrte_bus_vdev
 
 EXPORT_MAP := rte_pmd_bond_version.map
 
index 8c602f8a71bbd09db6b2dfcd7ac01c2c8a02e3b6..980e6368fd5b1d2dbc784d1deddf0359d05446bc 100644 (file)
@@ -37,7 +37,7 @@
 #include <rte_malloc.h>
 #include <rte_ethdev.h>
 #include <rte_tcp.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_kvargs.h>
 
 #include "rte_eth_bond.h"
index 53d8e98ffbdc2672b0d09fbdb285d1a27a781747..fe23289543b3dc097f0d3f34311fa9c76d0fbdc5 100644 (file)
@@ -43,7 +43,7 @@
 #include <rte_ip_frag.h>
 #include <rte_devargs.h>
 #include <rte_kvargs.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_alarm.h>
 #include <rte_cycles.h>
 
index e533d54d9817885ac737630d65416372a1d76296..ea2a8fe466b92d2243a191a51739b776f780c0fb 100644 (file)
@@ -60,5 +60,6 @@ CFLAGS += -Wno-strict-prototypes
 CFLAGS += -pedantic
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
+LDLIBS += -lrte_bus_vdev
 
 include $(RTE_SDK)/mk/rte.lib.mk
index 6006bef8de41146e8fa8ef946c2509aec4e91d04..6bc5abac813a84ac63b1e60c081790c03a853600 100644 (file)
@@ -37,7 +37,7 @@
 #include <rte_ethdev_vdev.h>
 #include <rte_devargs.h>
 #include <rte_kvargs.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 
 #include "failsafe_private.h"
 
index 00d099fd2223a5329762e8f91eee12be2d8206e4..a3f51f929a3aef21dcc12ce796c9e8792fcea8ae 100644 (file)
@@ -40,6 +40,7 @@ CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lpthread
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs -lrte_kni
+LDLIBS += -lrte_bus_vdev
 
 EXPORT_MAP := rte_pmd_kni_version.map
 
index e31b90920e4ba39a4489e45711aafe6291881dbf..8f269532d434d4e9d2f0d3c2f70449e64646bde9 100644 (file)
@@ -40,7 +40,7 @@
 #include <rte_kni.h>
 #include <rte_kvargs.h>
 #include <rte_malloc.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 
 /* Only single queue supported */
 #define KNI_MAX_QUEUE_PER_PORT 1
index a313055367a720928196fba5e7361f324f711fbd..815c3bae9206b1fde1c915a69feb688badfd447b 100644 (file)
@@ -59,6 +59,7 @@ LDLIBS += -L$(LIBMUSDK_PATH)/lib
 LDLIBS += -lmusdk
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs -lrte_cfgfile
+LDLIBS += -lrte_bus_vdev
 
 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_MRVL_PMD) += mrvl_ethdev.c
index a897ba01368efa27f5c20657bb85b7cace2601a0..29361652886a8ba980415494452c8d162f2200c5 100644 (file)
@@ -36,7 +36,7 @@
 #include <rte_kvargs.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 
 /* Unluckily, container_of is defined by both DPDK and MUSDK,
  * we'll declare only one version.
index c2404f4a240fab364d06141caf5f404848167ec5..9331ccac91c185c297776487bb23b9a6fd661721 100644 (file)
@@ -40,6 +40,7 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
+LDLIBS += -lrte_bus_vdev
 
 EXPORT_MAP := rte_pmd_null_version.map
 
index 3433c9c3b4e11a255cf1fc135cb0284684d1a6ec..032c30e9dd6573f697b2733152f461c47f139395 100644 (file)
@@ -36,7 +36,7 @@
 #include <rte_ethdev_vdev.h>
 #include <rte_malloc.h>
 #include <rte_memcpy.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_kvargs.h>
 #include <rte_spinlock.h>
 
index 078fcd47e9ab5db1bf6bb83efb946c039840406a..9c27fdfe83a0daacc11574dfcef3447922178b74 100644 (file)
@@ -74,5 +74,6 @@ LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
 LDLIBS += -lrte_mempool_octeontx
 LDLIBS += -lrte_eventdev
 LDLIBS += -lrte_bus_pci
+LDLIBS += -lrte_bus_vdev
 
 include $(RTE_SDK)/mk/rte.lib.mk
index 86de5d18c9c25ce0b77a8c08196173c5d1aecf5b..bd24ec330fcee89a6eaa0bd8b1fcae001f789dc5 100644 (file)
@@ -44,7 +44,7 @@
 #include <rte_kvargs.h>
 #include <rte_malloc.h>
 #include <rte_prefetch.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 
 #include "octeontx_ethdev.h"
 #include "octeontx_rxtx.h"
index 9ea96700ab4da7c2430753896ed1b3a9d4870a43..b6487d42b0aaed811308abe91c200a2c66e112a4 100644 (file)
@@ -42,6 +42,7 @@ CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lpcap
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
+LDLIBS += -lrte_bus_vdev
 
 EXPORT_MAP := rte_pmd_pcap_version.map
 
index 3024c1e037a8acf3e7a67780afae5a37b769702b..5a86752f9401c42a57977039797a54f9025f02c9 100644 (file)
@@ -44,7 +44,7 @@
 #include <rte_kvargs.h>
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 
 #define RTE_ETH_PCAP_SNAPSHOT_LEN 65535
 #define RTE_ETH_PCAP_SNAPLEN ETHER_MAX_JUMBO_FRAME_LEN
index 9edd7d5caa3a7e62afd6bf3f9e63cf0546c0b370..085ffa57bc57a3838fe72546fb070506134ec0e7 100644 (file)
@@ -40,6 +40,7 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
+LDLIBS += -lrte_bus_vdev
 
 EXPORT_MAP := rte_pmd_ring_version.map
 
index 76355a1c7691082728773484086b88c1cc4c1219..a73c631fefe94ec5fe823ee0c5de574dac025117 100644 (file)
@@ -37,7 +37,7 @@
 #include <rte_malloc.h>
 #include <rte_memcpy.h>
 #include <rte_string_fns.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_kvargs.h>
 #include <rte_errno.h>
 
index 4b15f003cd169f0da4b1de334288803a3b1540a9..09ed62eac215e8b8481500ac097b37c55292c005 100644 (file)
@@ -40,6 +40,7 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs -lrte_sched
+LDLIBS += -lrte_bus_vdev
 
 EXPORT_MAP := rte_pmd_eth_softnic_version.map
 
index abb617a996377ff2b71ac65cf6cd9cffd3c6bda9..3e47c2f98e0ade1b6e4e844e1e51b3839d2ed157 100644 (file)
@@ -38,7 +38,7 @@
 #include <rte_ethdev.h>
 #include <rte_ethdev_vdev.h>
 #include <rte_malloc.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_kvargs.h>
 #include <rte_errno.h>
 #include <rte_ring.h>
index b5c5a35765c95005e13e556cb5d4bf6834f2cc12..405b49e4c191b951a451af6d9ab78088fa7572bf 100644 (file)
@@ -45,6 +45,7 @@ CFLAGS += -I.
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs -lrte_hash
+LDLIBS += -lrte_bus_vdev
 
 #
 # all source are stored in SRCS-y
index 64dd3b056a0dfe12abaf5662494478c18eba84b2..6b27679a8ea383463cdbfc80041b26d12ff4553a 100644 (file)
@@ -39,7 +39,7 @@
 #include <rte_ethdev.h>
 #include <rte_ethdev_vdev.h>
 #include <rte_malloc.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_kvargs.h>
 #include <rte_net.h>
 #include <rte_debug.h>
index 1085a5238f1439b0504c4c95a7d5ad03e7d2ca1a..c411745bd9420b639ffad18f910a6dc5979f7c5a 100644 (file)
@@ -39,6 +39,7 @@ LIB = librte_pmd_vhost.a
 LDLIBS += -lpthread
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs -lrte_vhost
+LDLIBS += -lrte_bus_vdev
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
index a28cc3b9a845465e7bcc3b47c4458e85c3d236e8..2536ee4a2f99eadce11e4d0d126c20593d2557cc 100644 (file)
@@ -39,7 +39,7 @@
 #include <rte_ethdev_vdev.h>
 #include <rte_malloc.h>
 #include <rte_memcpy.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_kvargs.h>
 #include <rte_vhost.h>
 #include <rte_spinlock.h>
index 32e99dae1045ce5a650104834f7ac550071b53aa..f2b5d1c3352c0a85a24441da67b279bf69cc4513 100644 (file)
@@ -41,6 +41,9 @@ CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
 LDLIBS += -lrte_bus_pci
+ifeq ($(CONFIG_RTE_VIRTIO_USER),y)
+LDLIBS += -lrte_bus_vdev
+endif
 
 EXPORT_MAP := rte_pmd_virtio_version.map
 
index 0cfa27b92389930e37210012e56b2f08fddbe068..7be57ce6606401c180fbd40788f5e6f9828902f1 100644 (file)
@@ -40,7 +40,7 @@
 #include <rte_malloc.h>
 #include <rte_kvargs.h>
 #include <rte_ethdev_vdev.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_alarm.h>
 
 #include "virtio_ethdev.h"
index eb94f3efb1ca98ed71e30f8569b464a193b427c5..afa117de4eb32d21d91c8b6abc86cf21b0fc4237 100644 (file)
@@ -67,7 +67,6 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_timer.c
 SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_memzone.c
 SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_log.c
 SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_launch.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_vdev.c
 SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_memory.c
 SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_tailqs.c
 SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_errno.c
index 16a2f268abfb1eaa562af43c2e15222358eae067..9effd0d45249442aeac1a78692f681899c9716e3 100644 (file)
@@ -39,7 +39,7 @@ INC += rte_per_lcore.h rte_random.h
 INC += rte_tailq.h rte_interrupts.h rte_alarm.h
 INC += rte_string_fns.h rte_version.h
 INC += rte_eal_memconfig.h rte_malloc_heap.h
-INC += rte_hexdump.h rte_devargs.h rte_bus.h rte_dev.h rte_vdev.h
+INC += rte_hexdump.h rte_devargs.h rte_bus.h rte_dev.h
 INC += rte_pci_dev_feature_defs.h rte_pci_dev_features.h
 INC += rte_malloc.h rte_keepalive.h rte_time.h
 INC += rte_service.h rte_service_component.h
diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c
deleted file mode 100644 (file)
index f7e547a..0000000
+++ /dev/null
@@ -1,342 +0,0 @@
-/*-
- *   BSD LICENSE
- *
- *   Copyright(c) 2016 RehiveTech. 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 RehiveTech 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 <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <stdbool.h>
-#include <sys/queue.h>
-
-#include <rte_eal.h>
-#include <rte_dev.h>
-#include <rte_bus.h>
-#include <rte_vdev.h>
-#include <rte_common.h>
-#include <rte_devargs.h>
-#include <rte_memory.h>
-#include <rte_errno.h>
-
-/* Forward declare to access virtual bus name */
-static struct rte_bus rte_vdev_bus;
-
-/** Double linked list of virtual device drivers. */
-TAILQ_HEAD(vdev_device_list, rte_vdev_device);
-
-static struct vdev_device_list vdev_device_list =
-       TAILQ_HEAD_INITIALIZER(vdev_device_list);
-struct vdev_driver_list vdev_driver_list =
-       TAILQ_HEAD_INITIALIZER(vdev_driver_list);
-
-/* register a driver */
-void
-rte_vdev_register(struct rte_vdev_driver *driver)
-{
-       TAILQ_INSERT_TAIL(&vdev_driver_list, driver, next);
-}
-
-/* unregister a driver */
-void
-rte_vdev_unregister(struct rte_vdev_driver *driver)
-{
-       TAILQ_REMOVE(&vdev_driver_list, driver, next);
-}
-
-static int
-vdev_parse(const char *name, void *addr)
-{
-       struct rte_vdev_driver **out = addr;
-       struct rte_vdev_driver *driver = NULL;
-
-       TAILQ_FOREACH(driver, &vdev_driver_list, next) {
-               if (strncmp(driver->driver.name, name,
-                           strlen(driver->driver.name)) == 0)
-                       break;
-               if (driver->driver.alias &&
-                   strncmp(driver->driver.alias, name,
-                           strlen(driver->driver.alias)) == 0)
-                       break;
-       }
-       if (driver != NULL &&
-           addr != NULL)
-               *out = driver;
-       return driver == NULL;
-}
-
-static int
-vdev_probe_all_drivers(struct rte_vdev_device *dev)
-{
-       const char *name;
-       struct rte_vdev_driver *driver;
-       int ret;
-
-       name = rte_vdev_device_name(dev);
-
-       RTE_LOG(DEBUG, EAL, "Search driver %s to probe device %s\n", name,
-               rte_vdev_device_name(dev));
-
-       if (vdev_parse(name, &driver))
-               return -1;
-       dev->device.driver = &driver->driver;
-       ret = driver->probe(dev);
-       if (ret)
-               dev->device.driver = NULL;
-       return ret;
-}
-
-static struct rte_vdev_device *
-find_vdev(const char *name)
-{
-       struct rte_vdev_device *dev;
-
-       if (!name)
-               return NULL;
-
-       TAILQ_FOREACH(dev, &vdev_device_list, next) {
-               const char *devname = rte_vdev_device_name(dev);
-               if (!strncmp(devname, name, strlen(name)))
-                       return dev;
-       }
-
-       return NULL;
-}
-
-static struct rte_devargs *
-alloc_devargs(const char *name, const char *args)
-{
-       struct rte_devargs *devargs;
-       int ret;
-
-       devargs = calloc(1, sizeof(*devargs));
-       if (!devargs)
-               return NULL;
-
-       devargs->bus = &rte_vdev_bus;
-       if (args)
-               devargs->args = strdup(args);
-       else
-               devargs->args = strdup("");
-
-       ret = snprintf(devargs->name, sizeof(devargs->name), "%s", name);
-       if (ret < 0 || ret >= (int)sizeof(devargs->name)) {
-               free(devargs->args);
-               free(devargs);
-               return NULL;
-       }
-
-       return devargs;
-}
-
-int
-rte_vdev_init(const char *name, const char *args)
-{
-       struct rte_vdev_device *dev;
-       struct rte_devargs *devargs;
-       int ret;
-
-       if (name == NULL)
-               return -EINVAL;
-
-       dev = find_vdev(name);
-       if (dev)
-               return -EEXIST;
-
-       devargs = alloc_devargs(name, args);
-       if (!devargs)
-               return -ENOMEM;
-
-       dev = calloc(1, sizeof(*dev));
-       if (!dev) {
-               ret = -ENOMEM;
-               goto fail;
-       }
-
-       dev->device.devargs = devargs;
-       dev->device.numa_node = SOCKET_ID_ANY;
-       dev->device.name = devargs->name;
-
-       ret = vdev_probe_all_drivers(dev);
-       if (ret) {
-               if (ret > 0)
-                       RTE_LOG(ERR, EAL, "no driver found for %s\n", name);
-               goto fail;
-       }
-
-       TAILQ_INSERT_TAIL(&devargs_list, devargs, next);
-
-       TAILQ_INSERT_TAIL(&vdev_device_list, dev, next);
-       return 0;
-
-fail:
-       free(devargs->args);
-       free(devargs);
-       free(dev);
-       return ret;
-}
-
-static int
-vdev_remove_driver(struct rte_vdev_device *dev)
-{
-       const char *name = rte_vdev_device_name(dev);
-       const struct rte_vdev_driver *driver;
-
-       if (!dev->device.driver) {
-               RTE_LOG(DEBUG, EAL, "no driver attach to device %s\n", name);
-               return 1;
-       }
-
-       driver = container_of(dev->device.driver, const struct rte_vdev_driver,
-               driver);
-       return driver->remove(dev);
-}
-
-int
-rte_vdev_uninit(const char *name)
-{
-       struct rte_vdev_device *dev;
-       struct rte_devargs *devargs;
-       int ret;
-
-       if (name == NULL)
-               return -EINVAL;
-
-       dev = find_vdev(name);
-       if (!dev)
-               return -ENOENT;
-
-       devargs = dev->device.devargs;
-
-       ret = vdev_remove_driver(dev);
-       if (ret)
-               return ret;
-
-       TAILQ_REMOVE(&vdev_device_list, dev, next);
-
-       TAILQ_REMOVE(&devargs_list, devargs, next);
-
-       free(devargs->args);
-       free(devargs);
-       free(dev);
-       return 0;
-}
-
-static int
-vdev_scan(void)
-{
-       struct rte_vdev_device *dev;
-       struct rte_devargs *devargs;
-
-       /* for virtual devices we scan the devargs_list populated via cmdline */
-       TAILQ_FOREACH(devargs, &devargs_list, next) {
-
-               if (devargs->bus != &rte_vdev_bus)
-                       continue;
-
-               dev = find_vdev(devargs->name);
-               if (dev)
-                       continue;
-
-               dev = calloc(1, sizeof(*dev));
-               if (!dev)
-                       return -1;
-
-               dev->device.devargs = devargs;
-               dev->device.numa_node = SOCKET_ID_ANY;
-               dev->device.name = devargs->name;
-
-               TAILQ_INSERT_TAIL(&vdev_device_list, dev, next);
-       }
-
-       return 0;
-}
-
-static int
-vdev_probe(void)
-{
-       struct rte_vdev_device *dev;
-
-       /* call the init function for each virtual device */
-       TAILQ_FOREACH(dev, &vdev_device_list, next) {
-
-               if (dev->device.driver)
-                       continue;
-
-               if (vdev_probe_all_drivers(dev)) {
-                       RTE_LOG(ERR, EAL, "failed to initialize %s device\n",
-                               rte_vdev_device_name(dev));
-                       return -1;
-               }
-       }
-
-       return 0;
-}
-
-static struct rte_device *
-vdev_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
-                const void *data)
-{
-       struct rte_vdev_device *dev;
-
-       TAILQ_FOREACH(dev, &vdev_device_list, next) {
-               if (start && &dev->device == start) {
-                       start = NULL;
-                       continue;
-               }
-               if (cmp(&dev->device, data) == 0)
-                       return &dev->device;
-       }
-       return NULL;
-}
-
-static int
-vdev_plug(struct rte_device *dev)
-{
-       return vdev_probe_all_drivers(RTE_DEV_TO_VDEV(dev));
-}
-
-static int
-vdev_unplug(struct rte_device *dev)
-{
-       return rte_vdev_uninit(dev->name);
-}
-
-static struct rte_bus rte_vdev_bus = {
-       .scan = vdev_scan,
-       .probe = vdev_probe,
-       .find_device = vdev_find_device,
-       .plug = vdev_plug,
-       .unplug = vdev_unplug,
-       .parse = vdev_parse,
-};
-
-RTE_REGISTER_BUS(vdev, rte_vdev_bus);
index c3f72464df8184b7e57f27ad2f4cce3dd9405d16..9342e0cbd2ed99dcab711c8c9cbb09b484d01ac2 100644 (file)
@@ -168,28 +168,6 @@ struct rte_device {
        struct rte_devargs *devargs;  /**< Device user arguments */
 };
 
-/**
- * Initialize a driver specified by name.
- *
- * @param name
- *   The pointer to a driver name to be initialized.
- * @param args
- *   The pointer to arguments used by driver initialization.
- * @return
- *  0 on success, negative on error
- */
-int rte_vdev_init(const char *name, const char *args);
-
-/**
- * Uninitalize a driver specified by name.
- *
- * @param name
- *   The pointer to a driver name to be initialized.
- * @return
- *  0 on success, negative on error
- */
-int rte_vdev_uninit(const char *name);
-
 /**
  * Attach a device to a registered driver.
  *
@@ -315,4 +293,4 @@ __attribute__((used)) = str
 }
 #endif
 
-#endif /* _RTE_VDEV_H_ */
+#endif /* _RTE_DEV_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 (file)
index 29f5a52..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*-
- *   BSD LICENSE
- *
- *   Copyright(c) 2016 RehiveTech. 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 RehiveTech 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
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <sys/queue.h>
-#include <rte_dev.h>
-#include <rte_devargs.h>
-
-struct rte_vdev_device {
-       TAILQ_ENTRY(rte_vdev_device) next;      /**< Next attached vdev */
-       struct rte_device device;               /**< Inherit core device */
-};
-
-/**
- * @internal
- * Helper macro for drivers that need to convert to struct rte_vdev_device.
- */
-#define RTE_DEV_TO_VDEV(ptr) \
-       container_of(ptr, struct rte_vdev_device, device)
-
-static inline const char *
-rte_vdev_device_name(const struct rte_vdev_device *dev)
-{
-       if (dev && dev->device.name)
-               return dev->device.name;
-       return NULL;
-}
-
-static inline const char *
-rte_vdev_device_args(const struct rte_vdev_device *dev)
-{
-       if (dev && dev->device.devargs)
-               return dev->device.devargs->args;
-       return "";
-}
-
-/** Double linked list of virtual device drivers. */
-TAILQ_HEAD(vdev_driver_list, rte_vdev_driver);
-
-/**
- * Probe function called for each virtual device driver once.
- */
-typedef int (rte_vdev_probe_t)(struct rte_vdev_device *dev);
-
-/**
- * Remove function called for each virtual device driver once.
- */
-typedef int (rte_vdev_remove_t)(struct rte_vdev_device *dev);
-
-/**
- * A virtual device driver abstraction.
- */
-struct rte_vdev_driver {
-       TAILQ_ENTRY(rte_vdev_driver) next; /**< Next in list. */
-       struct rte_driver driver;      /**< Inherited general driver. */
-       rte_vdev_probe_t *probe;       /**< Virtual device probe function. */
-       rte_vdev_remove_t *remove;     /**< Virtual device remove function. */
-};
-
-/**
- * Register a virtual device driver.
- *
- * @param driver
- *   A pointer to a rte_vdev_driver structure describing the driver
- *   to be registered.
- */
-void rte_vdev_register(struct rte_vdev_driver *driver);
-
-/**
- * Unregister a virtual device driver.
- *
- * @param driver
- *   A pointer to a rte_vdev_driver structure describing the driver
- *   to be unregistered.
- */
-void rte_vdev_unregister(struct rte_vdev_driver *driver);
-
-#define RTE_PMD_REGISTER_VDEV(nm, vdrv)\
-RTE_INIT(vdrvinitfn_ ##vdrv);\
-static const char *vdrvinit_ ## nm ## _alias;\
-static void vdrvinitfn_ ##vdrv(void)\
-{\
-       (vdrv).driver.name = RTE_STR(nm);\
-       (vdrv).driver.alias = vdrvinit_ ## nm ## _alias;\
-       rte_vdev_register(&vdrv);\
-} \
-RTE_PMD_EXPORT_NAME(nm, __COUNTER__)
-
-#define RTE_PMD_REGISTER_ALIAS(nm, alias)\
-static const char *vdrvinit_ ## nm ## _alias = RTE_STR(alias)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
index 919d3716b6f1d1928b9051b3091fb61d2582228a..5a7b8b2ac530fe0cea8579f14fc497d746950f9c 100644 (file)
@@ -74,7 +74,6 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_timer.c
 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_memzone.c
 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_log.c
 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_launch.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_vdev.c
 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_memory.c
 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_tailqs.c
 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_errno.c
index 5521d019dcc32c63f3dc382b6b1530d8018376c6..f4f46c1be8b739909151ceeb74a68a6c026e8f2c 100644 (file)
@@ -163,10 +163,6 @@ DPDK_17.05 {
        rte_log_set_global_level;
        rte_log_set_level;
        rte_log_set_level_regexp;
-       rte_vdev_init;
-       rte_vdev_register;
-       rte_vdev_uninit;
-       rte_vdev_unregister;
        vfio_get_container_fd;
        vfio_get_group_fd;
        vfio_get_group_no;
index 4d2c3e2bed028532322333f8e3d8681ec1d086aa..ff92e6ed0ee2999d94f0c1a9beed490b5099c61f 100644 (file)
@@ -35,7 +35,7 @@
 #define _RTE_ETHDEV_VDEV_H_
 
 #include <rte_malloc.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 #include <rte_ethdev.h>
 
 /**
index 135e8b803915675fffd137cea29ae4aeca7233d1..56232dec4f5f87fd9092439e6e3b14ed331f1ffd 100644 (file)
@@ -48,7 +48,7 @@ extern "C" {
 
 #include <rte_debug.h>
 #include <rte_eal.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 
 #include "rte_eventdev_pmd.h"
 
index 047121d40bdf0d223cb2ca9faec9082920a6e678..6a6a7452e2f9d1e328faaaaa842d54b69c17bf91 100644 (file)
@@ -110,6 +110,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_KNI)            += -lrte_kni
 endif
 
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PCI_BUS)        += -lrte_bus_pci
+_LDLIBS-$(CONFIG_RTE_LIBRTE_VDEV_BUS)       += -lrte_bus_vdev
 
 ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
 # plugins (link only if static libraries)
index 060b49826257c00096f721546322cb3b35062e79..1bed65dadf904e3519e0ce4c950ca79396bc0ecd 100644 (file)
@@ -36,6 +36,7 @@
 #include <rte_malloc.h>
 #include <rte_memcpy.h>
 #include <rte_pause.h>
+#include <rte_bus_vdev.h>
 
 #include <rte_crypto.h>
 #include <rte_cryptodev.h>
index 56ed1f85ade1b8dbc64b7c07a90a64552bf371e7..90a5c646ee9292eca57e30f7d5bd9dff49d5ca43 100644 (file)
@@ -35,6 +35,7 @@
 #include <rte_mbuf.h>
 #include <rte_ethdev.h>
 #include <rte_eventdev.h>
+#include <rte_bus_vdev.h>
 
 #include <rte_event_eth_rx_adapter.h>
 
index 4118b75b8d608befd1c9370d82e796faf3db1974..ba39cbac8fff4d814af46fe9e0b055288a9bc0ac 100644 (file)
@@ -37,6 +37,7 @@
 #include <rte_memcpy.h>
 #include <rte_eventdev.h>
 #include <rte_dev.h>
+#include <rte_bus_vdev.h>
 
 #include "test.h"
 
index b88b0d2540c6a44b363d53146499a600fb747a78..dbc36d9480c59720dd2657542716a3a41091e76f 100644 (file)
@@ -45,6 +45,7 @@
 #include <rte_lcore.h>
 #include <rte_per_lcore.h>
 #include <rte_random.h>
+#include <rte_bus_vdev.h>
 
 #include "test.h"
 
index 01aa4d988891279cae0c35c4c3665aebf665ee0c..f524b6f81a903383c7b127b62fc93cd4adae422f 100644 (file)
@@ -50,6 +50,7 @@
 #include <rte_pause.h>
 #include <rte_service.h>
 #include <rte_service_component.h>
+#include <rte_bus_vdev.h>
 
 #include "test.h"
 
index 7dccc6e12736fae44edcb564059d8befcd381dc7..54cbf12852245e77606d3ea53bf8bf5fbd9ed358 100644 (file)
@@ -48,6 +48,7 @@
 #include <rte_log.h>
 #include <rte_lcore.h>
 #include <rte_memory.h>
+#include <rte_bus_vdev.h>
 
 #include <rte_string_fns.h>
 #include <rte_errno.h>