Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp429519imu; Wed, 19 Dec 2018 22:23:57 -0800 (PST) X-Google-Smtp-Source: AFSGD/WPXDhLgBbVu8PkMvj43wkzJoSJpNZfa2O+Xl2bp6E+FsI63AS/0r20H7rbltQlqOIVp5FV X-Received: by 2002:a17:902:4a0c:: with SMTP id w12mr23291050pld.8.1545287037300; Wed, 19 Dec 2018 22:23:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545287037; cv=none; d=google.com; s=arc-20160816; b=XeEB65GaE9RHs1hcF6rrSMaGfMB0PamtVsJ0GDPIPxX4Zx27RtjfcPnCV8xdYMbVUK ePsRjQxuYVGVOUORSTmOicJGJg3Q9ls7yKViVRlQ98Ug+10PFlrjY2VnRHTYY5D5NZAT B4cu+/lADxItRD1bwmMHrZkaEaiFcYqVmuDJ2aSYqMSqk6SFa84LJO8B0W+mBNehkltS 4x9gYq16HMVLcIGZfiSsObkWFgi4eM16sIBugoefPW1J/wM7v2UQI0Z8x26LtwZgIDDY 1gY5q1vSyTRC47nlVEVLJzNsChra+4k9aD2aXCXvtTa5LnvAvgpJuFREvpRjlGfElF4d YnQA== 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=2XhDwQziOz66VhVcANwug0ZNgeZlhIzOYnh9za5y4Zc=; b=tdMIN1ojb0wkpnszaVuFKynk6TFyzV2bna5oR8/o0Vqzsbc9WKl5FKU/2yYtpm4pGq /xSg1dvrOVdJz1N11VuqYRKoukQYOsLWOTnBELRhWblS89vqgahK4g/+Jkldc3NegETh ZzkGps1ScYSmGc5JqYa62SfNL/VCNYBLj3BqZuOTsyjiXcE0dSdqJhgaC79rXyjCacS+ Jf15R8lLd/YtRSfBCtcL6BaLX6pH6U67lkAC2Jqfnpt4CS4PVwm72qS1g6bTT4YuikN5 zJDZ1NeDqHnrtoxKmsF2fimWl3f6mJPTpVzeFdRG/W6gLZWQz3FM7nH2KM3WJ8nK/IWb fgsQ== 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 a2si16398045pgv.33.2018.12.19.22.23.41; Wed, 19 Dec 2018 22:23:57 -0800 (PST) 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 S1729585AbeLTDQZ (ORCPT + 99 others); Wed, 19 Dec 2018 22:16:25 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:59687 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729230AbeLTDQX (ORCPT ); Wed, 19 Dec 2018 22:16:23 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D894ABCDBAE99; Thu, 20 Dec 2018 11:16:19 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.408.0; Thu, 20 Dec 2018 11:16:15 +0800 From: Peng Li To: CC: , , , , , Subject: [PATCH net-next 5/9] net: hns3: reset tqp while doing DOWN operation Date: Thu, 20 Dec 2018 11:52:02 +0800 Message-ID: <1545277926-66432-6-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1545277926-66432-1-git-send-email-lipeng321@huawei.com> References: <1545277926-66432-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 From: Huazhong Tan While doing DOWN operation, the driver will reclaim the memory which has already used for TX. If the hardware is processing this memory, it will cause a RCB error to the hardware. According the hardware's description, the driver should reset the tqp before reclaim the memory during DOWN. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 ++++ drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 0b04d04..98ae282 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -5331,6 +5331,7 @@ static void hclge_ae_stop(struct hnae3_handle *handle) { struct hclge_vport *vport = hclge_get_vport(handle); struct hclge_dev *hdev = vport->back; + int i; set_bit(HCLGE_STATE_DOWN, &hdev->state); @@ -5343,6 +5344,9 @@ static void hclge_ae_stop(struct hnae3_handle *handle) return; } + for (i = 0; i < handle->kinfo.num_tqps; i++) + hclge_reset_tqp(handle, i); + /* Mac disable */ hclge_cfg_mac_mode(hdev, false); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index 919c3aa..156242f 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -1870,9 +1870,13 @@ static int hclgevf_ae_start(struct hnae3_handle *handle) static void hclgevf_ae_stop(struct hnae3_handle *handle) { struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); + int i; set_bit(HCLGEVF_STATE_DOWN, &hdev->state); + for (i = 0; i < handle->kinfo.num_tqps; i++) + hclgevf_reset_tqp(handle, i); + /* reset tqp stats */ hclgevf_reset_tqp_stats(handle); hclgevf_update_link_status(hdev, 0); -- 1.9.1