linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peng Li <lipeng321@huawei.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linuxarm@huawei.com>, <yisen.zhuang@huawei.com>,
	<salil.mehta@huawei.com>, <lipeng321@huawei.com>
Subject: [PATCH net-next 5/9] net: hns3: reset tqp while doing DOWN operation
Date: Thu, 20 Dec 2018 11:52:02 +0800	[thread overview]
Message-ID: <1545277926-66432-6-git-send-email-lipeng321@huawei.com> (raw)
In-Reply-To: <1545277926-66432-1-git-send-email-lipeng321@huawei.com>

From: Huazhong Tan <tanhuazhong@huawei.com>

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 <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
---
 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


  parent reply	other threads:[~2018-12-20  3:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-20  3:51 [PATCH net-next 0/9] net: hns3: code optimizations & bugfixes for HNS3 driver Peng Li
2018-12-20  3:51 ` [PATCH net-next 1/9] net: hns3: refine the handle for hns3_nic_net_open/stop() Peng Li
2018-12-20  3:51 ` [PATCH net-next 2/9] net: hns3: change default tc state to close Peng Li
2018-12-20  3:52 ` [PATCH net-next 3/9] net: hns3: fix a bug caused by udelay Peng Li
2018-12-20  3:52 ` [PATCH net-next 4/9] net: hns3: add max vector number check for pf Peng Li
2018-12-20  3:52 ` Peng Li [this message]
2018-12-20  3:52 ` [PATCH net-next 6/9] net: hns3: fix vf id check issue when add flow director rule Peng Li
2018-12-20  3:52 ` [PATCH net-next 7/9] net: hns3: don't restore rules when flow director is disabled Peng Li
2018-12-20  3:52 ` [PATCH net-next 8/9] net: hns3: fix the descriptor index when get rss type Peng Li
2018-12-20  3:52 ` [PATCH net-next 9/9] net: hns3: remove redundant variable initialization Peng Li
2018-12-20  7:48 ` [PATCH net-next 0/9] net: hns3: code optimizations & bugfixes for HNS3 driver David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1545277926-66432-6-git-send-email-lipeng321@huawei.com \
    --to=lipeng321@huawei.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=yisen.zhuang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).