[RFC,2/3] net/vdev_netvsc: automatically enable hotplug support
Checks
Commit Message
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(+)
@@ -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);