add some vf fault detect patch for hns
Subsystems (4)
cover add some vf fault detect patch for hns
Currently hns3 driver supports vf fault detect feature.Patch #1 is add hns3 vf fault detect cap bit support.Patch #2 is add vf fault process in hns3 ras.
Jie Wang (2):
net: hns3: add hns3 vf fault detect cap bit support
net: hns3: add vf fault process in hns3 ras
drivers/net/ethernet/hisilicon/hns3/hnae3.h | 5 + .../hns3/hns3_common/hclge_comm_cmd.c | 1 + .../hns3/hns3_common/hclge_comm_cmd.h | 2 + .../ethernet/hisilicon/hns3/hns3_debugfs.c | 3 + .../hisilicon/hns3/hns3pf/hclge_err.c | 113 +++++++++++++++++- .../hisilicon/hns3/hns3pf/hclge_err.h | 2 + .../hisilicon/hns3/hns3pf/hclge_main.c | 3 +- .../hisilicon/hns3/hns3pf/hclge_main.h | 1 + 8 files changed, 124 insertions(+), 6 deletions(-)
Signature · 1 line
2.30.0
PATCH 1/2 net: hns3: add hns3 vf fault detect cap bit support
From: Jie Wang <[email protected]>
Currently hns3 driver is designed to support VF fault detect feature in new hardwares. For code compatibility, vf fault detect cap bit is added to the driver.
--- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 4 ++++ .../net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c | 1 + .../net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h | 1 + drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 3 +++ 4 files changed, 9 insertions(+)
drivers/net/ethernet/hisilicon/hns3/hnae3.h +4 -0
@@ -98,6 +98,7 @@ enum HNAE3_DEV_CAP_BITS {HNAE3_DEV_SUPPORT_MC_MAC_MNG_B ,HNAE3_DEV_SUPPORT_CQ_B ,HNAE3_DEV_SUPPORT_FEC_STATS_B , +HNAE3_DEV_SUPPORT_VF_FAULT_B , HNAE3_DEV_SUPPORT_LANE_NUM_B, };
@@ -164,6 +165,9 @@ enum HNAE3_DEV_CAP_BITS {#define hnae3_ae_dev_fec_stats_supported (ae_dev) \ test_bit(HNAE3_DEV_SUPPORT_FEC_STATS_B, (ae_dev)->caps) +#define hnae3_ae_dev_vf_fault_supported (ae_dev) \ + test_bit(HNAE3_DEV_SUPPORT_VF_FAULT_B, (ae_dev)->caps) +#define hnae3_ae_dev_lane_num_supported (ae_dev) \ test_bit(HNAE3_DEV_SUPPORT_LANE_NUM_B, (ae_dev)->caps)
drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c +1 -0
@@ -155,6 +155,7 @@ static const struct hclge_comm_caps_bit_map hclge_pf_cmd_caps[] = { {HCLGE_COMM_CAP_FD_B, HNAE3_DEV_SUPPORT_FD_B}, {HCLGE_COMM_CAP_FEC_STATS_B, HNAE3_DEV_SUPPORT_FEC_STATS_B}, {HCLGE_COMM_CAP_LANE_NUM_B, HNAE3_DEV_SUPPORT_LANE_NUM_B}, + {HCLGE_COMM_CAP_VF_FAULT_B, HNAE3_DEV_SUPPORT_VF_FAULT_B}, }; static const struct hclge_comm_caps_bit_map hclge_vf_cmd_caps[] = {
drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h +1 -0
@@ -344,6 +344,7 @@ enum HCLGE_COMM_CAP_BITS {HCLGE_COMM_CAP_GRO_B =20 ,HCLGE_COMM_CAP_FD_B =21 ,HCLGE_COMM_CAP_FEC_STATS_B =25 , +HCLGE_COMM_CAP_VF_FAULT_B =26 , HCLGE_COMM_CAP_LANE_NUM_B = 27, };
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c +3 -0
@@ -408,6 +408,9 @@ static struct hns3_dbg_cap_info hns3_dbg_cap[] = { }, { .name = "support lane num", .cap_bit = HNAE3_DEV_SUPPORT_LANE_NUM_B, + }, { + .name = "support vf fault detect", + .cap_bit = HNAE3_DEV_SUPPORT_VF_FAULT_B, } };
Signature · 1 line
2.30.0
PATCH 2/2 net: hns3: add vf fault process in hns3 ras
In reply to Hao LanFrom: Jie Wang <[email protected]>
Currently hns3 driver supports vf fault detect feature. Several ras caused by VF resources don't need to do PF function reset for recovery. The driver only needs to reset the specified VF.
So this patch adds process in ras module. New process will get detailed information about ras and do the most correct measures based on these accurate information.
--- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + .../hns3/hns3_common/hclge_comm_cmd.h | 1 + .../hisilicon/hns3/hns3pf/hclge_err.c | 113 +++++++++++++++++- .../hisilicon/hns3/hns3pf/hclge_err.h | 2 + .../hisilicon/hns3/hns3pf/hclge_main.c | 3 +- .../hisilicon/hns3/hns3pf/hclge_main.h | 1 + 6 files changed, 115 insertions(+), 6 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hnae3.h +1 -0
@@ -265,6 +265,7 @@ enum hnae3_reset_type {HNAE3_GLOBAL_RESET ,HNAE3_IMP_RESET ,HNAE3_NONE_RESET , +HNAE3_VF_EXP_RESET , HNAE3_MAX_RESET, };
drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h +1 -0
@@ -92,6 +92,7 @@ enum hclge_opcode_type {HCLGE_OPC_DFX_SSU_REG_2 =0x004F ,HCLGE_OPC_QUERY_DEV_SPECS =0x0050 , +HCLGE_OPC_GET_QUEUE_ERR_VF =0x0067 ,/* MAC command */ HCLGE_OPC_CONFIG_MAC_MODE = 0x0301,
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c +108 -5
164 lines not on this page · raw message
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.h +2 -0
@@ -196,6 +196,7 @@ struct hclge_hw_module_id {struct hclge_hw_type_id {enum hclge_err_type_list type_id;const char *msg; +bool cause_by_vf;/* indicate the error may from vf exception */ };struct hclge_sum_err_info {
@@ -228,4 +229,5 @@ int hclge_handle_hw_msix_error(struct hclge_dev *hdev, unsigned long *reset_requests);int hclge_handle_error_info_log (struct hnae3_ae_dev *ae_dev);int hclge_handle_mac_tnl (struct hclge_dev *hdev); +int hclge_handle_vf_queue_err_ras (struct hclge_dev *hdev);#endif
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +2 -1
@@ -3520,7 +3520,7 @@ static int hclge_get_status(struct hnae3_handle *handle)return hdev->hw.mac.link; } -static struct hclge_vport *hclge_get_vf_vport (struct hclge_dev *hdev,int vf) +struct hclge_vport *hclge_get_vf_vport (struct hclge_dev *hdev,int vf) {if (!pci_num_vf (hdev->pdev)) { dev_err(&hdev->pdev->dev,
@@ -4559,6 +4559,7 @@ static void hclge_handle_err_recovery(struct hclge_dev *hdev)if (hclge_find_error_source (hdev)) {hclge_handle_error_info_log (ae_dev);hclge_handle_mac_tnl (hdev); +hclge_handle_vf_queue_err_ras (hdev); }hclge_handle_err_reset_request (hdev);
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +1 -0
@@ -1148,4 +1148,5 @@ int hclge_dbg_dump_rst_info(struct hclge_dev *hdev, char *buf, int len);int hclge_push_vf_link_status (struct hclge_vport *vport);int hclge_enable_vport_vlan_filter (struct hclge_vport *vport,bool request_en);int hclge_mac_update_stats (struct hclge_dev *hdev); +struct hclge_vport *hclge_get_vf_vport (struct hclge_dev *hdev,int vf);#endif
Signature · 1 line
2.30.0
Re: [PATCH net-next 2/2] net: hns3: add vf fault process in hns3 ras
Quoted 12 lines · Hao Lan
From: Jie Wang <[email protected]>
Currently hns3 driver supports vf fault detect feature. Several ras caused by VF resources don't need to do PF function reset for recovery. The driver only needs to reset the specified VF.
So this patch adds process in ras module. New process will get detailed information about ras and do the most correct measures based on these accurate information.
Signed-off-by Jie Wang <[email protected]>Signed-off-by Hao Lan <[email protected]>
Quoted 8 lines
--- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + .../hns3/hns3_common/hclge_comm_cmd.h | 1 + .../hisilicon/hns3/hns3pf/hclge_err.c | 113 +++++++++++++++++- .../hisilicon/hns3/hns3pf/hclge_err.h | 2 + .../hisilicon/hns3/hns3pf/hclge_main.c | 3 +- .../hisilicon/hns3/hns3pf/hclge_main.h | 1 + 6 files changed, 115 insertions(+), 6 deletions(-)
Why is it good idea to reset VF from PF?
What will happen with driver bound to this VF?
Shouldn't PCI recovery handle it?
Thanks
Re: [PATCH net-next 2/2] net: hns3: add vf fault process in hns3 ras
Quoted 22 lines · Leon Romanovsky
Quoted 12 lines · Hao Lan
From: Jie Wang <[email protected]>
Currently hns3 driver supports vf fault detect feature. Several ras caused by VF resources don't need to do PF function reset for recovery. The driver only needs to reset the specified VF.
So this patch adds process in ras module. New process will get detailed information about ras and do the most correct measures based on these accurate information.
Signed-off-by Jie Wang <[email protected]>Signed-off-by Hao Lan <[email protected]>Quoted 8 lines
--- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + .../hns3/hns3_common/hclge_comm_cmd.h | 1 + .../hisilicon/hns3/hns3pf/hclge_err.c | 113 +++++++++++++++++- .../hisilicon/hns3/hns3pf/hclge_err.h | 2 + .../hisilicon/hns3/hns3pf/hclge_main.c | 3 +- .../hisilicon/hns3/hns3pf/hclge_main.h | 1 + 6 files changed, 115 insertions(+), 6 deletions(-)
Quoted 6 lines
Why is it good idea to reset VF from PF?
What will happen with driver bound to this VF?
Shouldn't PCI recovery handle it?Thanks
.
PF doesn't reset VF directly. These VF faults are detected by hardware,
and only reported to PF. PF get the VF id from firmware, then notify the VF that it needs reset. VF will do reset after receive the request.
These hardware faults are not standard PCI ras event, so we prefer to use MSIx path.
Quoted 1 line
Re: [PATCH net-next 2/2] net: hns3: add vf fault process in hns3 ras
Quoted 29 lines · wangjie (L)
Quoted 26 lines · Leon Romanovsky
Quoted 12 lines · Hao Lan
From: Jie Wang <[email protected]>
Currently hns3 driver supports vf fault detect feature. Several ras caused by VF resources don't need to do PF function reset for recovery. The driver only needs to reset the specified VF.
So this patch adds process in ras module. New process will get detailed information about ras and do the most correct measures based on these accurate information.
Signed-off-by Jie Wang <[email protected]>Signed-off-by Hao Lan <[email protected]>Quoted 8 lines
--- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + .../hns3/hns3_common/hclge_comm_cmd.h | 1 + .../hisilicon/hns3/hns3pf/hclge_err.c | 113 +++++++++++++++++- .../hisilicon/hns3/hns3pf/hclge_err.h | 2 + .../hisilicon/hns3/hns3pf/hclge_main.c | 3 +- .../hisilicon/hns3/hns3pf/hclge_main.h | 1 + 6 files changed, 115 insertions(+), 6 deletions(-)Why is it good idea to reset VF from PF?
What will happen with driver bound to this VF?
Shouldn't PCI recovery handle it?
Quoted 5 lines
Quoted 2 lines
Thanks
.PF doesn't reset VF directly. These VF faults are detected by hardware, and only reported to PF. PF get the VF id from firmware, then notify the VF that it needs reset. VF will do reset after receive the request.
This description isn't aligned with the code. You are issuing hclge_func_reset_cmd() command which will reset VF, while notification are handled by hclge_func_reset_notify_vf().
It also doesn't make any sense to send notification event to VF through FW while the goal is to recover from stuck FW in that VF.
Quoted 3 lines
These hardware faults are not standard PCI ras event, so we prefer to use MSIx path.
What is different here?
Quoted 1 line
Quoted 1 line
Re: [PATCH net-next 2/2] net: hns3: add vf fault process in hns3 ras
Quoted 36 lines · Leon Romanovsky
Quoted 29 lines · wangjie (L)
Quoted 26 lines · Leon Romanovsky
Quoted 12 lines · Hao Lan
From: Jie Wang <[email protected]>
Currently hns3 driver supports vf fault detect feature. Several ras caused by VF resources don't need to do PF function reset for recovery. The driver only needs to reset the specified VF.
So this patch adds process in ras module. New process will get detailed information about ras and do the most correct measures based on these accurate information.
Signed-off-by Jie Wang <[email protected]>Signed-off-by Hao Lan <[email protected]>Quoted 8 lines
--- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + .../hns3/hns3_common/hclge_comm_cmd.h | 1 + .../hisilicon/hns3/hns3pf/hclge_err.c | 113 +++++++++++++++++- .../hisilicon/hns3/hns3pf/hclge_err.h | 2 + .../hisilicon/hns3/hns3pf/hclge_main.c | 3 +- .../hisilicon/hns3/hns3pf/hclge_main.h | 1 + 6 files changed, 115 insertions(+), 6 deletions(-)Why is it good idea to reset VF from PF?
What will happen with driver bound to this VF?
Shouldn't PCI recovery handle it?Quoted 5 lines
Quoted 2 lines
Thanks
.PF doesn't reset VF directly. These VF faults are detected by hardware, and only reported to PF. PF get the VF id from firmware, then notify the VF that it needs reset. VF will do reset after receive the request.
Quoted 7 lines
This description isn't aligned with the code. You are issuing
hclge_func_reset_cmd()command which will reset VF, while notification are handled byhclge_func_reset_notify_vf().It also doesn't make any sense to send notification event to VF through FW while the goal is to recover from stuck FW in that VF.
Yes, I misunderstand the hclge_func_reset_notify_vf and hclge_func_reset_cmd. It should use hclge_func_reset_notify_vf to inform the VF for recovery. I will fix and retest it in V2.
This patch is used to recover specific vf hardware errors, for example the tx queue configuration exceptions. It make sense in these cases for the firmware is still working properly and can do the recovery rightly.
Quoted 6 lines
Quoted 3 lines
These hardware faults are not standard PCI ras event, so we prefer to use MSIx path.
What is different here?
These hardware faults are reported by MSIx interrupts instead of PCI ras path.
Thanks!
Quoted 3 lines
Quoted 1 line
Quoted 1 line
.
Re: [PATCH net-next 2/2] net: hns3: add vf fault process in hns3 ras
Quoted 46 lines · wangjie (L)
Quoted 36 lines · Leon Romanovsky
Quoted 29 lines · wangjie (L)
Quoted 26 lines · Leon Romanovsky
Quoted 12 lines · Hao Lan
From: Jie Wang <[email protected]>
Currently hns3 driver supports vf fault detect feature. Several ras caused by VF resources don't need to do PF function reset for recovery. The driver only needs to reset the specified VF.
So this patch adds process in ras module. New process will get detailed information about ras and do the most correct measures based on these accurate information.
Signed-off-by Jie Wang <[email protected]>Signed-off-by Hao Lan <[email protected]>Quoted 8 lines
--- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + .../hns3/hns3_common/hclge_comm_cmd.h | 1 + .../hisilicon/hns3/hns3pf/hclge_err.c | 113 +++++++++++++++++- .../hisilicon/hns3/hns3pf/hclge_err.h | 2 + .../hisilicon/hns3/hns3pf/hclge_main.c | 3 +- .../hisilicon/hns3/hns3pf/hclge_main.h | 1 + 6 files changed, 115 insertions(+), 6 deletions(-)Why is it good idea to reset VF from PF?
What will happen with driver bound to this VF?
Shouldn't PCI recovery handle it?Quoted 5 lines
Quoted 2 lines
Thanks
.PF doesn't reset VF directly. These VF faults are detected by hardware, and only reported to PF. PF get the VF id from firmware, then notify the VF that it needs reset. VF will do reset after receive the request.
Quoted 7 lines
This description isn't aligned with the code. You are issuing
hclge_func_reset_cmd()command which will reset VF, while notification are handled byhclge_func_reset_notify_vf().It also doesn't make any sense to send notification event to VF through FW while the goal is to recover from stuck FW in that VF.
Quoted 7 lines
Yes, I misunderstand the
hclge_func_reset_notify_vfandhclge_func_reset_cmd. It should usehclge_func_reset_notify_vfto inform the VF for recovery. I will fix and retest it in V2.This patch is used to recover specific vf hardware errors, for example the tx queue configuration exceptions. It make sense in these cases for the firmware is still working properly and can do the recovery rightly.
If FW is operational and knows about failure, why can't FW do recovery internally to that VF without PF involvement?
Thanks
Re: [PATCH net-next 2/2] net: hns3: add vf fault process in hns3 ras
Quoted 51 lines · Leon Romanovsky
Quoted 50 lines · wangjie (L)
Quoted 36 lines · Leon Romanovsky
Quoted 29 lines · wangjie (L)
Quoted 26 lines · Leon Romanovsky
Quoted 12 lines · Hao Lan
From: Jie Wang <[email protected]>
Currently hns3 driver supports vf fault detect feature. Several ras caused by VF resources don't need to do PF function reset for recovery. The driver only needs to reset the specified VF.
So this patch adds process in ras module. New process will get detailed information about ras and do the most correct measures based on these accurate information.
Signed-off-by Jie Wang <[email protected]>Signed-off-by Hao Lan <[email protected]>Quoted 8 lines
--- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + .../hns3/hns3_common/hclge_comm_cmd.h | 1 + .../hisilicon/hns3/hns3pf/hclge_err.c | 113 +++++++++++++++++- .../hisilicon/hns3/hns3pf/hclge_err.h | 2 + .../hisilicon/hns3/hns3pf/hclge_main.c | 3 +- .../hisilicon/hns3/hns3pf/hclge_main.h | 1 + 6 files changed, 115 insertions(+), 6 deletions(-)Why is it good idea to reset VF from PF?
What will happen with driver bound to this VF?
Shouldn't PCI recovery handle it?Quoted 5 lines
Quoted 2 lines
Thanks
.PF doesn't reset VF directly. These VF faults are detected by hardware, and only reported to PF. PF get the VF id from firmware, then notify the VF that it needs reset. VF will do reset after receive the request.
Quoted 7 lines
This description isn't aligned with the code. You are issuing
hclge_func_reset_cmd()command which will reset VF, while notification are handled byhclge_func_reset_notify_vf().It also doesn't make any sense to send notification event to VF through FW while the goal is to recover from stuck FW in that VF.
Yes, I misunderstand the
hclge_func_reset_notify_vfandhclge_func_reset_cmd. It should usehclge_func_reset_notify_vfto inform the VF for recovery. I will fix and retest it in V2.
Quoted 6 lines
Quoted 3 lines
This patch is used to recover specific vf hardware errors, for example the tx queue configuration exceptions. It make sense in these cases for the firmware is still working properly and can do the recovery rightly.
If FW is operational and knows about failure, why can't FW do recovery internally to that VF without PF involvement?
I'm sorry to reply so late because I took a vacation. If firmware reset VF hardware directly without notify the running VF driver, it will cause VF driver works abnormal.
Thanks
Quoted 4 lines
Thanks
.
Re: [PATCH net-next 2/2] net: hns3: add vf fault process in hns3 ras
Quoted 58 lines · wangjie (L)
Quoted 55 lines · Leon Romanovsky
Quoted 53 lines · wangjie (L)
Quoted 36 lines · Leon Romanovsky
Quoted 29 lines · wangjie (L)
Quoted 26 lines · Leon Romanovsky
Quoted 12 lines · Hao Lan
From: Jie Wang <[email protected]>
Currently hns3 driver supports vf fault detect feature. Several ras caused by VF resources don't need to do PF function reset for recovery. The driver only needs to reset the specified VF.
So this patch adds process in ras module. New process will get detailed information about ras and do the most correct measures based on these accurate information.
Signed-off-by Jie Wang <[email protected]>Signed-off-by Hao Lan <[email protected]>Quoted 8 lines
--- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + .../hns3/hns3_common/hclge_comm_cmd.h | 1 + .../hisilicon/hns3/hns3pf/hclge_err.c | 113 +++++++++++++++++- .../hisilicon/hns3/hns3pf/hclge_err.h | 2 + .../hisilicon/hns3/hns3pf/hclge_main.c | 3 +- .../hisilicon/hns3/hns3pf/hclge_main.h | 1 + 6 files changed, 115 insertions(+), 6 deletions(-)Why is it good idea to reset VF from PF?
What will happen with driver bound to this VF?
Shouldn't PCI recovery handle it?Quoted 5 lines
Quoted 2 lines
Thanks
.PF doesn't reset VF directly. These VF faults are detected by hardware, and only reported to PF. PF get the VF id from firmware, then notify the VF that it needs reset. VF will do reset after receive the request.
Quoted 7 lines
This description isn't aligned with the code. You are issuing
hclge_func_reset_cmd()command which will reset VF, while notification are handled byhclge_func_reset_notify_vf().It also doesn't make any sense to send notification event to VF through FW while the goal is to recover from stuck FW in that VF.
Yes, I misunderstand the
hclge_func_reset_notify_vfandhclge_func_reset_cmd. It should usehclge_func_reset_notify_vfto inform the VF for recovery. I will fix and retest it in V2.This patch is used to recover specific vf hardware errors, for example the tx queue configuration exceptions. It make sense in these cases for the firmware is still working properly and can do the recovery rightly.
Quoted 5 lines
Quoted 2 lines
If FW is operational and knows about failure, why can't FW do recovery internally to that VF without PF involvement?
I'm sorry to reply so late because I took a vacation. If firmware reset VF hardware directly without notify the running VF driver, it will cause VF driver works abnormal.
mlx5 health recovery code proves that it is possible to do. Even in your case, FW can notify VF without PF in the middle.
Thanks
Quoted 6 lines
Thanks
Quoted 4 lines
Thanks
.
Re: [PATCH net-next 2/2] net: hns3: add vf fault process in hns3 ras
Quoted 61 lines · Leon Romanovsky
Quoted 60 lines · wangjie (L)
Quoted 57 lines · Leon Romanovsky
Quoted 46 lines · wangjie (L)
Quoted 36 lines · Leon Romanovsky
Quoted 29 lines · wangjie (L)
Quoted 26 lines · Leon Romanovsky
Quoted 12 lines · Hao Lan
From: Jie Wang <[email protected]>
Currently hns3 driver supports vf fault detect feature. Several ras caused by VF resources don't need to do PF function reset for recovery. The driver only needs to reset the specified VF.
So this patch adds process in ras module. New process will get detailed information about ras and do the most correct measures based on these accurate information.
Signed-off-by Jie Wang <[email protected]>Signed-off-by Hao Lan <[email protected]>Quoted 8 lines
--- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + .../hns3/hns3_common/hclge_comm_cmd.h | 1 + .../hisilicon/hns3/hns3pf/hclge_err.c | 113 +++++++++++++++++- .../hisilicon/hns3/hns3pf/hclge_err.h | 2 + .../hisilicon/hns3/hns3pf/hclge_main.c | 3 +- .../hisilicon/hns3/hns3pf/hclge_main.h | 1 + 6 files changed, 115 insertions(+), 6 deletions(-)Why is it good idea to reset VF from PF?
What will happen with driver bound to this VF?
Shouldn't PCI recovery handle it?Quoted 5 lines
Quoted 2 lines
Thanks
.PF doesn't reset VF directly. These VF faults are detected by hardware, and only reported to PF. PF get the VF id from firmware, then notify the VF that it needs reset. VF will do reset after receive the request.
Quoted 7 lines
This description isn't aligned with the code. You are issuing
hclge_func_reset_cmd()command which will reset VF, while notification are handled byhclge_func_reset_notify_vf().It also doesn't make any sense to send notification event to VF through FW while the goal is to recover from stuck FW in that VF.
Quoted 7 lines
Yes, I misunderstand the
hclge_func_reset_notify_vfandhclge_func_reset_cmd. It should usehclge_func_reset_notify_vfto inform the VF for recovery. I will fix and retest it in V2.This patch is used to recover specific vf hardware errors, for example the tx queue configuration exceptions. It make sense in these cases for the firmware is still working properly and can do the recovery rightly.
If FW is operational and knows about failure, why can't FW do recovery internally to that VF without PF involvement?
Quoted 9 lines
Quoted 3 lines
I'm sorry to reply so late because I took a vacation. If firmware reset VF hardware directly without notify the running VF driver, it will cause VF driver works abnormal.
mlx5 health recovery code proves that it is possible to do. Even in your case, FW can notify VF without PF in the middle.
Thanks
These faults only report to PF in hns3 devices, even if devlink health is used in hns3 driver, these faults also need to report to PF.
Thanks
Quoted 8 lines
Quoted 6 lines
Thanks
Quoted 4 lines
Thanks
..
Re: [PATCH net-next 2/2] net: hns3: add vf fault process in hns3 ras
Quoted 68 lines · wangjie (L)
Quoted 65 lines · Leon Romanovsky
Quoted 63 lines · wangjie (L)
Quoted 51 lines · Leon Romanovsky
Quoted 50 lines · wangjie (L)
Quoted 36 lines · Leon Romanovsky
Quoted 29 lines · wangjie (L)
Quoted 26 lines · Leon Romanovsky
Quoted 12 lines · Hao Lan
From: Jie Wang <[email protected]>
Currently hns3 driver supports vf fault detect feature. Several ras caused by VF resources don't need to do PF function reset for recovery. The driver only needs to reset the specified VF.
So this patch adds process in ras module. New process will get detailed information about ras and do the most correct measures based on these accurate information.
Signed-off-by Jie Wang <[email protected]>Signed-off-by Hao Lan <[email protected]>Quoted 8 lines
--- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + .../hns3/hns3_common/hclge_comm_cmd.h | 1 + .../hisilicon/hns3/hns3pf/hclge_err.c | 113 +++++++++++++++++- .../hisilicon/hns3/hns3pf/hclge_err.h | 2 + .../hisilicon/hns3/hns3pf/hclge_main.c | 3 +- .../hisilicon/hns3/hns3pf/hclge_main.h | 1 + 6 files changed, 115 insertions(+), 6 deletions(-)Why is it good idea to reset VF from PF?
What will happen with driver bound to this VF?
Shouldn't PCI recovery handle it?Quoted 5 lines
Quoted 2 lines
Thanks
.PF doesn't reset VF directly. These VF faults are detected by hardware, and only reported to PF. PF get the VF id from firmware, then notify the VF that it needs reset. VF will do reset after receive the request.
Quoted 7 lines
This description isn't aligned with the code. You are issuing
hclge_func_reset_cmd()command which will reset VF, while notification are handled byhclge_func_reset_notify_vf().It also doesn't make any sense to send notification event to VF through FW while the goal is to recover from stuck FW in that VF.
Yes, I misunderstand the
hclge_func_reset_notify_vfandhclge_func_reset_cmd. It should usehclge_func_reset_notify_vfto inform the VF for recovery. I will fix and retest it in V2.Quoted 6 lines
Quoted 3 lines
This patch is used to recover specific vf hardware errors, for example the tx queue configuration exceptions. It make sense in these cases for the firmware is still working properly and can do the recovery rightly.
If FW is operational and knows about failure, why can't FW do recovery internally to that VF without PF involvement?
I'm sorry to reply so late because I took a vacation. If firmware reset VF hardware directly without notify the running VF driver, it will cause VF driver works abnormal.
Quoted 7 lines
Quoted 5 lines
mlx5 health recovery code proves that it is possible to do. Even in your case, FW can notify VF without PF in the middle.
Thanks
These faults only report to PF in hns3 devices, even if devlink health is used in hns3 driver, these faults also need to report to PF.
I don't think that it is correct, but let's see your v2 without VF reset and with PF notifications.
Thanks
Quoted 10 lines
Thanks
Quoted 8 lines
Quoted 6 lines
Thanks
Quoted 4 lines
Thanks
..
Paolo Abeni
maintainerRe: [PATCH net-next 2/2] net: hns3: add vf fault process in hns3 ras
In reply to Hao LanHello,
On Fri, 2023-01-13 at 10:08 +0800, Hao Lan wrote:
[...]
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c int hclge_handle_error_info_log(struct hnae3_ae_dev *ae_dev) · line 3010
Quoted 12 lines
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c +12
-0+static void hclge_get_vf_fault_bitmap (struct hclge_desc *desc, +unsigned long *bitmap) +{ +#define HCLGE_FIR_FAULT_BYTES 24 +#define HCLGE_SEC_FAULT_BYTES 8 + +u8 *buff; + +memcpy (bitmap, desc[0 ].data,HCLGE_FIR_FAULT_BYTES ); + buff = (u8 *)bitmap +HCLGE_FIR_FAULT_BYTES ; +memcpy (buff, desc[1 ].data,HCLGE_SEC_FAULT_BYTES ); +}
The above works under the assumption that:
HCLGE_FIR_FAULT_BYTES + HCLGE_SEC_FAULT_BYTES == BITS_TO_BYTES(HCLGE_VPORT_NUM)
I think it's better to enforce such condition at build time with a BUILD_BUG_ON(), to avoid future issues.
Also I think Leon still deserve a reply to one of his questions,
specifically: What will happen (at recovery time) with driver bound to this VF?
Thanks!
Paolo
Re: [PATCH net-next 2/2] net: hns3: add vf fault process in hns3 ras
Quoted 25 lines · Paolo Abeni
Hello,
On Fri, 2023-01-13 at 10:08 +0800, Hao Lan wrote:
[...]drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c int hclge_handle_error_info_log(struct hnae3_ae_dev *ae_dev) · line 3010
Quoted 12 lines
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c +12
-0+static void hclge_get_vf_fault_bitmap (struct hclge_desc *desc, +unsigned long *bitmap) +{ +#define HCLGE_FIR_FAULT_BYTES 24 +#define HCLGE_SEC_FAULT_BYTES 8 + +u8 *buff; + +memcpy (bitmap, desc[0 ].data,HCLGE_FIR_FAULT_BYTES ); + buff = (u8 *)bitmap +HCLGE_FIR_FAULT_BYTES ; +memcpy (buff, desc[1 ].data,HCLGE_SEC_FAULT_BYTES ); +}The above works under the assumption that:
HCLGE_FIR_FAULT_BYTES + HCLGE_SEC_FAULT_BYTES == BITS_TO_BYTES(HCLGE_VPORT_NUM)I think it's better to enforce such condition at build time with a
BUILD_BUG_ON(), to avoid future issues.
Quoted 8 lines
Also I think Leon still deserve a reply to one of his questions,
specifically: What will happen (at recovery time) with driver bound to this VF?Thanks!
Paolo
As discussed in reply to Leon, it missed to notify VF driver to prepare for the reset in V1, So I will add notify to VF driver in v2 to make sure the VF driver will init to normal at recovery time.
Thanks!
Quoted 2 lines
.
Re: [PATCH net-next 2/2] net: hns3: add vf fault process in hns3 ras
In reply to Paolo AbeniQuoted 20 lines · Paolo Abeni
Hello,
On Fri, 2023-01-13 at 10:08 +0800, Hao Lan wrote:
[...]drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c int hclge_handle_error_info_log(struct hnae3_ae_dev *ae_dev) · line 3010
Quoted 12 lines
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c +12
-0+static void hclge_get_vf_fault_bitmap (struct hclge_desc *desc, +unsigned long *bitmap) +{ +#define HCLGE_FIR_FAULT_BYTES 24 +#define HCLGE_SEC_FAULT_BYTES 8 + +u8 *buff; + +memcpy (bitmap, desc[0 ].data,HCLGE_FIR_FAULT_BYTES ); + buff = (u8 *)bitmap +HCLGE_FIR_FAULT_BYTES ; +memcpy (buff, desc[1 ].data,HCLGE_SEC_FAULT_BYTES ); +}The above works under the assumption that:
Quoted 5 lines
HCLGE_FIR_FAULT_BYTES + HCLGE_SEC_FAULT_BYTES == BITS_TO_BYTES(HCLGE_VPORT_NUM)I think it's better to enforce such condition at build time with a
BUILD_BUG_ON(), to avoid future issues.
OK, I will add it in v2
Quoted 10 lines
Also I think Leon still deserve a reply to one of his questions,
specifically: What will happen (at recovery time) with driver bound to this VF?Thanks!
Paolo
.