From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v4 5/8] net/vdev_netvsc: implement core functionality Date: Thu, 18 Jan 2018 10:25:39 -0800 Message-ID: <20180118102539.02da1cff@xeon-e3> References: <1515509253-17834-1-git-send-email-matan@mellanox.com> <1516265026-6469-1-git-send-email-matan@mellanox.com> <1516265026-6469-6-git-send-email-matan@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Ferruh Yigit , Thomas Monjalon , dev@dpdk.org, Adrien Mazarguil To: Matan Azrad Return-path: Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by dpdk.org (Postfix) with ESMTP id 97F4D1B360 for ; Thu, 18 Jan 2018 19:25:47 +0100 (CET) Received: by mail-pg0-f68.google.com with SMTP id r19so9187818pgn.1 for ; Thu, 18 Jan 2018 10:25:47 -0800 (PST) In-Reply-To: <1516265026-6469-6-git-send-email-matan@mellanox.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, 18 Jan 2018 08:43:43 +0000 Matan Azrad 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?