diff options
author | Salil Mehta <salil.mehta@huawei.com> | 2018-03-22 14:28:54 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-03-22 15:29:03 -0400 |
commit | 436667d2e1793995267915d2562f7b14f26c1f63 (patch) | |
tree | 3395a065e9bfbd4c01596aa90755603ce4063271 /drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | |
parent | 35a1e50343bdae07bffe911e2d9f7e825fafe4f1 (diff) |
net: hns3: Add VF Reset device state and its handling
This introduces the hclge device reset states of "requested" and
"pending" and also its handling in context to Reset Service Task.
Device gets into requested state because of any VF reset request
asserted from upper layers, for example due to watchdog timeout
expiration. Requested state would result in eventually forwarding
the VF reset request to PF which would actually reset the VF.
Device will get into pending state if:
1. VF receives the acknowledgement from PF for the VF reset
request it originally sent to PF.
2. Reset Service Task detects that after asserting VF reset for
certain times the data-path is not working and device then
decides to assert full VF reset(this means also resetting the
PCIe interface).
3. PF intimates the VF that it has undergone reset.
Pending state would result in VF to poll for hardware reset
completion status and then resetting the stack/enet layer, which
in turn means reinitializing the ring management/enet layer.
Note: we would be adding support of 3. later as a separate patch.
This decision should not affect VF reset as its event handling
is generic in nature.
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h index 8b5fa670ed18..1c9cf87a73c0 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h @@ -124,6 +124,11 @@ struct hclgevf_dev { struct hclgevf_rss_cfg rss_cfg; unsigned long state; +#define HCLGEVF_RESET_REQUESTED 0 +#define HCLGEVF_RESET_PENDING 1 + unsigned long reset_state; /* requested, pending */ + u32 reset_attempts; + u32 fw_version; u16 num_tqps; /* num task queue pairs of this PF */ |