Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1716imm; Fri, 21 Sep 2018 08:44:20 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbyf9Hdc1htdCIiPUZ2zQjPvDCUqmWUBlC5GgrvmWLadNHmtvosnt+RYSVNqMSYsxyT+0Wz X-Received: by 2002:a62:990f:: with SMTP id d15-v6mr47223599pfe.162.1537544660747; Fri, 21 Sep 2018 08:44:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537544660; cv=none; d=google.com; s=arc-20160816; b=PsOoNiEnoA/8LAUi2p9JdlsFb7Kw57PNySUDkHaq2K4Xdg8mA5dS0iywmd3e1QiAaM CbY3m/RZ246fL4StVJie6vbpqZj6iMdjhoTXg08/Y202n47FqFN/7Z7hnmoB+YEDodyg BXEbktuowIcBN6ouzuft/8lInCqVFh6//JmOziRQKy6AsPa9dP8iXrz7XRAQKdnn+xsI jB9NMtrTHTgSDHNWdZwgrLmXY7NwVaik5Pa5KEBtrxeOv2z5F3fZV120opitcNwyowHZ whPHpniW2uPWkZmk0ZZGoOUoXfP0/rngWkSTTX3ftAlnaND/5LVoQ/GAH1bJlR3rqNnv s8VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=wIUnKLULZleBXCMzplZpJpkherUKCJQb3HA60BH8MJ4=; b=udynIqIZicUmvEf+MV1bWZjWium/7Am5PHzMc6X/BQRjl9a6E+UnkmY1S3f68AiHtR VwLyADLEhs7oWoaer6ZFtvOE83Js68SvjaY9fjlnmwRnG63nXorLHEwQk8BTNPHhIbSX cBEaLUo434kv2uMd+tXEkv7VOVbDFNj+UO6wXJXUkS4ralVDgY1yfHHC4Y6xpFRz/EFD rkZmVgTbsUN+LvfK5FYczL2+m2FnIHhbZiuZwBCQFLseOmG4xuSZimWZjWQzBAGwRes2 nxd3FGz1O9tkycGqffr2W7oaPBdvm5nZjW8ePVMbXObyVYMMYKejv98MXMUP1PFQbLAu NI1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x17-v6si26779305pgi.243.2018.09.21.08.43.59; Fri, 21 Sep 2018 08:44:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390730AbeIUVcj (ORCPT + 99 others); Fri, 21 Sep 2018 17:32:39 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:43037 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390678AbeIUVci (ORCPT ); Fri, 21 Sep 2018 17:32:38 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1C1662E23F5D8; Fri, 21 Sep 2018 23:43:08 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.54) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.399.0; Fri, 21 Sep 2018 23:42:59 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 07/12] net: hns3: Add nic state check before calling netif_tx_wake_queue Date: Fri, 21 Sep 2018 16:41:43 +0100 Message-ID: <20180921154148.26756-8-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180921154148.26756-1-salil.mehta@huawei.com> References: <20180921154148.26756-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen When nic down, it firstly calls netif_tx_stop_all_queues(), then calls napi_disable(). But napi_disable() will wait current napi_poll finish, it may call netif_tx_wake_queue(). This patch fixes it by add nic state checking. Fixes: 424eb834a9be ("net: hns3: Unified HNS3 {VF|PF} Ethernet Driver for hip08 SoC") Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index fc27f3f..73b42d3 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -1973,6 +1973,7 @@ static int is_valid_clean_head(struct hns3_enet_ring *ring, int h) void hns3_clean_tx_ring(struct hns3_enet_ring *ring) { struct net_device *netdev = ring->tqp->handle->kinfo.netdev; + struct hns3_nic_priv *priv = netdev_priv(netdev); struct netdev_queue *dev_queue; int bytes, pkts; int head; @@ -2018,7 +2019,8 @@ void hns3_clean_tx_ring(struct hns3_enet_ring *ring) * sees the new next_to_clean. */ smp_mb(); - if (netif_tx_queue_stopped(dev_queue)) { + if (netif_tx_queue_stopped(dev_queue) && + !test_bit(HNS3_NIC_STATE_DOWN, &priv->state)) { netif_tx_wake_queue(dev_queue); ring->stats.restart_queue++; } -- 2.7.4