[RFC,2/3] net/vdev_netvsc: automatically enable hotplug support
diff mbox series

Message ID 20200508035906.18359-3-stephen@networkplumber.org
State New
Delegated to: Thomas Monjalon
Headers show
Series
  • Auto enable hotplug with netvsc devices
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger May 8, 2020, 3:59 a.m. UTC
In Hyper-V/Azure with accelerated networking the VF device
maybe added or removed at anytime. Automatically enable hotplug
support (in case application has forgot to).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/vdev_netvsc/vdev_netvsc.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch
diff mbox series

diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c
index 9ed74a1d6a2e..f99909ad800f 100644
--- a/drivers/net/vdev_netvsc/vdev_netvsc.c
+++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
@@ -729,6 +729,7 @@  vdev_netvsc_vdev_probe(struct rte_vdev_device *dev)
 	if (kvargs)
 		rte_kvargs_free(kvargs);
 	++vdev_netvsc_ctx_inst;
+	rte_dev_event_monitor_start();
 	return 0;
 }
 
@@ -749,7 +750,10 @@  vdev_netvsc_vdev_remove(__rte_unused struct rte_vdev_device *dev)
 {
 	if (--vdev_netvsc_ctx_inst)
 		return 0;
+
 	rte_eal_alarm_cancel(vdev_netvsc_alarm, NULL);
+	rte_dev_event_monitor_stop();
+
 	while (!LIST_EMPTY(&vdev_netvsc_ctx_list)) {
 		struct vdev_netvsc_ctx *ctx = LIST_FIRST(&vdev_netvsc_ctx_list);