Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1017965imm; Wed, 19 Sep 2018 10:34:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbfDxG4siB97vugMpD/BzMiuwVzB/55+KrMYO2Sh9dpNnBKuDUT13rNu83wlEcQ+5YRr58X X-Received: by 2002:a17:902:6907:: with SMTP id j7-v6mr35679919plk.323.1537378450619; Wed, 19 Sep 2018 10:34:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537378450; cv=none; d=google.com; s=arc-20160816; b=c91W1mhGZ1VDWLDjUKZCnjh3Azwbh38K52aPKBmVlDbk+wQmTSG+jadwH3g6fVZKk9 juR4rX+5KGPC3BmBkBFfuCsjcPG/aKekwSYQWUVqj+pZ1hKhRCQlvnTmalRMk2SpGfqm FyOQwVcnPlSM/6KTAPqFvR5sNXg+PJzXjP33rR2f6RUFFEmYvpbsSdpegYrBs89zazBZ bRRQFfPRBiAvFi9pt40moD0AWX8361AsmnXjyQy79iO/v9MC6CevznakjcEtP4Tdctcn dcG5u/Kxl/sLLI++Fiz6jlx3bIx1DTj+2BDVZEmM3NFROiCEjg3j6lEutIxRQJK63jN8 EBEA== 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=cHNSdtBoduWHGPqPFgEnXQ8GQWGqiaCUUJGFkN63Vdg=; b=wovh9XQIB+hH5uJqlXIoNE70ipykSD5Ul/jtO617FbQupfiRO6LE95/VjR4M1/5OyQ 3Ke98q6hP06yQ3alCz1ee1+XG/7csoksnIwV9UmN6VkoB3nkGlSqOFmGe5S5GmxPQ3de M3Ph3HGEH/QQD+DK56hlcXHbA43nnCoEkGSV2LhuL2qvUYDlxwSb3U3o6c1PgtYYphrm 5mhNH2rKc4wICw0Gmadt4IuKnoMnruu/Gd424BKlld1H1gwai/KddCy9G680fPsaFxH3 FtNR5RbZhsmz3wcOGKnw53CI8ZJ0c7cofUk+jC4wD/7KE1jY6jh5XrDs0Z72rFirnXjI Q0KA== 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 u29-v6si20824330pga.29.2018.09.19.10.33.55; Wed, 19 Sep 2018 10:34:10 -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 S1733210AbeISXKS (ORCPT + 99 others); Wed, 19 Sep 2018 19:10:18 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:12625 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733198AbeISXKS (ORCPT ); Wed, 19 Sep 2018 19:10:18 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 054D0670F2F0B; Thu, 20 Sep 2018 01:31:19 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.54) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.399.0; Thu, 20 Sep 2018 01:31:09 +0800 From: Salil Mehta To: CC: , , , , , , , Fuyun Liang Subject: [PATCH net-next 06/12] net: hns3: Set STATE_DOWN bit of hdev state when stopping net Date: Wed, 19 Sep 2018 18:29:52 +0100 Message-ID: <20180919172958.12992-7-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180919172958.12992-1-salil.mehta@huawei.com> References: <20180919172958.12992-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: Fuyun Liang We clear STATE_DOWN bit of hdev state when starting net, but do not set it again when stopping net. It causes that the net is down, but hdev state is still up. STATE_DOWN bit of hdev state should be set when stopping net. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 ++ drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index ad15ba7..66b31d1 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3519,6 +3519,8 @@ static void hclge_ae_stop(struct hnae3_handle *handle) struct hclge_dev *hdev = vport->back; int i; + set_bit(HCLGE_STATE_DOWN, &hdev->state); + del_timer_sync(&hdev->service_timer); cancel_work_sync(&hdev->service_task); clear_bit(HCLGE_STATE_SERVICE_SCHED, &hdev->state); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index 9c0091f..47fc3cd 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -1448,6 +1448,8 @@ static void hclgevf_ae_stop(struct hnae3_handle *handle) struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); int i, queue_id; + set_bit(HCLGEVF_STATE_DOWN, &hdev->state); + for (i = 0; i < hdev->num_tqps; i++) { /* Ring disable */ queue_id = hclgevf_get_queue_id(handle->kinfo.tqp[i]); -- 2.7.4