diff options
author | Jiaran Zhang <zhangjiaran@huawei.com> | 2021-04-08 05:40:05 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-04-08 22:23:01 +0200 |
commit | 715c58e94f0d78907bfccde12c2ca5236502c53e (patch) | |
tree | b648b9a20273ebd53c421df7ee17d53a826f10dd /drivers/net/ethernet/hisilicon/hns3/hns3pf | |
parent | net: hns3: change flr_prepare/flr_done function names (diff) | |
download | linux-715c58e94f0d78907bfccde12c2ca5236502c53e.tar.xz linux-715c58e94f0d78907bfccde12c2ca5236502c53e.zip |
net: hns3: add suspend and resume pm_ops
To implement the system suspend/resume functions, the NIC driver needs
to support:
1. When the system enters the suspend mode, the driver needs to
implement the suspend callback function of the NIC device. The driver
needs to mute the device, stop all RX/TX activities of the device, and
unmap the interrupt.
2. When the system enters the resume mode, the driver needs to
implement the resume callback function of the NIC device and restore
the device to the state before suspension.
When the system enters the suspend and resume mode, the NIC driver
actually executes the PF function reset process.
When the PFs are suspending/resuming, VFs also enter the suspend/resume
state because the PFs trigger the VFs to reset, therefore no operation
is required when the VF pci_driver is suspending or resuming.
Signed-off-by: Jiaran Zhang <zhangjiaran@huawei.com>
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/hns3pf')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 47c95dcec3d7..c446b63be503 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -11094,6 +11094,8 @@ retry: if (hdev->reset_type == HNAE3_FLR_RESET) hdev->rst_stats.flr_rst_cnt++; + else if (hdev->reset_type == HNAE3_FUNC_RESET) + hdev->rst_stats.pf_rst_cnt++; } static void hclge_reset_done(struct hnae3_ae_dev *ae_dev) |