[dpdk-dev] [PATCH v6 09/22] vdev: implement plug operation
Gaetan Rivet
gaetan.rivet at 6wind.com
Fri Jul 7 02:09:16 CEST 2017
Signed-off-by: Gaetan Rivet <gaetan.rivet at 6wind.com>
---
lib/librte_eal/common/eal_common_vdev.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c
index 517a9f3..5f1c224 100644
--- a/lib/librte_eal/common/eal_common_vdev.c
+++ b/lib/librte_eal/common/eal_common_vdev.c
@@ -356,12 +356,14 @@ vdev_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
}
static int
+vdev_plug(struct rte_device *dev, const char *args __rte_unused)
+{
+ return vdev_probe_all_drivers(RTE_DEV_TO_VDEV(dev));
+}
+
+static int
vdev_unplug(struct rte_device *dev)
{
- /*
- * The virtual bus doesn't support 'unattached' devices so this is
- * actually equal to hotplugging removal of it.
- */
return rte_vdev_uninit(dev->name);
}
@@ -369,7 +371,7 @@ static struct rte_bus rte_vdev_bus = {
.scan = vdev_scan,
.probe = vdev_probe,
.find_device = vdev_find_device,
- /* .plug = NULL, see comment on vdev_unplug */
+ .plug = vdev_plug,
.unplug = vdev_unplug,
.parse = vdev_parse,
};
--
2.1.4
More information about the dev
mailing list