All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: hns3: call hns3_nic_net_open() while doing HNAE3_UP_CLIENT
@ 2018-12-31  2:58 Huazhong Tan
  2019-01-01 20:14 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Huazhong Tan @ 2018-12-31  2:58 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, mehta.salil

For HNAE3_DOWN_CLIENT calling hns3_nic_net_stop(), HNAE3_UP_CLIENT
should call hns3_nic_net_open(), since if the number of queue or
the map of TC has is changed before HHAE3_UP_CLIENT is called,
it will cause problem.

Also the HNS3_NIC_STATE_RESETTING flag needs to be cleared before
hns3_nic_net_open() called, and set it back while hns3_nic_net_open()
failed.

Fixes: bb6b94a896d4 ("net: hns3: Add reset interface implementation in client")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index d3b9aaf..07cd587 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -3995,17 +3995,18 @@ static int hns3_reset_notify_up_enet(struct hnae3_handle *handle)
 	struct hns3_nic_priv *priv = netdev_priv(kinfo->netdev);
 	int ret = 0;
 
+	clear_bit(HNS3_NIC_STATE_RESETTING, &priv->state);
+
 	if (netif_running(kinfo->netdev)) {
-		ret = hns3_nic_net_up(kinfo->netdev);
+		ret = hns3_nic_net_open(kinfo->netdev);
 		if (ret) {
+			set_bit(HNS3_NIC_STATE_RESETTING, &priv->state);
 			netdev_err(kinfo->netdev,
 				   "hns net up fail, ret=%d!\n", ret);
 			return ret;
 		}
 	}
 
-	clear_bit(HNS3_NIC_STATE_RESETTING, &priv->state);
-
 	return ret;
 }
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: hns3: call hns3_nic_net_open() while doing HNAE3_UP_CLIENT
  2018-12-31  2:58 [PATCH net] net: hns3: call hns3_nic_net_open() while doing HNAE3_UP_CLIENT Huazhong Tan
@ 2019-01-01 20:14 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-01-01 20:14 UTC (permalink / raw)
  To: tanhuazhong
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, mehta.salil

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Mon, 31 Dec 2018 10:58:29 +0800

> For HNAE3_DOWN_CLIENT calling hns3_nic_net_stop(), HNAE3_UP_CLIENT
> should call hns3_nic_net_open(), since if the number of queue or
> the map of TC has is changed before HHAE3_UP_CLIENT is called,
> it will cause problem.
> 
> Also the HNS3_NIC_STATE_RESETTING flag needs to be cleared before
> hns3_nic_net_open() called, and set it back while hns3_nic_net_open()
> failed.
> 
> Fixes: bb6b94a896d4 ("net: hns3: Add reset interface implementation in client")
> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
> Signed-off-by: Peng Li <lipeng321@huawei.com>

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-01 20:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-31  2:58 [PATCH net] net: hns3: call hns3_nic_net_open() while doing HNAE3_UP_CLIENT Huazhong Tan
2019-01-01 20:14 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.