From patchwork Wed Jun 7 22:53:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 772727 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wjkPq1rQ9z9sCZ for ; Thu, 8 Jun 2017 08:54:07 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=networkplumber-org.20150623.gappssmtp.com header.i=@networkplumber-org.20150623.gappssmtp.com header.b="tkXeO2FE"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751653AbdFGWyC (ORCPT ); Wed, 7 Jun 2017 18:54:02 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:34584 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751478AbdFGWyA (ORCPT ); Wed, 7 Jun 2017 18:54:00 -0400 Received: by mail-pf0-f176.google.com with SMTP id 9so10404966pfj.1 for ; Wed, 07 Jun 2017 15:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EKfDaTpxpUDnDtqMOU6nyTCu7fpAkrt7zo1AnpIxxeY=; b=tkXeO2FEwh3Nx75plQYJJUNsOdRQ0mAf1Jz74+diYcxtPRle6xNg9G3eO0lDN63N8M PafDIr8/WL9yCDcPJ2DiEMvo2LoQ3VXpQzroFRu8yktinzeFqK4OOj/afNCSoZinnBE+ HjYHNhR+byzrphb6J9BeqUgQHD4hjMV1CIEdtaxk6j5Mqm4Zex6nKYx+g3g/SeC+QCHk JKfFf7zyX+VIc8r9rSQLHN8zNyvX6QQE+7FMVNMlP9T8Nu+leMI26I5Hr4u7ytJ+7jeM H6rGGo2XBAd9nXk66aZjTTxnJ1c6Gxqm5KoMsDLXZlGGNnxdial0ADxC30GQzB2rCZL+ 3pdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EKfDaTpxpUDnDtqMOU6nyTCu7fpAkrt7zo1AnpIxxeY=; b=PemrqeZpvYPCWpJdydk4hwNxVwHYeAChHluAmPPafJEGG05wTKSzR3GNLTWUOhIQ+A 4XaAi2iuh9YWCz0n8hx1qID3UbxRkDHig9dAQAosvjrOVj0KvGU6KUpoY3fQI6x7Bsnz L0k1cvucsGNgo3Lv8xu8ftAC8gxUhAbYJDT8NVsbJjrfQxnTEaqdbEEwjVzYTc8RYv7p wsRI1yVoXv8ZvM3jwUDqaaxMv52u5GxzUchfB524J5aLvIDffAQ7X/2WrlKMU3nd9Iqc Uf6e4hj1a6evgwyXqpoIMrRHyYBWDOE+KHt8M6ntzSSUpPOQVXnq/Hb3TnyEaX1EGSuU bSOA== X-Gm-Message-State: AODbwcDS4bVNltRb4zuQ1sfz/ml6wNFgaMpicCn4pJRllU1PFXb5GB+A a1dlLV3vhXeb6BXB7KyNog== X-Received: by 10.99.178.75 with SMTP id t11mr2408365pgo.34.1496876039620; Wed, 07 Jun 2017 15:53:59 -0700 (PDT) Received: from xeon-e3.wavecable.com (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id d2sm5684170pfb.110.2017.06.07.15.53.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jun 2017 15:53:59 -0700 (PDT) From: Stephen Hemminger X-Google-Original-From: Stephen Hemminger To: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com Cc: devel@linuxdriverproject.org, netdev@vger.kernel.org Subject: [PATCH net v2 2/3] netvsc: fix net poll mode Date: Wed, 7 Jun 2017 15:53:48 -0700 Message-Id: <20170607225349.28359-3-sthemmin@microsoft.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170607225349.28359-1-sthemmin@microsoft.com> References: <20170607225349.28359-1-sthemmin@microsoft.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The ndo_poll_controller function needs to schedule NAPI to pick up arriving packets and send completions. Otherwise no data will ever be received. For simple case of netconsole, it also will allow send completions to happen. Without this netpoll will eventually get stuck. Signed-off-by: Stephen Hemminger --- drivers/net/hyperv/netvsc_drv.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index d93e4da25fd2..252e5d52d17e 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -1158,11 +1158,22 @@ netvsc_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, } #ifdef CONFIG_NET_POLL_CONTROLLER -static void netvsc_poll_controller(struct net_device *net) +static void netvsc_poll_controller(struct net_device *dev) { - /* As netvsc_start_xmit() works synchronous we don't have to - * trigger anything here. - */ + struct net_device_context *ndc = netdev_priv(dev); + struct netvsc_device *ndev; + int i; + + rcu_read_lock(); + ndev = rcu_dereference(ndc->nvdev); + if (ndev) { + for (i = 0; i < ndev->num_chn; i++) { + struct netvsc_channel *nvchan = &ndev->chan_table[i]; + + napi_schedule(&nvchan->napi); + } + } + rcu_read_unlock(); } #endif