From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vb6PRffpsrzWQQ3477UFY1Hy8/7wqBfJY9TayuYCh/I=; b=dQkCKv+dSM82QPyviTO4n22KoMihbiWRceBHwBxTloyO6uUtz4LL64YYqOJGl93H0j yUQxzNZdLk/7/fKpQ1j0BmpmDMrkbfs7mBC/HNSOY3H6ZmiEPEe3lJx1OFBJVGKICa/f qKKK3XsQF2Ogefu5nTYsSyNO62MRljcRBfSf6B88fQrhZwD//6v1sxp4ndVgjHkOkXWy p3TrRA7GV0WliRoZ1wxHaXbfe+WvcZN6FRgcxbz5ShW1rkJEW2my/vXJowAxLzAykyeh +Az7DcfhqY6hXMjJtLlV/WI/l4m9dcarXi3pCQ5o0NoCnQQWeOZPwJ5UMsf8zY1ePrI4 h1vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vb6PRffpsrzWQQ3477UFY1Hy8/7wqBfJY9TayuYCh/I=; b=SVkQlXhZcWIXueZhzJjoyiiWjVaVGe4VyQ62U2/k5CXbNQrgt0oNirBS4eCf3djvx8 3XWNIPOj2QaBIjsvzSAPaoKAoSeOBJNlmMHw4fQBNmBdJ8cF66ZdoFuvFvbqt14Wchu2 BGbY7oFY6XZ4OLecVmaRucj89EiqUIAvhogi+izH4mg3FBfFDDj5POqmNxXEDneei7kc uY73+ofn3VMgOukjxTYjR7jtyRRgEhaZHV5ghtWifMx8Jcv6pA6LFAIAAnbG2FHYkKAk u//cl/jY0CbPtWZnw3JWBWhDhWODTFyD7lznnsv8q24tcsQy6tfwl2xzEM9u3VRaYk2J UHQA== X-Gm-Message-State: AKwxytee4XXRUarXoeU6nf0Gj8m2CqS6vG0Nsq9fEug2PTTO9k4+Poc7 8y4FW6Z289J8k9P0tqjp+ykn8Q== X-Google-Smtp-Source: ACJfBotJHiw7+tlwpuHVXfb8hRowWMVrDUdO1hvvoS8yGhCEk9/8dAGDA5oCGkxtOOf3G9+rNe104g== X-Received: by 10.98.73.76 with SMTP id w73mr19941509pfa.61.1516299946731; Thu, 18 Jan 2018 10:25:46 -0800 (PST) Received: from xeon-e3 (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id s67sm15455291pfe.133.2018.01.18.10.25.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jan 2018 10:25:46 -0800 (PST) Date: Thu, 18 Jan 2018 10:25:39 -0800 From: Stephen Hemminger To: Matan Azrad Cc: Ferruh Yigit , Thomas Monjalon , dev@dpdk.org, Adrien Mazarguil Message-ID: <20180118102539.02da1cff@xeon-e3> In-Reply-To: <1516265026-6469-6-git-send-email-matan@mellanox.com> 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 Subject: Re: [dpdk-dev] [PATCH v4 5/8] net/vdev_netvsc: implement core functionality X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 18:25:48 -0000 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?