From patchwork Wed Sep 19 17:29:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 147037 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp986974ljw; Wed, 19 Sep 2018 10:31:25 -0700 (PDT) X-Google-Smtp-Source: ANB0VdboIB1JOqs+8I7uQQDkI33PyibSiuLrDITfKaN7N/7SZDkDZf1E6x/RVL5rlaH3FeXseeP4 X-Received: by 2002:a62:8186:: with SMTP id t128-v6mr36583814pfd.192.1537378284914; Wed, 19 Sep 2018 10:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537378284; cv=none; d=google.com; s=arc-20160816; b=KWdEarbQE9NA8fmau1K+aqVBeZo2QLcchDRF01A2kvauPH/6nl8EPI6OSit5zs2Q0b yYEX78JMzM4MYzf63Tq7ysR2K84P5Zol8bOu5l94nzxBK3XtF1Zu7NkdeEt2T7u39cpq 2fXwj9mE6JloG8OPyxKUGTrULCdTBei3WvCxUWy2cX8ERKeRELCWh3SlruB+TkIi4EWK ePqXW5mwx1fEW/Am7lHVHDMU6xhNc1GOSERZ3ao2koW+5eC6NJIIZoJ9P9jGs9H7/S1B RTFpUnQAqr4+pqEcuxwqbnyc/YK0t1JrrDt4shv0pxTQuQxjmcGW3yt6plYHPKRujyq+ Ynsg== 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 71-v6si23361487pla.92.2018.09.19.10.31.24; Wed, 19 Sep 2018 10:31:24 -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 S1733216AbeISXKS (ORCPT + 32 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 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(+) -- 2.7.4 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]);