Skip to content

Commit e888402

Browse files
Huazhong Tandavem330
authored andcommitted
net: hns3: call hns3_nic_net_open() while doing HNAE3_UP_CLIENT
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: bb6b94a ("net: hns3: Add reset interface implementation in client") Signed-off-by: Huazhong Tan <[email protected]> Signed-off-by: Yunsheng Lin <[email protected]> Signed-off-by: Peng Li <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cb9f1b7 commit e888402

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3995,17 +3995,18 @@ static int hns3_reset_notify_up_enet(struct hnae3_handle *handle)
39953995
struct hns3_nic_priv *priv = netdev_priv(kinfo->netdev);
39963996
int ret = 0;
39973997

3998+
clear_bit(HNS3_NIC_STATE_RESETTING, &priv->state);
3999+
39984000
if (netif_running(kinfo->netdev)) {
3999-
ret = hns3_nic_net_up(kinfo->netdev);
4001+
ret = hns3_nic_net_open(kinfo->netdev);
40004002
if (ret) {
4003+
set_bit(HNS3_NIC_STATE_RESETTING, &priv->state);
40014004
netdev_err(kinfo->netdev,
40024005
"hns net up fail, ret=%d!\n", ret);
40034006
return ret;
40044007
}
40054008
}
40064009

4007-
clear_bit(HNS3_NIC_STATE_RESETTING, &priv->state);
4008-
40094010
return ret;
40104011
}
40114012

0 commit comments

Comments
 (0)