summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
diff options
context:
space:
mode:
authorHuazhong Tan <tanhuazhong@huawei.com>2018-11-07 12:06:12 +0800
committerDavid S. Miller <davem@davemloft.net>2018-11-07 11:42:17 -0800
commit257e4f29946ab8e257ee9bfbc35e680726298571 (patch)
tree931f041caf0f7530874f816d2f69fc9adab63fd7 /drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
parent8df0fa91682c86403173f0813a615efb46e8be42 (diff)
net: hns3: use HNS3_NIC_STATE_RESETTING to indicate resetting
While hclge is going to reset, it will notify its client with HNAE3_DOWN_CLIENT, so this client should get into a resetting status from this moment, other operations from the stack need to be blocked as well. And when the reset is finished, the client will be notified with HNAE3_UP_CLIENT, so this is the end of the resetting status. This patch uses HNS3_NIC_STATE_RESETTING flag to implement that, and adds hns3_nic_resetting() to indicate which operation is not allowed. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hns3_enet.h')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3_enet.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
index 3e9db7356cf2..cfd6a7109691 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
@@ -599,6 +599,13 @@ static inline bool hns3_dev_ongoing_func_reset(struct hnae3_ae_dev *ae_dev)
#define hns3_read_dev(a, reg) \
hns3_read_reg((a)->io_base, (reg))
+static inline bool hns3_nic_resetting(struct net_device *netdev)
+{
+ struct hns3_nic_priv *priv = netdev_priv(netdev);
+
+ return test_bit(HNS3_NIC_STATE_RESETTING, &priv->state);
+}
+
#define hns3_write_dev(a, reg, value) \
hns3_write_reg((a)->io_base, (reg), (value))