Received: by 10.213.65.68 with SMTP id h4csp888855imn; Fri, 23 Mar 2018 20:05:15 -0700 (PDT) X-Google-Smtp-Source: AG47ELtr2Ly9WjnffnCVO21gT5V0/h6ZnlE6i2v+0YLKx767zhwxa7bE5Y4x+Oai28YcWhwnt8bI X-Received: by 2002:a17:902:9a8f:: with SMTP id w15-v6mr17938109plp.103.1521860715927; Fri, 23 Mar 2018 20:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521860715; cv=none; d=google.com; s=arc-20160816; b=pPIa/C+zMtN+yMZaNGhD/ZNxNP43ryUmjGI6SUBRhO4oBtq894SbnTI2GKmPBfsN1P 4Dl4XVXqZK+i6gl4oiatRsfnh+PSv1ywpuw10wF2NEaqATWq+y/I0FD2lYRHSIUNZckt YEuEHLv4Fm7AVtAVjscZUdqQqI/aArGIhHKQBdedpRKXpoy2yT1v5BYtGkgLZpSbGidI awlg4aU7idk3Z2sotnQgSpMJcBzklB4EgNHaRXS+rQ9mOoLUQwuOtQ3PpUdN/E5VUnq3 IRXzmvtSLineKFQ8N20+Nds7g3NQfMgeWJA6o/fy8rAoNE1Xo+qgJ5RxGOfdqKdNfg5U kc2Q== 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:arc-authentication-results; bh=WBvLRdgdv8wvzJ0GGZD0xqSkIxVfTiGg/zVoMrj9Afw=; b=s6iy2qdRQ+a0+rX8dcf05EBs79KyhZM7h7ZIeJY10sJWTm/L5qBtlIXlqz4A+EBlVF thZRWmpXUYtwy1ZZDDq0nqSqMV2zXNgINzEoyLgfKsJfsUwjA2Yg5wRjsk0J4lcz4og8 bY6R0URXE202YeL7mXjjjSg7ER5Out0NTK/pG+iDNiq2TFianmPESzKCml4Mzkd6VRA0 OP3Mq2LsD5GwDYCIVe6k2yQlJ0/oIWPgDBGn58TCIL2kcRsci2+Fn+ocTtV1BJU7PmM4 CPw1bYFkSUfnm+bBjiif4syszB1uL3tdd82bWvT/IXFYc6RN45342whAE4w2Mj1RgnOZ 4nOA== 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 c66si1505439pfc.362.2018.03.23.20.05.01; Fri, 23 Mar 2018 20:05:15 -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 S1752322AbeCXDBx (ORCPT + 99 others); Fri, 23 Mar 2018 23:01:53 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6703 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752113AbeCXDBP (ORCPT ); Fri, 23 Mar 2018 23:01:15 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 6FC7AF388F029; Sat, 24 Mar 2018 11:00:59 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.361.1; Sat, 24 Mar 2018 11:00:52 +0800 From: Peng Li To: CC: , , , , Subject: [PATCH net-next 5/5] net: hns3: never send command queue message to IMP when reset Date: Sat, 24 Mar 2018 11:32:47 +0800 Message-ID: <1521862367-111399-6-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1521862367-111399-1-git-send-email-lipeng321@huawei.com> References: <1521862367-111399-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org IMP will not handle and command queue message any more when it is in core/global, driver should not send command queue message to IMP until reinitialize the NIC HW. This patch checks the status and avoid the message sent to IMP when reset. Signed-off-by: Peng Li --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 23 +++++++++++++++++----- .../ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 6 ++++++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index ce093c3..2066dd7 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3584,6 +3584,9 @@ static int hclge_unmap_ring_frm_vector(struct hnae3_handle *handle, struct hclge_dev *hdev = vport->back; int vector_id, ret; + if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) + return 0; + vector_id = hclge_get_vector_index(hdev, vector); if (vector_id < 0) { dev_err(&handle->pdev->dev, @@ -3781,13 +3784,16 @@ static int hclge_ae_start(struct hnae3_handle *handle) clear_bit(HCLGE_STATE_DOWN, &hdev->state); mod_timer(&hdev->service_timer, jiffies + HZ); + /* reset tqp stats */ + hclge_reset_tqp_stats(handle); + + if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) + return 0; + ret = hclge_mac_start_phy(hdev); if (ret) return ret; - /* reset tqp stats */ - hclge_reset_tqp_stats(handle); - return 0; } @@ -3797,6 +3803,12 @@ static void hclge_ae_stop(struct hnae3_handle *handle) struct hclge_dev *hdev = vport->back; int i; + del_timer_sync(&hdev->service_timer); + cancel_work_sync(&hdev->service_task); + + if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) + return; + for (i = 0; i < vport->alloc_tqps; i++) hclge_tqp_enable(hdev, i, 0, false); @@ -3807,8 +3819,6 @@ static void hclge_ae_stop(struct hnae3_handle *handle) /* reset tqp stats */ hclge_reset_tqp_stats(handle); - del_timer_sync(&hdev->service_timer); - cancel_work_sync(&hdev->service_task); hclge_update_link_status(hdev); } @@ -4940,6 +4950,9 @@ void hclge_reset_tqp(struct hnae3_handle *handle, u16 queue_id) u16 queue_gid; int ret; + if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) + return; + queue_gid = hclge_covert_handle_qid_global(handle, queue_id); ret = hclge_tqp_enable(hdev, queue_id, 0, false); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c index c1dea3a..682c2d6 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c @@ -60,6 +60,9 @@ static int hclge_mdio_write(struct mii_bus *bus, int phyid, int regnum, struct hclge_desc desc; int ret; + if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) + return 0; + hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_MDIO_CONFIG, false); mdio_cmd = (struct hclge_mdio_cfg_cmd *)desc.data; @@ -95,6 +98,9 @@ static int hclge_mdio_read(struct mii_bus *bus, int phyid, int regnum) struct hclge_desc desc; int ret; + if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) + return 0; + hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_MDIO_CONFIG, true); mdio_cmd = (struct hclge_mdio_cfg_cmd *)desc.data; -- 2.9.3