[dpdk-dev] [PATCH v4 5/8] net/vdev_netvsc: implement core functionality

Stephen Hemminger stephen at networkplumber.org
Thu Jan 18 19:25:39 CET 2018


On Thu, 18 Jan 2018 08:43:43 +0000
Matan Azrad <matan at 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.

Also, at least on current Azure infrastructure hotplug of netvsc devices
is not supported.

Can we just wait until proper hotplug API from kernel (ie read netlink uevent)
is done?


More information about the dev mailing list