From: Stephen Hemminger, Thursday, January 18, 2018 8:26 PM > On Thu, 18 Jan 2018 08:43:43 +0000 > Matan Azrad <ma...@mellanox.com> wrote: > > > + > > +/** > > + * Alarm callback that regularly probes system network interfaces. > > + * > > + * This callback runs at a frequency determined by > > +VDEV_NETVSC_PROBE_MS as > > + * long as an vdev_netvsc context instance exists. > > + * > > + * @param arg > > + * Ignored. > > + */ > > +static void > > +vdev_netvsc_alarm(__rte_unused void *arg) { > > + struct vdev_netvsc_ctx *ctx; > > + int ret; > > + > > + LIST_FOREACH(ctx, &vdev_netvsc_ctx_list, entry) { > > + ret = > vdev_netvsc_foreach_iface(vdev_netvsc_device_probe, ctx); > > + if (ret) > > + break; > > + } > > + if (!vdev_netvsc_ctx_count) > > + return; > > + ret = rte_eal_alarm_set(VDEV_NETVSC_PROBE_MS * 1000, > > + vdev_netvsc_alarm, NULL); > > + if (ret < 0) { > > + DRV_LOG(ERR, "unable to reschedule alarm callback: %s", > > + rte_strerror(-ret)); > > + } > > +} > > + > > Not a fan of polling for network interface changes. > Alarms in core code make life difficult for applications. >
What is the connection to application? It is netvsc driver alarm. > Also, at least on current Azure infrastructure hotplug of netvsc devices is > not > supported. > It detects the PCI device hotplug, no netvsc device. > Can we just wait until proper hotplug API from kernel (ie read netlink > uevent) is done? Why?