drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c- Extension
.c- Size
- 89528 bytes
- Lines
- 3474
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/sched/clock.hhclge_err.h
Detected Declarations
function hclge_print_mod_reg_infofunction hclge_err_mod_check_support_cmdfunction hclge_query_reg_infofunction hclge_query_reg_info_of_ssufunction hclge_log_errorfunction hclge_cmd_query_errorfunction hclge_clear_mac_tnl_intfunction hclge_config_common_hw_err_intfunction hclge_config_ncsi_hw_err_intfunction hclge_config_igu_egu_hw_err_intfunction hclge_config_ppp_error_interruptfunction hclge_config_ppp_hw_err_intfunction hclge_config_tm_hw_err_intfunction hclge_config_mac_err_intfunction hclge_config_mac_tnl_intfunction hclge_config_ppu_error_interruptsfunction hclge_config_ppu_hw_err_intfunction hclge_config_ssu_hw_err_intfunction hclge_query_bd_numfunction hclge_handle_mpf_ras_errorfunction hclge_handle_pf_ras_errorfunction hclge_handle_all_ras_errorsfunction hclge_log_rocee_axi_errorfunction hclge_log_rocee_ecc_errorfunction hclge_log_rocee_ovf_errorfunction hclge_log_and_clear_rocee_ras_errorfunction hclge_config_rocee_ras_interruptfunction hclge_handle_rocee_ras_errorfunction hclge_config_all_msix_errorfunction hclge_config_nic_hw_errorfunction hclge_handle_hw_ras_errorfunction hclge_clear_hw_msix_errorfunction hclge_query_over_8bd_err_infofunction hclge_handle_over_8bd_errfunction hclge_handle_mpf_msix_errorfunction hclge_handle_pf_msix_errorfunction hclge_handle_all_hw_msix_errorfunction hclge_handle_hw_msix_errorfunction hclge_handle_mac_tnlfunction hclge_handle_all_hns_hw_errorsfunction hclge_find_error_sourcefunction hclge_handle_occurred_errorfunction hclge_handle_error_type_reg_logfunction hclge_handle_error_module_logfunction hclge_query_all_err_bd_numfunction hclge_query_all_err_infofunction hclge_handle_error_info_logfunction hclge_reset_vf_in_bitmap
Annotated Snippet
if (actual_len > HCLGE_MOD_REG_INFO_LEN_MAX) {
dev_info(dev, "length of reg(%s) is invalid, len=%d\n",
reg_info[i].reg_name, actual_len);
continue;
}
pos = scnprintf(buf, HCLGE_MOD_REG_INFO_LEN_MAX, "%s",
reg_info[i].reg_name);
if (reg_info[i].has_suffix)
pos += scnprintf(buf + pos,
HCLGE_MOD_REG_INFO_LEN_MAX - pos, "%u",
le32_to_cpu(desc->data[0]));
pos += scnprintf(buf + pos,
HCLGE_MOD_REG_INFO_LEN_MAX - pos,
":");
for (j = 0; j < reg_info[i].group_size; j++) {
offset = reg_info[i].reg_offset_group[j];
index = offset % HCLGE_DESC_DATA_LEN;
bd_idx = offset / HCLGE_DESC_DATA_LEN;
pos += scnprintf(buf + pos,
HCLGE_MOD_REG_INFO_LEN_MAX - pos,
" %08x",
le32_to_cpu(desc[bd_idx].data[index]));
}
dev_info(dev, "%s\n", buf);
}
kfree(buf);
return 0;
}
static bool hclge_err_mod_check_support_cmd(enum hclge_opcode_type opcode,
struct hclge_dev *hdev)
{
if (opcode == HCLGE_OPC_DFX_GEN_REG &&
!hnae3_ae_dev_gen_reg_dfx_supported(hdev))
return false;
return true;
}
/* For each common msg, send cmdq to IMP and print result reg info.
* If there is a parameter, loop it and request.
*/
static void
hclge_query_reg_info(struct hclge_dev *hdev,
struct hclge_mod_reg_common_msg *msg, u32 loop_time,
u32 *loop_para)
{
int desc_len, i, ret;
desc_len = msg->bd_num * sizeof(struct hclge_desc);
msg->desc = kzalloc(desc_len, GFP_KERNEL);
if (!msg->desc) {
dev_err(&hdev->pdev->dev, "failed to query reg info, ret=%d",
-ENOMEM);
return;
}
for (i = 0; i < loop_time; i++) {
ret = hclge_dbg_cmd_send(hdev, msg->desc, *loop_para,
msg->bd_num, msg->cmd);
loop_para++;
if (ret)
continue;
ret = hclge_print_mod_reg_info(&hdev->pdev->dev, msg->desc,
msg->result_regs,
msg->result_regs_size);
if (ret)
dev_err(&hdev->pdev->dev, "failed to print mod reg info, ret=%d\n",
ret);
}
kfree(msg->desc);
}
static void hclge_query_reg_info_of_ssu(struct hclge_dev *hdev)
{
u32 loop_para[HCLGE_MOD_MSG_PARA_ARRAY_MAX_SIZE] = {0};
struct hclge_mod_reg_common_msg msg;
u8 i, j, num, loop_time;
num = ARRAY_SIZE(hclge_ssu_reg_common_msg);
for (i = 0; i < num; i++) {
msg = hclge_ssu_reg_common_msg[i];
if (!hclge_err_mod_check_support_cmd(msg.cmd, hdev))
continue;
loop_time = 1;
loop_para[0] = 0;
if (msg.need_para) {
loop_time = min(hdev->ae_dev->dev_specs.tnl_num,
Annotation
- Immediate include surface: `linux/sched/clock.h`, `hclge_err.h`.
- Detected declarations: `function hclge_print_mod_reg_info`, `function hclge_err_mod_check_support_cmd`, `function hclge_query_reg_info`, `function hclge_query_reg_info_of_ssu`, `function hclge_log_error`, `function hclge_cmd_query_error`, `function hclge_clear_mac_tnl_int`, `function hclge_config_common_hw_err_int`, `function hclge_config_ncsi_hw_err_int`, `function hclge_config_igu_egu_hw_err_int`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.