// SPDX-License-Identifier: GPL-2.0+
/* Copyright (c) 2016-2017 Hisilicon Limited. */

#include <linux/sched/clock.h>

#include "hclge_err.h"

static const struct hclge_hw_error hclge_imp_tcm_ecc_int[] = {
	{
		.int_msk = BIT(1),
		.msg = "imp_itcm0_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(3),
		.msg = "imp_itcm1_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(5),
		.msg = "imp_itcm2_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(7),
		.msg = "imp_itcm3_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(9),
		.msg = "imp_dtcm0_mem0_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(11),
		.msg = "imp_dtcm0_mem1_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(13),
		.msg = "imp_dtcm1_mem0_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(15),
		.msg = "imp_dtcm1_mem1_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(17),
		.msg = "imp_itcm4_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_cmdq_nic_mem_ecc_int[] = {
	{
		.int_msk = BIT(1),
		.msg = "cmdq_nic_rx_depth_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(3),
		.msg = "cmdq_nic_tx_depth_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(5),
		.msg = "cmdq_nic_rx_tail_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(7),
		.msg = "cmdq_nic_tx_tail_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(9),
		.msg = "cmdq_nic_rx_head_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(11),
		.msg = "cmdq_nic_tx_head_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(13),
		.msg = "cmdq_nic_rx_addr_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(15),
		.msg = "cmdq_nic_tx_addr_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(17),
		.msg = "cmdq_rocee_rx_depth_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(19),
		.msg = "cmdq_rocee_tx_depth_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(21),
		.msg = "cmdq_rocee_rx_tail_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(23),
		.msg = "cmdq_rocee_tx_tail_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(25),
		.msg = "cmdq_rocee_rx_head_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(27),
		.msg = "cmdq_rocee_tx_head_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(29),
		.msg = "cmdq_rocee_rx_addr_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(31),
		.msg = "cmdq_rocee_tx_addr_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_tqp_int_ecc_int[] = {
	{
		.int_msk = BIT(6),
		.msg = "tqp_int_cfg_even_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(7),
		.msg = "tqp_int_cfg_odd_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(8),
		.msg = "tqp_int_ctrl_even_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(9),
		.msg = "tqp_int_ctrl_odd_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(10),
		.msg = "tx_que_scan_int_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(11),
		.msg = "rx_que_scan_int_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_msix_sram_ecc_int[] = {
	{
		.int_msk = BIT(1),
		.msg = "msix_nic_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(3),
		.msg = "msix_rocee_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_igu_int[] = {
	{
		.int_msk = BIT(0),
		.msg = "igu_rx_buf0_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(2),
		.msg = "igu_rx_buf1_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_igu_egu_tnl_int[] = {
	{
		.int_msk = BIT(0),
		.msg = "rx_buf_overflow",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(1),
		.msg = "rx_stp_fifo_overflow",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(2),
		.msg = "rx_stp_fifo_underflow",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(3),
		.msg = "tx_buf_overflow",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(4),
		.msg = "tx_buf_underrun",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(5),
		.msg = "rx_stp_buf_overflow",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_ncsi_err_int[] = {
	{
		.int_msk = BIT(1),
		.msg = "ncsi_tx_ecc_mbit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_ppp_mpf_abnormal_int_st1[] = {
	{
		.int_msk = BIT(0),
		.msg = "vf_vlan_ad_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(1),
		.msg = "umv_mcast_group_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(2),
		.msg = "umv_key_mem0_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(3),
		.msg = "umv_key_mem1_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(4),
		.msg = "umv_key_mem2_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(5),
		.msg = "umv_key_mem3_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(6),
		.msg = "umv_ad_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(7),
		.msg = "rss_tc_mode_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(8),
		.msg = "rss_idt_mem0_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(9),
		.msg = "rss_idt_mem1_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(10),
		.msg = "rss_idt_mem2_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(11),
		.msg = "rss_idt_mem3_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(12),
		.msg = "rss_idt_mem4_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(13),
		.msg = "rss_idt_mem5_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(14),
		.msg = "rss_idt_mem6_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(15),
		.msg = "rss_idt_mem7_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(16),
		.msg = "rss_idt_mem8_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(17),
		.msg = "rss_idt_mem9_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(18),
		.msg = "rss_idt_mem10_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(19),
		.msg = "rss_idt_mem11_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(20),
		.msg = "rss_idt_mem12_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(21),
		.msg = "rss_idt_mem13_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(22),
		.msg = "rss_idt_mem14_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(23),
		.msg = "rss_idt_mem15_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(24),
		.msg = "port_vlan_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(25),
		.msg = "mcast_linear_table_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(26),
		.msg = "mcast_result_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(27),
		.msg = "flow_director_ad_mem0_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(28),
		.msg = "flow_director_ad_mem1_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(29),
		.msg = "rx_vlan_tag_memory_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(30),
		.msg = "Tx_UP_mapping_config_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_ppp_pf_abnormal_int[] = {
	{
		.int_msk = BIT(0),
		.msg = "tx_vlan_tag_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(1),
		.msg = "rss_list_tc_unassigned_queue_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_ppp_mpf_abnormal_int_st3[] = {
	{
		.int_msk = BIT(0),
		.msg = "hfs_fifo_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(1),
		.msg = "rslt_descr_fifo_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(2),
		.msg = "tx_vlan_tag_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(3),
		.msg = "FD_CN0_memory_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(4),
		.msg = "FD_CN1_memory_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(5),
		.msg = "GRO_AD_memory_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_tm_sch_rint[] = {
	{
		.int_msk = BIT(1),
		.msg = "tm_sch_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(2),
		.msg = "tm_sch_port_shap_sub_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(3),
		.msg = "tm_sch_port_shap_sub_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(4),
		.msg = "tm_sch_pg_pshap_sub_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(5),
		.msg = "tm_sch_pg_pshap_sub_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(6),
		.msg = "tm_sch_pg_cshap_sub_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(7),
		.msg = "tm_sch_pg_cshap_sub_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(8),
		.msg = "tm_sch_pri_pshap_sub_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(9),
		.msg = "tm_sch_pri_pshap_sub_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(10),
		.msg = "tm_sch_pri_cshap_sub_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(11),
		.msg = "tm_sch_pri_cshap_sub_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(12),
		.msg = "tm_sch_port_shap_offset_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(13),
		.msg = "tm_sch_port_shap_offset_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(14),
		.msg = "tm_sch_pg_pshap_offset_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(15),
		.msg = "tm_sch_pg_pshap_offset_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(16),
		.msg = "tm_sch_pg_cshap_offset_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(17),
		.msg = "tm_sch_pg_cshap_offset_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(18),
		.msg = "tm_sch_pri_pshap_offset_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(19),
		.msg = "tm_sch_pri_pshap_offset_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(20),
		.msg = "tm_sch_pri_cshap_offset_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(21),
		.msg = "tm_sch_pri_cshap_offset_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(22),
		.msg = "tm_sch_rq_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(23),
		.msg = "tm_sch_rq_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(24),
		.msg = "tm_sch_nq_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(25),
		.msg = "tm_sch_nq_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(26),
		.msg = "tm_sch_roce_up_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(27),
		.msg = "tm_sch_roce_up_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(28),
		.msg = "tm_sch_rcb_byte_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(29),
		.msg = "tm_sch_rcb_byte_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(30),
		.msg = "tm_sch_ssu_byte_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(31),
		.msg = "tm_sch_ssu_byte_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_qcn_fifo_rint[] = {
	{
		.int_msk = BIT(0),
		.msg = "qcn_shap_gp0_sch_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(1),
		.msg = "qcn_shap_gp0_sch_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(2),
		.msg = "qcn_shap_gp1_sch_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(3),
		.msg = "qcn_shap_gp1_sch_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(4),
		.msg = "qcn_shap_gp2_sch_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(5),
		.msg = "qcn_shap_gp2_sch_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(6),
		.msg = "qcn_shap_gp3_sch_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(7),
		.msg = "qcn_shap_gp3_sch_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(8),
		.msg = "qcn_shap_gp0_offset_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(9),
		.msg = "qcn_shap_gp0_offset_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(10),
		.msg = "qcn_shap_gp1_offset_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(11),
		.msg = "qcn_shap_gp1_offset_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(12),
		.msg = "qcn_shap_gp2_offset_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(13),
		.msg = "qcn_shap_gp2_offset_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(14),
		.msg = "qcn_shap_gp3_offset_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(15),
		.msg = "qcn_shap_gp3_offset_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(16),
		.msg = "qcn_byte_info_fifo_rd_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(17),
		.msg = "qcn_byte_info_fifo_wr_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_qcn_ecc_rint[] = {
	{
		.int_msk = BIT(1),
		.msg = "qcn_byte_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(3),
		.msg = "qcn_time_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(5),
		.msg = "qcn_fb_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(7),
		.msg = "qcn_link_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(9),
		.msg = "qcn_rate_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(11),
		.msg = "qcn_tmplt_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(13),
		.msg = "qcn_shap_cfg_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(15),
		.msg = "qcn_gp0_barrel_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(17),
		.msg = "qcn_gp1_barrel_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(19),
		.msg = "qcn_gp2_barrel_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(21),
		.msg = "qcn_gp3_barral_mem_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_mac_afifo_tnl_int[] = {
	{
		.int_msk = BIT(0),
		.msg = "egu_cge_afifo_ecc_1bit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(1),
		.msg = "egu_cge_afifo_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(2),
		.msg = "egu_lge_afifo_ecc_1bit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(3),
		.msg = "egu_lge_afifo_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(4),
		.msg = "cge_igu_afifo_ecc_1bit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(5),
		.msg = "cge_igu_afifo_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(6),
		.msg = "lge_igu_afifo_ecc_1bit_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(7),
		.msg = "lge_igu_afifo_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(8),
		.msg = "cge_igu_afifo_overflow_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(9),
		.msg = "lge_igu_afifo_overflow_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(10),
		.msg = "egu_cge_afifo_underrun_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(11),
		.msg = "egu_lge_afifo_underrun_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(12),
		.msg = "egu_ge_afifo_underrun_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(13),
		.msg = "ge_igu_afifo_overflow_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_ppu_mpf_abnormal_int_st2[] = {
	{
		.int_msk = BIT(13),
		.msg = "rpu_rx_pkt_bit32_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(14),
		.msg = "rpu_rx_pkt_bit33_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(15),
		.msg = "rpu_rx_pkt_bit34_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(16),
		.msg = "rpu_rx_pkt_bit35_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(17),
		.msg = "rcb_tx_ring_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(18),
		.msg = "rcb_rx_ring_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(19),
		.msg = "rcb_tx_fbd_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(20),
		.msg = "rcb_rx_ebd_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(21),
		.msg = "rcb_tso_info_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(22),
		.msg = "rcb_tx_int_info_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(23),
		.msg = "rcb_rx_int_info_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(24),
		.msg = "tpu_tx_pkt_0_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(25),
		.msg = "tpu_tx_pkt_1_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(26),
		.msg = "rd_bus_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(27),
		.msg = "wr_bus_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(28),
		.msg = "reg_search_miss",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(29),
		.msg = "rx_q_search_miss",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(30),
		.msg = "ooo_ecc_err_detect",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(31),
		.msg = "ooo_ecc_err_multpl",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_ppu_mpf_abnormal_int_st3[] = {
	{
		.int_msk = BIT(4),
		.msg = "gro_bd_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(5),
		.msg = "gro_context_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(6),
		.msg = "rx_stash_cfg_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(7),
		.msg = "axi_rd_fbd_ecc_mbit_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_ppu_pf_abnormal_int[] = {
	{
		.int_msk = BIT(0),
		.msg = "over_8bd_no_fe",
		.reset_level = HNAE3_FUNC_RESET
	}, {
		.int_msk = BIT(1),
		.msg = "tso_mss_cmp_min_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(2),
		.msg = "tso_mss_cmp_max_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(3),
		.msg = "tx_rd_fbd_poison",
		.reset_level = HNAE3_FUNC_RESET
	}, {
		.int_msk = BIT(4),
		.msg = "rx_rd_ebd_poison",
		.reset_level = HNAE3_FUNC_RESET
	}, {
		.int_msk = BIT(5),
		.msg = "buf_wait_timeout",
		.reset_level = HNAE3_NONE_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_ssu_com_err_int[] = {
	{
		.int_msk = BIT(0),
		.msg = "buf_sum_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(1),
		.msg = "ppp_mb_num_err",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(2),
		.msg = "ppp_mbid_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(3),
		.msg = "ppp_rlt_mac_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(4),
		.msg = "ppp_rlt_host_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(5),
		.msg = "cks_edit_position_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(6),
		.msg = "cks_edit_condition_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(7),
		.msg = "vlan_edit_condition_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(8),
		.msg = "vlan_num_ot_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(9),
		.msg = "vlan_num_in_err",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		/* sentinel */
	}
};

#define HCLGE_SSU_MEM_ECC_ERR(x) \
{ \
	.int_msk = BIT(x), \
	.msg = "ssu_mem" #x "_ecc_mbit_err", \
	.reset_level = HNAE3_GLOBAL_RESET \
}

static const struct hclge_hw_error hclge_ssu_mem_ecc_err_int[] = {
	HCLGE_SSU_MEM_ECC_ERR(0),
	HCLGE_SSU_MEM_ECC_ERR(1),
	HCLGE_SSU_MEM_ECC_ERR(2),
	HCLGE_SSU_MEM_ECC_ERR(3),
	HCLGE_SSU_MEM_ECC_ERR(4),
	HCLGE_SSU_MEM_ECC_ERR(5),
	HCLGE_SSU_MEM_ECC_ERR(6),
	HCLGE_SSU_MEM_ECC_ERR(7),
	HCLGE_SSU_MEM_ECC_ERR(8),
	HCLGE_SSU_MEM_ECC_ERR(9),
	HCLGE_SSU_MEM_ECC_ERR(10),
	HCLGE_SSU_MEM_ECC_ERR(11),
	HCLGE_SSU_MEM_ECC_ERR(12),
	HCLGE_SSU_MEM_ECC_ERR(13),
	HCLGE_SSU_MEM_ECC_ERR(14),
	HCLGE_SSU_MEM_ECC_ERR(15),
	HCLGE_SSU_MEM_ECC_ERR(16),
	HCLGE_SSU_MEM_ECC_ERR(17),
	HCLGE_SSU_MEM_ECC_ERR(18),
	HCLGE_SSU_MEM_ECC_ERR(19),
	HCLGE_SSU_MEM_ECC_ERR(20),
	HCLGE_SSU_MEM_ECC_ERR(21),
	HCLGE_SSU_MEM_ECC_ERR(22),
	HCLGE_SSU_MEM_ECC_ERR(23),
	HCLGE_SSU_MEM_ECC_ERR(24),
	HCLGE_SSU_MEM_ECC_ERR(25),
	HCLGE_SSU_MEM_ECC_ERR(26),
	HCLGE_SSU_MEM_ECC_ERR(27),
	HCLGE_SSU_MEM_ECC_ERR(28),
	HCLGE_SSU_MEM_ECC_ERR(29),
	HCLGE_SSU_MEM_ECC_ERR(30),
	HCLGE_SSU_MEM_ECC_ERR(31),
	{ /* sentinel */ }
};

static const struct hclge_hw_error hclge_ssu_port_based_err_int[] = {
	{
		.int_msk = BIT(0),
		.msg = "roc_pkt_without_key_port",
		.reset_level = HNAE3_FUNC_RESET
	}, {
		.int_msk = BIT(1),
		.msg = "tpu_pkt_without_key_port",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(2),
		.msg = "igu_pkt_without_key_port",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(3),
		.msg = "roc_eof_mis_match_port",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(4),
		.msg = "tpu_eof_mis_match_port",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(5),
		.msg = "igu_eof_mis_match_port",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(6),
		.msg = "roc_sof_mis_match_port",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(7),
		.msg = "tpu_sof_mis_match_port",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(8),
		.msg = "igu_sof_mis_match_port",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(11),
		.msg = "ets_rd_int_rx_port",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(12),
		.msg = "ets_wr_int_rx_port",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(13),
		.msg = "ets_rd_int_tx_port",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(14),
		.msg = "ets_wr_int_tx_port",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_ssu_fifo_overflow_int[] = {
	{
		.int_msk = BIT(0),
		.msg = "ig_mac_inf_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(1),
		.msg = "ig_host_inf_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(2),
		.msg = "ig_roc_buf_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(3),
		.msg = "ig_host_data_fifo_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(4),
		.msg = "ig_host_key_fifo_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(5),
		.msg = "tx_qcn_fifo_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(6),
		.msg = "rx_qcn_fifo_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(7),
		.msg = "tx_pf_rd_fifo_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(8),
		.msg = "rx_pf_rd_fifo_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(9),
		.msg = "qm_eof_fifo_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(10),
		.msg = "mb_rlt_fifo_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(11),
		.msg = "dup_uncopy_fifo_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(12),
		.msg = "dup_cnt_rd_fifo_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(13),
		.msg = "dup_cnt_drop_fifo_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(14),
		.msg = "dup_cnt_wrb_fifo_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(15),
		.msg = "host_cmd_fifo_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(16),
		.msg = "mac_cmd_fifo_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(17),
		.msg = "host_cmd_bitmap_empty_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(18),
		.msg = "mac_cmd_bitmap_empty_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(19),
		.msg = "dup_bitmap_empty_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(20),
		.msg = "out_queue_bitmap_empty_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(21),
		.msg = "bank2_bitmap_empty_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(22),
		.msg = "bank1_bitmap_empty_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(23),
		.msg = "bank0_bitmap_empty_int",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_ssu_ets_tcg_int[] = {
	{
		.int_msk = BIT(0),
		.msg = "ets_rd_int_rx_tcg",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(1),
		.msg = "ets_wr_int_rx_tcg",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(2),
		.msg = "ets_rd_int_tx_tcg",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		.int_msk = BIT(3),
		.msg = "ets_wr_int_tx_tcg",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_ssu_port_based_pf_int[] = {
	{
		.int_msk = BIT(0),
		.msg = "roc_pkt_without_key_port",
		.reset_level = HNAE3_FUNC_RESET
	}, {
		.int_msk = BIT(9),
		.msg = "low_water_line_err_port",
		.reset_level = HNAE3_NONE_RESET
	}, {
		.int_msk = BIT(10),
		.msg = "hi_water_line_err_port",
		.reset_level = HNAE3_GLOBAL_RESET
	}, {
		/* sentinel */
	}
};

static const struct hclge_hw_error hclge_rocee_qmm_ovf_err_int[] = {
	{
		.int_msk = 0,
		.msg = "rocee qmm ovf: sgid invalid err"
	}, {
		.int_msk = 0x4,
		.msg = "rocee qmm ovf: sgid ovf err"
	}, {
		.int_msk = 0x8,
		.msg = "rocee qmm ovf: smac invalid err"
	}, {
		.int_msk = 0xC,
		.msg = "rocee qmm ovf: smac ovf err"
	}, {
		.int_msk = 0x10,
		.msg = "rocee qmm ovf: cqc invalid err"
	}, {
		.int_msk = 0x11,
		.msg = "rocee qmm ovf: cqc ovf err"
	}, {
		.int_msk = 0x12,
		.msg = "rocee qmm ovf: cqc hopnum err"
	}, {
		.int_msk = 0x13,
		.msg = "rocee qmm ovf: cqc ba0 err"
	}, {
		.int_msk = 0x14,
		.msg = "rocee qmm ovf: srqc invalid err"
	}, {
		.int_msk = 0x15,
		.msg = "rocee qmm ovf: srqc ovf err"
	}, {
		.int_msk = 0x16,
		.msg = "rocee qmm ovf: srqc hopnum err"
	}, {
		.int_msk = 0x17,
		.msg = "rocee qmm ovf: srqc ba0 err"
	}, {
		.int_msk = 0x18,
		.msg = "rocee qmm ovf: mpt invalid err"
	}, {
		.int_msk = 0x19,
		.msg = "rocee qmm ovf: mpt ovf err"
	}, {
		.int_msk = 0x1A,
		.msg = "rocee qmm ovf: mpt hopnum err"
	}, {
		.int_msk = 0x1B,
		.msg = "rocee qmm ovf: mpt ba0 err"
	}, {
		.int_msk = 0x1C,
		.msg = "rocee qmm ovf: qpc invalid err"
	}, {
		.int_msk = 0x1D,
		.msg = "rocee qmm ovf: qpc ovf err"
	}, {
		.int_msk = 0x1E,
		.msg = "rocee qmm ovf: qpc hopnum err"
	}, {
		.int_msk = 0x1F,
		.msg = "rocee qmm ovf: qpc ba0 err"
	}, {
		/* sentinel */
	}
};

static const struct hclge_mod_reg_info hclge_ssu_reg_0_info[] = {
	{
		.reg_name = "SSU_BP_STATUS_0~5",
		.reg_offset_group = { 5, 6, 7, 8, 9, 10},
		.group_size = 6
	}, {
		.reg_name = "LO_PRI_UNICAST_CUR_CNT",
		.reg_offset_group = {54},
		.group_size = 1
	}, {
		.reg_name = "HI/LO_PRI_MULTICAST_CUR_CNT",
		.reg_offset_group = {55, 56},
		.group_size = 2
	}, {
		.reg_name = "SSU_MB_RD_RLT_DROP_CNT",
		.reg_offset_group = {29},
		.group_size = 1
	}, {
		.reg_name = "SSU_PPP_MAC_KEY_NUM",
		.reg_offset_group = {31, 30},
		.group_size = 2
	}, {
		.reg_name = "SSU_PPP_HOST_KEY_NUM",
		.reg_offset_group = {33, 32},
		.group_size = 2
	}, {
		.reg_name = "PPP_SSU_MAC/HOST_RLT_NUM",
		.reg_offset_group = {35, 34, 37, 36},
		.group_size = 4
	}, {
		.reg_name = "FULL/PART_DROP_NUM",
		.reg_offset_group = {18, 19},
		.group_size = 2
	}, {
		.reg_name = "PPP_KEY/RLT_DROP_NUM",
		.reg_offset_group = {20, 21},
		.group_size = 2
	}, {
		.reg_name = "NIC/ROC_L2_ERR_DROP_PKT_CNT",
		.reg_offset_group = {48, 49},
		.group_size = 2
	}, {
		.reg_name = "NIC/ROC_L2_ERR_DROP_PKT_CNT_RX",
		.reg_offset_group = {50, 51},
		.group_size = 2
	},
};

static const struct hclge_mod_reg_info hclge_ssu_reg_1_info[] = {
	{
		.reg_name = "RX_PACKET_IN/OUT_CNT",
		.reg_offset_group = {13, 12, 15, 14},
		.group_size = 4
	}, {
		.reg_name = "TX_PACKET_IN/OUT_CNT",
		.reg_offset_group = {17, 16, 19, 18},
		.group_size = 4
	}, {
		.reg_name = "RX_PACKET_TC0_IN/OUT_CNT",
		.reg_offset_group = {25, 24, 41, 40},
		.group_size = 4
	}, {
		.reg_name = "RX_PACKET_TC1_IN/OUT_CNT",
		.reg_offset_group = {27, 26, 43, 42},
		.group_size = 4
	}, {
		.reg_name = "RX_PACKET_TC2_IN/OUT_CNT",
		.reg_offset_group = {29, 28, 45, 44},
		.group_size = 4
	}, {
		.reg_name = "RX_PACKET_TC3_IN/OUT_CNT",
		.reg_offset_group = {31, 30, 47, 46},
		.group_size = 4
	}, {
		.reg_name = "RX_PACKET_TC4_IN/OUT_CNT",
		.reg_offset_group = {33, 32, 49, 48},
		.group_size = 4
	}, {
		.reg_name = "RX_PACKET_TC5_IN/OUT_CNT",
		.reg_offset_group = {35, 34, 51, 50},
		.group_size = 4
	}, {
		.reg_name = "RX_PACKET_TC6_IN/OUT_CNT",
		.reg_offset_group = {37, 36, 53, 52},
		.group_size = 4
	}, {
		.reg_name = "RX_PACKET_TC7_IN/OUT_CNT",
		.reg_offset_group = {39, 38, 55, 54},
		.group_size = 4
	}, {
		.reg_name = "TX_PACKET_TC0_IN/OUT_CNT",
		.reg_offset_group = {57, 56, 73, 72},
		.group_size = 4
	}, {
		.reg_name = "TX_PACKET_TC1_IN/OUT_CNT",
		.reg_offset_group = {59, 58, 75, 74},
		.group_size = 4
	}, {
		.reg_name = "TX_PACKET_TC2_IN/OUT_CNT",
		.reg_offset_group = {61, 60, 77, 76},
		.group_size = 4
	}, {
		.reg_name = "TX_PACKET_TC3_IN/OUT_CNT",
		.reg_offset_group = {63, 62, 79, 78},
		.group_size = 4
	}, {
		.reg_name = "TX_PACKET_TC4_IN/OUT_CNT",
		.reg_offset_group = {65, 64, 81, 80},
		.group_size = 4
	}, {
		.reg_name = "TX_PACKET_TC5_IN/OUT_CNT",
		.reg_offset_group = {67, 66, 83, 82},
		.group_size = 4
	}, {
		.reg_name = "TX_PACKET_TC6_IN/OUT_CNT",
		.reg_offset_group = {69, 68, 85, 84},
		.group_size = 4
	}, {
		.reg_name = "TX_PACKET_TC7_IN/OUT_CNT",
		.reg_offset_group = {71, 70, 87, 86},
		.group_size = 4
	}, {
		.reg_name = "PACKET_TC0~3_CURR_BUFFER_CNT",
		.reg_offset_group = {1, 2, 3, 4},
		.group_size = 4
	}, {
		.reg_name = "PACKET_TC4~7_CURR_BUFFER_CNT",
		.reg_offset_group = {5, 6, 7, 8},
		.group_size = 4
	}, {
		.reg_name = "ROC_RX_PACKET_IN_CNT",
		.reg_offset_group = {21, 20},
		.group_size = 2
	}, {
		.reg_name = "ROC_TX_PACKET_OUT_CNT",
		.reg_offset_group = {23, 22},
		.group_size = 2
	}
};

static const struct hclge_mod_reg_info hclge_rpu_reg_0_info[] = {
	{
		.reg_name = "RPU_FSM_DFX_ST0/ST1_TNL",
		.has_suffix = true,
		.reg_offset_group = {1, 2},
		.group_size = 2
	}, {
		.reg_name = "RPU_RX_PKT_DROP_CNT_TNL",
		.has_suffix = true,
		.reg_offset_group = {3},
		.group_size = 1
	}
};

static const struct hclge_mod_reg_info hclge_rpu_reg_1_info[] = {
	{
		.reg_name = "FIFO_DFX_ST0_1_2_4",
		.reg_offset_group = {1, 2, 3, 5},
		.group_size = 4
	}
};

static const struct hclge_mod_reg_info hclge_igu_egu_reg_info[] = {
	{
		.reg_name = "IGU_RX_ERR_PKT",
		.reg_offset_group = {1},
		.group_size = 1
	}, {
		.reg_name = "IGU_RX_OUT_ALL_PKT",
		.reg_offset_group = {29, 28},
		.group_size = 2
	}, {
		.reg_name = "EGU_TX_OUT_ALL_PKT",
		.reg_offset_group = {39, 38},
		.group_size = 2
	}, {
		.reg_name = "EGU_TX_ERR_PKT",
		.reg_offset_group = {5},
		.group_size = 1
	}
};

static const struct hclge_mod_reg_info hclge_gen_reg_info_tnl[] = {
	{
		.reg_name = "SSU2RPU_TNL_WR_PKT_CNT_TNL",
		.has_suffix = true,
		.reg_offset_group = {1},
		.group_size = 1
	}, {
		.reg_name = "RPU2HST_TNL_WR_PKT_CNT_TNL",
		.has_suffix = true,
		.reg_offset_group = {12},
		.group_size = 1
	}
};

static const struct hclge_mod_reg_info hclge_gen_reg_info[] = {
	{
		.reg_name = "SSU_OVERSIZE_DROP_CNT",
		.reg_offset_group = {12},
		.group_size = 1
	}, {
		.reg_name = "ROCE_RX_BYPASS_5NS_DROP_NUM",
		.reg_offset_group = {13},
		.group_size = 1
	}, {
		.reg_name = "RX_PKT_IN/OUT_ERR_CNT",
		.reg_offset_group = {15, 14, 19, 18},
		.group_size = 4
	}, {
		.reg_name = "TX_PKT_IN/OUT_ERR_CNT",
		.reg_offset_group = {17, 16, 21, 20},
		.group_size = 4
	}, {
		.reg_name = "ETS_TC_READY",
		.reg_offset_group = {22},
		.group_size = 1
	}, {
		.reg_name = "MIB_TX/RX_BAD_PKTS",
		.reg_offset_group = {19, 18, 29, 28},
		.group_size = 4
	}, {
		.reg_name = "MIB_TX/RX_GOOD_PKTS",
		.reg_offset_group = {21, 20, 31, 30},
		.group_size = 4
	}, {
		.reg_name = "MIB_TX/RX_TOTAL_PKTS",
		.reg_offset_group = {23, 22, 33, 32},
		.group_size = 4
	}, {
		.reg_name = "MIB_TX/RX_PAUSE_PKTS",
		.reg_offset_group = {25, 24, 35, 34},
		.group_size = 4
	}, {
		.reg_name = "MIB_TX_ERR_ALL_PKTS",
		.reg_offset_group = {27, 26},
		.group_size = 2
	}, {
		.reg_name = "MIB_RX_FCS_ERR_PKTS",
		.reg_offset_group = {37, 36},
		.group_size = 2
	}, {
		.reg_name = "IGU_EGU_AUTO_GATE_EN",
		.reg_offset_group = {42},
		.group_size = 1
	}, {
		.reg_name = "IGU_EGU_INT_SRC",
		.reg_offset_group = {43},
		.group_size = 1
	}, {
		.reg_name = "EGU_READY_NUM_CFG",
		.reg_offset_group = {44},
		.group_size = 1
	}, {
		.reg_name = "IGU_EGU_TNL_DFX",
		.reg_offset_group = {45},
		.group_size = 1
	}, {
		.reg_name = "TX_TNL_NOTE_PKT",
		.reg_offset_group = {46},
		.group_size = 1
	}
};

static const struct hclge_mod_reg_common_msg hclge_ssu_reg_common_msg[] = {
	{
		.cmd = HCLGE_OPC_DFX_SSU_REG_0,
		.result_regs = hclge_ssu_reg_0_info,
		.bd_num = HCLGE_BD_NUM_SSU_REG_0,
		.result_regs_size = ARRAY_SIZE(hclge_ssu_reg_0_info)
	}, {
		.cmd = HCLGE_OPC_DFX_SSU_REG_1,
		.result_regs = hclge_ssu_reg_1_info,
		.bd_num = HCLGE_BD_NUM_SSU_REG_1,
		.result_regs_size = ARRAY_SIZE(hclge_ssu_reg_1_info)
	}, {
		.cmd = HCLGE_OPC_DFX_RPU_REG_0,
		.result_regs = hclge_rpu_reg_0_info,
		.bd_num = HCLGE_BD_NUM_RPU_REG_0,
		.result_regs_size = ARRAY_SIZE(hclge_rpu_reg_0_info),
		.need_para = true
	}, {
		.cmd = HCLGE_OPC_DFX_RPU_REG_1,
		.result_regs = hclge_rpu_reg_1_info,
		.bd_num = HCLGE_BD_NUM_RPU_REG_1,
		.result_regs_size = ARRAY_SIZE(hclge_rpu_reg_1_info)
	}, {
		.cmd = HCLGE_OPC_DFX_IGU_EGU_REG,
		.result_regs = hclge_igu_egu_reg_info,
		.bd_num = HCLGE_BD_NUM_IGU_EGU_REG,
		.result_regs_size = ARRAY_SIZE(hclge_igu_egu_reg_info)
	}, {
		.cmd = HCLGE_OPC_DFX_GEN_REG,
		.result_regs = hclge_gen_reg_info_tnl,
		.bd_num = HCLGE_BD_NUM_GEN_REG,
		.result_regs_size = ARRAY_SIZE(hclge_gen_reg_info_tnl),
		.need_para = true
	}, {
		.cmd = HCLGE_OPC_DFX_GEN_REG,
		.result_regs = hclge_gen_reg_info,
		.bd_num = HCLGE_BD_NUM_GEN_REG,
		.result_regs_size = ARRAY_SIZE(hclge_gen_reg_info)
	}
};

static int
hclge_print_mod_reg_info(struct device *dev, struct hclge_desc *desc,
			 const struct hclge_mod_reg_info *reg_info, int size)
{
	int i, j, pos, actual_len;
	u8 offset, bd_idx, index;
	char *buf;

	buf = kzalloc(HCLGE_MOD_REG_INFO_LEN_MAX, GFP_KERNEL);
	if (!buf)
		return -ENOMEM;

	for (i = 0; i < size; i++) {
		actual_len = strlen(reg_info[i].reg_name) +
			     HCLGE_MOD_REG_EXTRA_LEN +
			     HCLGE_MOD_REG_VALUE_LEN * reg_info[i].group_size;
		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;
	u32 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 = hdev->ae_dev->dev_specs.tnl_num;
			for (j = 0; j < loop_time; j++)
				loop_para[j] = j + 1;
		}
		hclge_query_reg_info(hdev, &msg, loop_time, loop_para);
	}
}

static const struct hclge_hw_module_id hclge_hw_module_id_st[] = {
	{
		.module_id = MODULE_NONE,
		.msg = "MODULE_NONE"
	}, {
		.module_id = MODULE_BIOS_COMMON,
		.msg = "MODULE_BIOS_COMMON"
	}, {
		.module_id = MODULE_GE,
		.msg = "MODULE_GE"
	}, {
		.module_id = MODULE_IGU_EGU,
		.msg = "MODULE_IGU_EGU",
		.query_reg_info = hclge_query_reg_info_of_ssu
	}, {
		.module_id = MODULE_LGE,
		.msg = "MODULE_LGE"
	}, {
		.module_id = MODULE_NCSI,
		.msg = "MODULE_NCSI"
	}, {
		.module_id = MODULE_PPP,
		.msg = "MODULE_PPP"
	}, {
		.module_id = MODULE_QCN,
		.msg = "MODULE_QCN"
	}, {
		.module_id = MODULE_RCB_RX,
		.msg = "MODULE_RCB_RX"
	}, {
		.module_id = MODULE_RTC,
		.msg = "MODULE_RTC"
	}, {
		.module_id = MODULE_SSU,
		.msg = "MODULE_SSU",
		.query_reg_info = hclge_query_reg_info_of_ssu
	}, {
		.module_id = MODULE_TM,
		.msg = "MODULE_TM"
	}, {
		.module_id = MODULE_RCB_TX,
		.msg = "MODULE_RCB_TX"
	}, {
		.module_id = MODULE_TXDMA,
		.msg = "MODULE_TXDMA"
	}, {
		.module_id = MODULE_MASTER,
		.msg = "MODULE_MASTER"
	}, {
		.module_id = MODULE_HIMAC,
		.msg = "MODULE_HIMAC"
	}, {
		.module_id = MODULE_ROCEE_TOP,
		.msg = "MODULE_ROCEE_TOP"
	}, {
		.module_id = MODULE_ROCEE_TIMER,
		.msg = "MODULE_ROCEE_TIMER"
	}, {
		.module_id = MODULE_ROCEE_MDB,
		.msg = "MODULE_ROCEE_MDB"
	}, {
		.module_id = MODULE_ROCEE_TSP,
		.msg = "MODULE_ROCEE_TSP"
	}, {
		.module_id = MODULE_ROCEE_TRP,
		.msg = "MODULE_ROCEE_TRP"
	}, {
		.module_id = MODULE_ROCEE_SCC,
		.msg = "MODULE_ROCEE_SCC"
	}, {
		.module_id = MODULE_ROCEE_CAEP,
		.msg = "MODULE_ROCEE_CAEP"
	}, {
		.module_id = MODULE_ROCEE_GEN_AC,
		.msg = "MODULE_ROCEE_GEN_AC"
	}, {
		.module_id = MODULE_ROCEE_QMM,
		.msg = "MODULE_ROCEE_QMM"
	}, {
		.module_id = MODULE_ROCEE_LSAN,
		.msg = "MODULE_ROCEE_LSAN"
	}
};

static const struct hclge_hw_type_id hclge_hw_type_id_st[] = {
	{
		.type_id = NONE_ERROR,
		.msg = "none_error"
	}, {
		.type_id = FIFO_ERROR,
		.msg = "fifo_error"
	}, {
		.type_id = MEMORY_ERROR,
		.msg = "memory_error"
	}, {
		.type_id = POISON_ERROR,
		.msg = "poison_error"
	}, {
		.type_id = MSIX_ECC_ERROR,
		.msg = "msix_ecc_error"
	}, {
		.type_id = TQP_INT_ECC_ERROR,
		.msg = "tqp_int_ecc_error"
	}, {
		.type_id = PF_ABNORMAL_INT_ERROR,
		.msg = "pf_abnormal_int_error",
		.cause_by_vf = true
	}, {
		.type_id = MPF_ABNORMAL_INT_ERROR,
		.msg = "mpf_abnormal_int_error",
		.cause_by_vf = true
	}, {
		.type_id = COMMON_ERROR,
		.msg = "common_error"
	}, {
		.type_id = PORT_ERROR,
		.msg = "port_error"
	}, {
		.type_id = ETS_ERROR,
		.msg = "ets_error"
	}, {
		.type_id = NCSI_ERROR,
		.msg = "ncsi_error"
	}, {
		.type_id = GLB_ERROR,
		.msg = "glb_error"
	}, {
		.type_id = LINK_ERROR,
		.msg = "link_error"
	}, {
		.type_id = PTP_ERROR,
		.msg = "ptp_error"
	}, {
		.type_id = ROCEE_NORMAL_ERR,
		.msg = "rocee_normal_error"
	}, {
		.type_id = ROCEE_OVF_ERR,
		.msg = "rocee_ovf_error"
	}, {
		.type_id = ROCEE_BUS_ERR,
		.msg = "rocee_bus_error"
	},
};

static void hclge_log_error(struct device *dev, char *reg,
			    const struct hclge_hw_error *err,
			    u32 err_sts, unsigned long *reset_requests)
{
	while (err->msg) {
		if (err->int_msk & err_sts) {
			dev_err(dev, "%s %s found [error status=0x%x]\n",
				reg, err->msg, err_sts);
			if (err->reset_level &&
			    err->reset_level != HNAE3_NONE_RESET)
				set_bit(err->reset_level, reset_requests);
		}
		err++;
	}
}

/* hclge_cmd_query_error: read the error information
 * @hdev: pointer to struct hclge_dev
 * @desc: descriptor for describing the command
 * @cmd:  command opcode
 * @flag: flag for extended command structure
 *
 * This function query the error info from hw register/s using command
 */
static int hclge_cmd_query_error(struct hclge_dev *hdev,
				 struct hclge_desc *desc, u32 cmd, u16 flag)
{
	struct device *dev = &hdev->pdev->dev;
	int desc_num = 1;
	int ret;

	hclge_cmd_setup_basic_desc(&desc[0], cmd, true);
	if (flag) {
		desc[0].flag |= cpu_to_le16(flag);
		hclge_cmd_setup_basic_desc(&desc[1], cmd, true);
		desc_num = 2;
	}

	ret = hclge_cmd_send(&hdev->hw, &desc[0], desc_num);
	if (ret)
		dev_err(dev, "query error cmd failed (%d)\n", ret);

	return ret;
}

static int hclge_clear_mac_tnl_int(struct hclge_dev *hdev)
{
	struct hclge_desc desc;

	hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_CLEAR_MAC_TNL_INT, false);
	desc.data[0] = cpu_to_le32(HCLGE_MAC_TNL_INT_CLR);

	return hclge_cmd_send(&hdev->hw, &desc, 1);
}

static int hclge_config_common_hw_err_int(struct hclge_dev *hdev, bool en)
{
	struct device *dev = &hdev->pdev->dev;
	struct hclge_desc desc[2];
	int ret;

	/* configure common error interrupts */
	hclge_cmd_setup_basic_desc(&desc[0], HCLGE_COMMON_ECC_INT_CFG, false);
	desc[0].flag |= cpu_to_le16(HCLGE_COMM_CMD_FLAG_NEXT);
	hclge_cmd_setup_basic_desc(&desc[1], HCLGE_COMMON_ECC_INT_CFG, false);

	if (en) {
		desc[0].data[0] = cpu_to_le32(HCLGE_IMP_TCM_ECC_ERR_INT_EN);
		desc[0].data[2] = cpu_to_le32(HCLGE_CMDQ_NIC_ECC_ERR_INT_EN |
					HCLGE_CMDQ_ROCEE_ECC_ERR_INT_EN);
		desc[0].data[3] = cpu_to_le32(HCLGE_IMP_RD_POISON_ERR_INT_EN);
		desc[0].data[4] = cpu_to_le32(HCLGE_TQP_ECC_ERR_INT_EN |
					      HCLGE_MSIX_SRAM_ECC_ERR_INT_EN);
		desc[0].data[5] = cpu_to_le32(HCLGE_IMP_ITCM4_ECC_ERR_INT_EN);
	}

	desc[1].data[0] = cpu_to_le32(HCLGE_IMP_TCM_ECC_ERR_INT_EN_MASK);
	desc[1].data[2] = cpu_to_le32(HCLGE_CMDQ_NIC_ECC_ERR_INT_EN_MASK |
				HCLGE_CMDQ_ROCEE_ECC_ERR_INT_EN_MASK);
	desc[1].data[3] = cpu_to_le32(HCLGE_IMP_RD_POISON_ERR_INT_EN_MASK);
	desc[1].data[4] = cpu_to_le32(HCLGE_TQP_ECC_ERR_INT_EN_MASK |
				      HCLGE_MSIX_SRAM_ECC_ERR_INT_EN_MASK);
	desc[1].data[5] = cpu_to_le32(HCLGE_IMP_ITCM4_ECC_ERR_INT_EN_MASK);

	ret = hclge_cmd_send(&hdev->hw, &desc[0], 2);
	if (ret)
		dev_err(dev,
			"fail(%d) to configure common err interrupts\n", ret);

	return ret;
}

static int hclge_config_ncsi_hw_err_int(struct hclge_dev *hdev, bool en)
{
	struct device *dev = &hdev->pdev->dev;
	struct hclge_desc desc;
	int ret;

	if (hdev->ae_dev->dev_version < HNAE3_DEVICE_VERSION_V2)
		return 0;

	/* configure NCSI error interrupts */
	hclge_cmd_setup_basic_desc(&desc, HCLGE_NCSI_INT_EN, false);
	if (en)
		desc.data[0] = cpu_to_le32(HCLGE_NCSI_ERR_INT_EN);

	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
	if (ret)
		dev_err(dev,
			"fail(%d) to configure  NCSI error interrupts\n", ret);

	return ret;
}

static int hclge_config_igu_egu_hw_err_int(struct hclge_dev *hdev, bool en)
{
	struct device *dev = &hdev->pdev->dev;
	struct hclge_desc desc;
	int ret;

	/* configure IGU,EGU error interrupts */
	hclge_cmd_setup_basic_desc(&desc, HCLGE_IGU_COMMON_INT_EN, false);
	desc.data[0] = cpu_to_le32(HCLGE_IGU_ERR_INT_TYPE);
	if (en)
		desc.data[0] |= cpu_to_le32(HCLGE_IGU_ERR_INT_EN);

	desc.data[1] = cpu_to_le32(HCLGE_IGU_ERR_INT_EN_MASK);

	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
	if (ret) {
		dev_err(dev,
			"fail(%d) to configure IGU common interrupts\n", ret);
		return ret;
	}

	hclge_cmd_setup_basic_desc(&desc, HCLGE_IGU_EGU_TNL_INT_EN, false);
	if (en)
		desc.data[0] = cpu_to_le32(HCLGE_IGU_TNL_ERR_INT_EN);

	desc.data[1] = cpu_to_le32(HCLGE_IGU_TNL_ERR_INT_EN_MASK);

	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
	if (ret) {
		dev_err(dev,
			"fail(%d) to configure IGU-EGU TNL interrupts\n", ret);
		return ret;
	}

	ret = hclge_config_ncsi_hw_err_int(hdev, en);

	return ret;
}

static int hclge_config_ppp_error_interrupt(struct hclge_dev *hdev, u32 cmd,
					    bool en)
{
	struct device *dev = &hdev->pdev->dev;
	struct hclge_desc desc[2];
	int ret;

	/* configure PPP error interrupts */
	hclge_cmd_setup_basic_desc(&desc[0], cmd, false);
	desc[0].flag |= cpu_to_le16(HCLGE_COMM_CMD_FLAG_NEXT);
	hclge_cmd_setup_basic_desc(&desc[1], cmd, false);

	if (cmd == HCLGE_PPP_CMD0_INT_CMD) {
		if (en) {
			desc[0].data[0] =
				cpu_to_le32(HCLGE_PPP_MPF_ECC_ERR_INT0_EN);
			desc[0].data[1] =
				cpu_to_le32(HCLGE_PPP_MPF_ECC_ERR_INT1_EN);
			desc[0].data[4] = cpu_to_le32(HCLGE_PPP_PF_ERR_INT_EN);
		}

		desc[1].data[0] =
			cpu_to_le32(HCLGE_PPP_MPF_ECC_ERR_INT0_EN_MASK);
		desc[1].data[1] =
			cpu_to_le32(HCLGE_PPP_MPF_ECC_ERR_INT1_EN_MASK);
		if (hdev->ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V2)
			desc[1].data[2] =
				cpu_to_le32(HCLGE_PPP_PF_ERR_INT_EN_MASK);
	} else if (cmd == HCLGE_PPP_CMD1_INT_CMD) {
		if (en) {
			desc[0].data[0] =
				cpu_to_le32(HCLGE_PPP_MPF_ECC_ERR_INT2_EN);
			desc[0].data[1] =
				cpu_to_le32(HCLGE_PPP_MPF_ECC_ERR_INT3_EN);
		}

		desc[1].data[0] =
				cpu_to_le32(HCLGE_PPP_MPF_ECC_ERR_INT2_EN_MASK);
		desc[1].data[1] =
				cpu_to_le32(HCLGE_PPP_MPF_ECC_ERR_INT3_EN_MASK);
	}

	ret = hclge_cmd_send(&hdev->hw, &desc[0], 2);
	if (ret)
		dev_err(dev, "fail(%d) to configure PPP error intr\n", ret);

	return ret;
}

static int hclge_config_ppp_hw_err_int(struct hclge_dev *hdev, bool en)
{
	int ret;

	ret = hclge_config_ppp_error_interrupt(hdev, HCLGE_PPP_CMD0_INT_CMD,
					       en);
	if (ret)
		return ret;

	ret = hclge_config_ppp_error_interrupt(hdev, HCLGE_PPP_CMD1_INT_CMD,
					       en);

	return ret;
}

static int hclge_config_tm_hw_err_int(struct hclge_dev *hdev, bool en)
{
	struct device *dev = &hdev->pdev->dev;
	struct hclge_desc desc;
	int ret;

	/* configure TM SCH hw errors */
	hclge_cmd_setup_basic_desc(&desc, HCLGE_TM_SCH_ECC_INT_EN, false);
	if (en)
		desc.data[0] = cpu_to_le32(HCLGE_TM_SCH_ECC_ERR_INT_EN);

	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
	if (ret) {
		dev_err(dev, "fail(%d) to configure TM SCH errors\n", ret);
		return ret;
	}

	/* configure TM QCN hw errors */
	hclge_cmd_setup_basic_desc(&desc, HCLGE_TM_QCN_MEM_INT_CFG, false);
	desc.data[0] = cpu_to_le32(HCLGE_TM_QCN_ERR_INT_TYPE);
	if (en) {
		desc.data[0] |= cpu_to_le32(HCLGE_TM_QCN_FIFO_INT_EN);
		desc.data[1] = cpu_to_le32(HCLGE_TM_QCN_MEM_ERR_INT_EN);
	}

	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
	if (ret)
		dev_err(dev,
			"fail(%d) to configure TM QCN mem errors\n", ret);

	return ret;
}

static int hclge_config_mac_err_int(struct hclge_dev *hdev, bool en)
{
	struct device *dev = &hdev->pdev->dev;
	struct hclge_desc desc;
	int ret;

	/* configure MAC common error interrupts */
	hclge_cmd_setup_basic_desc(&desc, HCLGE_MAC_COMMON_INT_EN, false);
	if (en)
		desc.data[0] = cpu_to_le32(HCLGE_MAC_COMMON_ERR_INT_EN);

	desc.data[1] = cpu_to_le32(HCLGE_MAC_COMMON_ERR_INT_EN_MASK);

	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
	if (ret)
		dev_err(dev,
			"fail(%d) to configure MAC COMMON error intr\n", ret);

	return ret;
}

int hclge_config_mac_tnl_int(struct hclge_dev *hdev, bool en)
{
	struct hclge_desc desc;

	hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_MAC_TNL_INT_EN, false);
	if (en)
		desc.data[0] = cpu_to_le32(HCLGE_MAC_TNL_INT_EN);
	else
		desc.data[0] = 0;

	desc.data[1] = cpu_to_le32(HCLGE_MAC_TNL_INT_EN_MASK);

	return hclge_cmd_send(&hdev->hw, &desc, 1);
}

static int hclge_config_ppu_error_interrupts(struct hclge_dev *hdev, u32 cmd,
					     bool en)
{
	struct device *dev = &hdev->pdev->dev;
	struct hclge_desc desc[2];
	int desc_num = 1;
	int ret;

	/* configure PPU error interrupts */
	if (cmd == HCLGE_PPU_MPF_ECC_INT_CMD) {
		hclge_cmd_setup_basic_desc(&desc[0], cmd, false);
		desc[0].flag |= cpu_to_le16(HCLGE_COMM_CMD_FLAG_NEXT);
		hclge_cmd_setup_basic_desc(&desc[1], cmd, false);
		if (en) {
			desc[0].data[0] =
				cpu_to_le32(HCLGE_PPU_MPF_ABNORMAL_INT0_EN);
			desc[0].data[1] =
				cpu_to_le32(HCLGE_PPU_MPF_ABNORMAL_INT1_EN);
			desc[1].data[3] =
				cpu_to_le32(HCLGE_PPU_MPF_ABNORMAL_INT3_EN);
			desc[1].data[4] =
				cpu_to_le32(HCLGE_PPU_MPF_ABNORMAL_INT2_EN);
		}

		desc[1].data[0] =
			cpu_to_le32(HCLGE_PPU_MPF_ABNORMAL_INT0_EN_MASK);
		desc[1].data[1] =
			cpu_to_le32(HCLGE_PPU_MPF_ABNORMAL_INT1_EN_MASK);
		desc[1].data[2] =
			cpu_to_le32(HCLGE_PPU_MPF_ABNORMAL_INT2_EN_MASK);
		desc[1].data[3] |=
			cpu_to_le32(HCLGE_PPU_MPF_ABNORMAL_INT3_EN_MASK);
		desc_num = 2;
	} else if (cmd == HCLGE_PPU_MPF_OTHER_INT_CMD) {
		hclge_cmd_setup_basic_desc(&desc[0], cmd, false);
		if (en)
			desc[0].data[0] =
				cpu_to_le32(HCLGE_PPU_MPF_ABNORMAL_INT2_EN2);

		desc[0].data[2] =
			cpu_to_le32(HCLGE_PPU_MPF_ABNORMAL_INT2_EN2_MASK);
	} else if (cmd == HCLGE_PPU_PF_OTHER_INT_CMD) {
		hclge_cmd_setup_basic_desc(&desc[0], cmd, false);
		if (en)
			desc[0].data[0] =
				cpu_to_le32(HCLGE_PPU_PF_ABNORMAL_INT_EN);

		desc[0].data[2] =
			cpu_to_le32(HCLGE_PPU_PF_ABNORMAL_INT_EN_MASK);
	} else {
		dev_err(dev, "Invalid cmd to configure PPU error interrupts\n");
		return -EINVAL;
	}

	ret = hclge_cmd_send(&hdev->hw, &desc[0], desc_num);

	return ret;
}

static int hclge_config_ppu_hw_err_int(struct hclge_dev *hdev, bool en)
{
	struct device *dev = &hdev->pdev->dev;
	int ret;

	ret = hclge_config_ppu_error_interrupts(hdev, HCLGE_PPU_MPF_ECC_INT_CMD,
						en);
	if (ret) {
		dev_err(dev, "fail(%d) to configure PPU MPF ECC error intr\n",
			ret);
		return ret;
	}

	ret = hclge_config_ppu_error_interrupts(hdev,
						HCLGE_PPU_MPF_OTHER_INT_CMD,
						en);
	if (ret) {
		dev_err(dev, "fail(%d) to configure PPU MPF other intr\n", ret);
		return ret;
	}

	ret = hclge_config_ppu_error_interrupts(hdev,
						HCLGE_PPU_PF_OTHER_INT_CMD, en);
	if (ret)
		dev_err(dev, "fail(%d) to configure PPU PF error interrupts\n",
			ret);
	return ret;
}

static int hclge_config_ssu_hw_err_int(struct hclge_dev *hdev, bool en)
{
	struct device *dev = &hdev->pdev->dev;
	struct hclge_desc desc[2];
	int ret;

	/* configure SSU ecc error interrupts */
	hclge_cmd_setup_basic_desc(&desc[0], HCLGE_SSU_ECC_INT_CMD, false);
	desc[0].flag |= cpu_to_le16(HCLGE_COMM_CMD_FLAG_NEXT);
	hclge_cmd_setup_basic_desc(&desc[1], HCLGE_SSU_ECC_INT_CMD, false);
	if (en) {
		desc[0].data[0] = cpu_to_le32(HCLGE_SSU_1BIT_ECC_ERR_INT_EN);
		desc[0].data[1] =
			cpu_to_le32(HCLGE_SSU_MULTI_BIT_ECC_ERR_INT_EN);
		desc[0].data[4] = cpu_to_le32(HCLGE_SSU_BIT32_ECC_ERR_INT_EN);
	}

	desc[1].data[0] = cpu_to_le32(HCLGE_SSU_1BIT_ECC_ERR_INT_EN_MASK);
	desc[1].data[1] = cpu_to_le32(HCLGE_SSU_MULTI_BIT_ECC_ERR_INT_EN_MASK);
	desc[1].data[2] = cpu_to_le32(HCLGE_SSU_BIT32_ECC_ERR_INT_EN_MASK);

	ret = hclge_cmd_send(&hdev->hw, &desc[0], 2);
	if (ret) {
		dev_err(dev,
			"fail(%d) to configure SSU ECC error interrupt\n", ret);
		return ret;
	}

	/* configure SSU common error interrupts */
	hclge_cmd_setup_basic_desc(&desc[0], HCLGE_SSU_COMMON_INT_CMD, false);
	desc[0].flag |= cpu_to_le16(HCLGE_COMM_CMD_FLAG_NEXT);
	hclge_cmd_setup_basic_desc(&desc[1], HCLGE_SSU_COMMON_INT_CMD, false);

	if (en) {
		if (hdev->ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V2)
			desc[0].data[0] =
				cpu_to_le32(HCLGE_SSU_COMMON_INT_EN);
		else
			desc[0].data[0] =
				cpu_to_le32(HCLGE_SSU_COMMON_INT_EN & ~BIT(5));
		desc[0].data[1] = cpu_to_le32(HCLGE_SSU_PORT_BASED_ERR_INT_EN);
		desc[0].data[2] =
			cpu_to_le32(HCLGE_SSU_FIFO_OVERFLOW_ERR_INT_EN);
	}

	desc[1].data[0] = cpu_to_le32(HCLGE_SSU_COMMON_INT_EN_MASK |
				HCLGE_SSU_PORT_BASED_ERR_INT_EN_MASK);
	desc[1].data[1] = cpu_to_le32(HCLGE_SSU_FIFO_OVERFLOW_ERR_INT_EN_MASK);

	ret = hclge_cmd_send(&hdev->hw, &desc[0], 2);
	if (ret)
		dev_err(dev,
			"fail(%d) to configure SSU COMMON error intr\n", ret);

	return ret;
}

/* hclge_query_bd_num: query number of buffer descriptors
 * @hdev: pointer to struct hclge_dev
 * @is_ras: true for ras, false for msix
 * @mpf_bd_num: number of main PF interrupt buffer descriptors
 * @pf_bd_num: number of not main PF interrupt buffer descriptors
 *
 * This function querys number of mpf and pf buffer descriptors.
 */
static int hclge_query_bd_num(struct hclge_dev *hdev, bool is_ras,
			      u32 *mpf_bd_num, u32 *pf_bd_num)
{
	struct device *dev = &hdev->pdev->dev;
	u32 mpf_min_bd_num, pf_min_bd_num;
	enum hclge_opcode_type opcode;
	struct hclge_desc desc_bd;
	int ret;

	if (is_ras) {
		opcode = HCLGE_QUERY_RAS_INT_STS_BD_NUM;
		mpf_min_bd_num = HCLGE_MPF_RAS_INT_MIN_BD_NUM;
		pf_min_bd_num = HCLGE_PF_RAS_INT_MIN_BD_NUM;
	} else {
		opcode = HCLGE_QUERY_MSIX_INT_STS_BD_NUM;
		mpf_min_bd_num = HCLGE_MPF_MSIX_INT_MIN_BD_NUM;
		pf_min_bd_num = HCLGE_PF_MSIX_INT_MIN_BD_NUM;
	}

	hclge_cmd_setup_basic_desc(&desc_bd, opcode, true);
	ret = hclge_cmd_send(&hdev->hw, &desc_bd, 1);
	if (ret) {
		dev_err(dev, "fail(%d) to query msix int status bd num\n",
			ret);
		return ret;
	}

	*mpf_bd_num = le32_to_cpu(desc_bd.data[0]);
	*pf_bd_num = le32_to_cpu(desc_bd.data[1]);
	if (*mpf_bd_num < mpf_min_bd_num || *pf_bd_num < pf_min_bd_num) {
		dev_err(dev, "Invalid bd num: mpf(%u), pf(%u)\n",
			*mpf_bd_num, *pf_bd_num);
		return -EINVAL;
	}

	return 0;
}

/* hclge_handle_mpf_ras_error: handle all main PF RAS errors
 * @hdev: pointer to struct hclge_dev
 * @desc: descriptor for describing the command
 * @num:  number of extended command structures
 *
 * This function handles all the main PF RAS errors in the
 * hw register/s using command.
 */
static int hclge_handle_mpf_ras_error(struct hclge_dev *hdev,
				      struct hclge_desc *desc,
				      int num)
{
	struct hnae3_ae_dev *ae_dev = hdev->ae_dev;
	struct device *dev = &hdev->pdev->dev;
	__le32 *desc_data;
	u32 status;
	int ret;

	/* query all main PF RAS errors */
	hclge_cmd_setup_basic_desc(&desc[0], HCLGE_QUERY_CLEAR_MPF_RAS_INT,
				   true);
	ret = hclge_cmd_send(&hdev->hw, &desc[0], num);
	if (ret) {
		dev_err(dev, "query all mpf ras int cmd failed (%d)\n", ret);
		return ret;
	}

	/* log HNS common errors */
	status = le32_to_cpu(desc[0].data[0]);
	if (status)
		hclge_log_error(dev, "IMP_TCM_ECC_INT_STS",
				&hclge_imp_tcm_ecc_int[0], status,
				&ae_dev->hw_err_reset_req);

	status = le32_to_cpu(desc[0].data[1]);
	if (status)
		hclge_log_error(dev, "CMDQ_MEM_ECC_INT_STS",
				&hclge_cmdq_nic_mem_ecc_int[0], status,
				&ae_dev->hw_err_reset_req);

	if ((le32_to_cpu(desc[0].data[2])) & BIT(0))
		dev_warn(dev, "imp_rd_data_poison_err found\n");

	status = le32_to_cpu(desc[0].data[3]);
	if (status)
		hclge_log_error(dev, "TQP_INT_ECC_INT_STS",
				&hclge_tqp_int_ecc_int[0], status,
				&ae_dev->hw_err_reset_req);

	status = le32_to_cpu(desc[0].data[4]);
	if (status)
		hclge_log_error(dev, "MSIX_ECC_INT_STS",
				&hclge_msix_sram_ecc_int[0], status,
				&ae_dev->hw_err_reset_req);

	/* log SSU(Storage Switch Unit) errors */
	desc_data = (__le32 *)&desc[2];
	status = le32_to_cpu(*(desc_data + 2));
	if (status)
		hclge_log_error(dev, "SSU_ECC_MULTI_BIT_INT_0",
				&hclge_ssu_mem_ecc_err_int[0], status,
				&ae_dev->hw_err_reset_req);

	status = le32_to_cpu(*(desc_data + 3)) & BIT(0);
	if (status) {
		dev_err(dev, "SSU_ECC_MULTI_BIT_INT_1 ssu_mem32_ecc_mbit_err found [error status=0x%x]\n",
			status);
		set_bit(HNAE3_GLOBAL_RESET, &ae_dev->hw_err_reset_req);
	}

	status = le32_to_cpu(*(desc_data + 4)) & HCLGE_SSU_COMMON_ERR_INT_MASK;
	if (status)
		hclge_log_error(dev, "SSU_COMMON_ERR_INT",
				&hclge_ssu_com_err_int[0], status,
				&ae_dev->hw_err_reset_req);

	/* log IGU(Ingress Unit) errors */
	desc_data = (__le32 *)&desc[3];
	status = le32_to_cpu(*desc_data) & HCLGE_IGU_INT_MASK;
	if (status)
		hclge_log_error(dev, "IGU_INT_STS",
				&hclge_igu_int[0], status,
				&ae_dev->hw_err_reset_req);

	/* log PPP(Programmable Packet Process) errors */
	desc_data = (__le32 *)&desc[4];
	status = le32_to_cpu(*(desc_data + 1));
	if (status)
		hclge_log_error(dev, "PPP_MPF_ABNORMAL_INT_ST1",
				&hclge_ppp_mpf_abnormal_int_st1[0], status,
				&ae_dev->hw_err_reset_req);

	status = le32_to_cpu(*(desc_data + 3)) & HCLGE_PPP_MPF_INT_ST3_MASK;
	if (status)
		hclge_log_error(dev, "PPP_MPF_ABNORMAL_INT_ST3",
				&hclge_ppp_mpf_abnormal_int_st3[0], status,
				&ae_dev->hw_err_reset_req);

	/* log PPU(RCB) errors */
	desc_data = (__le32 *)&desc[5];
	status = le32_to_cpu(*(desc_data + 1));
	if (status) {
		dev_err(dev,
			"PPU_MPF_ABNORMAL_INT_ST1 rpu_rx_pkt_ecc_mbit_err found\n");
		set_bit(HNAE3_GLOBAL_RESET, &ae_dev->hw_err_reset_req);
	}

	status = le32_to_cpu(*(desc_data + 2));
	if (status)
		hclge_log_error(dev, "PPU_MPF_ABNORMAL_INT_ST2",
				&hclge_ppu_mpf_abnormal_int_st2[0], status,
				&ae_dev->hw_err_reset_req);

	status = le32_to_cpu(*(desc_data + 3)) & HCLGE_PPU_MPF_INT_ST3_MASK;
	if (status)
		hclge_log_error(dev, "PPU_MPF_ABNORMAL_INT_ST3",
				&hclge_ppu_mpf_abnormal_int_st3[0], status,
				&ae_dev->hw_err_reset_req);

	/* log TM(Traffic Manager) errors */
	desc_data = (__le32 *)&desc[6];
	status = le32_to_cpu(*desc_data);
	if (status)
		hclge_log_error(dev, "TM_SCH_RINT",
				&hclge_tm_sch_rint[0], status,
				&ae_dev->hw_err_reset_req);

	/* log QCN(Quantized Congestion Control) errors */
	desc_data = (__le32 *)&desc[7];
	status = le32_to_cpu(*desc_data) & HCLGE_QCN_FIFO_INT_MASK;
	if (status)
		hclge_log_error(dev, "QCN_FIFO_RINT",
				&hclge_qcn_fifo_rint[0], status,
				&ae_dev->hw_err_reset_req);

	status = le32_to_cpu(*(desc_data + 1)) & HCLGE_QCN_ECC_INT_MASK;
	if (status)
		hclge_log_error(dev, "QCN_ECC_RINT",
				&hclge_qcn_ecc_rint[0], status,
				&ae_dev->hw_err_reset_req);

	/* log NCSI errors */
	desc_data = (__le32 *)&desc[9];
	status = le32_to_cpu(*desc_data) & HCLGE_NCSI_ECC_INT_MASK;
	if (status)
		hclge_log_error(dev, "NCSI_ECC_INT_RPT",
				&hclge_ncsi_err_int[0], status,
				&ae_dev->hw_err_reset_req);

	/* clear all main PF RAS errors */
	hclge_comm_cmd_reuse_desc(&desc[0], false);
	ret = hclge_cmd_send(&hdev->hw, &desc[0], num);
	if (ret)
		dev_err(dev, "clear all mpf ras int cmd failed (%d)\n", ret);

	return ret;
}

/* hclge_handle_pf_ras_error: handle all PF RAS errors
 * @hdev: pointer to struct hclge_dev
 * @desc: descriptor for describing the command
 * @num:  number of extended command structures
 *
 * This function handles all the PF RAS errors in the
 * hw registers using command.
 */
static int hclge_handle_pf_ras_error(struct hclge_dev *hdev,
				     struct hclge_desc *desc,
				     int num)
{
	struct hnae3_ae_dev *ae_dev = hdev->ae_dev;
	struct device *dev = &hdev->pdev->dev;
	__le32 *desc_data;
	u32 status;
	int ret;

	/* query all PF RAS errors */
	hclge_cmd_setup_basic_desc(&desc[0], HCLGE_QUERY_CLEAR_PF_RAS_INT,
				   true);
	ret = hclge_cmd_send(&hdev->hw, &desc[0], num);
	if (ret) {
		dev_err(dev, "query all pf ras int cmd failed (%d)\n", ret);
		return ret;
	}

	/* log SSU(Storage Switch Unit) errors */
	status = le32_to_cpu(desc[0].data[0]);
	if (status)
		hclge_log_error(dev, "SSU_PORT_BASED_ERR_INT",
				&hclge_ssu_port_based_err_int[0], status,
				&ae_dev->hw_err_reset_req);

	status = le32_to_cpu(desc[0].data[1]);
	if (status)
		hclge_log_error(dev, "SSU_FIFO_OVERFLOW_INT",
				&hclge_ssu_fifo_overflow_int[0], status,
				&ae_dev->hw_err_reset_req);

	status = le32_to_cpu(desc[0].data[2]);
	if (status)
		hclge_log_error(dev, "SSU_ETS_TCG_INT",
				&hclge_ssu_ets_tcg_int[0], status,
				&ae_dev->hw_err_reset_req);

	/* log IGU(Ingress Unit) EGU(Egress Unit) TNL errors */
	desc_data = (__le32 *)&desc[1];
	status = le32_to_cpu(*desc_data) & HCLGE_IGU_EGU_TNL_INT_MASK;
	if (status)
		hclge_log_error(dev, "IGU_EGU_TNL_INT_STS",
				&hclge_igu_egu_tnl_int[0], status,
				&ae_dev->hw_err_reset_req);

	/* log PPU(RCB) errors */
	desc_data = (__le32 *)&desc[3];
	status = le32_to_cpu(*desc_data) & HCLGE_PPU_PF_INT_RAS_MASK;
	if (status) {
		hclge_log_error(dev, "PPU_PF_ABNORMAL_INT_ST0",
				&hclge_ppu_pf_abnormal_int[0], status,
				&ae_dev->hw_err_reset_req);
		hclge_report_hw_error(hdev, HNAE3_PPU_POISON_ERROR);
	}

	/* clear all PF RAS errors */
	hclge_comm_cmd_reuse_desc(&desc[0], false);
	ret = hclge_cmd_send(&hdev->hw, &desc[0], num);
	if (ret)
		dev_err(dev, "clear all pf ras int cmd failed (%d)\n", ret);

	return ret;
}

static int hclge_handle_all_ras_errors(struct hclge_dev *hdev)
{
	u32 mpf_bd_num, pf_bd_num, bd_num;
	struct hclge_desc *desc;
	int ret;

	/* query the number of registers in the RAS int status */
	ret = hclge_query_bd_num(hdev, true, &mpf_bd_num, &pf_bd_num);
	if (ret)
		return ret;

	bd_num = max_t(u32, mpf_bd_num, pf_bd_num);
	desc = kcalloc(bd_num, sizeof(struct hclge_desc), GFP_KERNEL);
	if (!desc)
		return -ENOMEM;

	/* handle all main PF RAS errors */
	ret = hclge_handle_mpf_ras_error(hdev, desc, mpf_bd_num);
	if (ret) {
		kfree(desc);
		return ret;
	}
	memset(desc, 0, bd_num * sizeof(struct hclge_desc));

	/* handle all PF RAS errors */
	ret = hclge_handle_pf_ras_error(hdev, desc, pf_bd_num);
	kfree(desc);

	return ret;
}

static int hclge_log_rocee_axi_error(struct hclge_dev *hdev)
{
	struct device *dev = &hdev->pdev->dev;
	struct hclge_desc desc[3];
	int ret;

	hclge_cmd_setup_basic_desc(&desc[0], HCLGE_QUERY_ROCEE_AXI_RAS_INFO_CMD,
				   true);
	hclge_cmd_setup_basic_desc(&desc[1], HCLGE_QUERY_ROCEE_AXI_RAS_INFO_CMD,
				   true);
	hclge_cmd_setup_basic_desc(&desc[2], HCLGE_QUERY_ROCEE_AXI_RAS_INFO_CMD,
				   true);
	desc[0].flag |= cpu_to_le16(HCLGE_COMM_CMD_FLAG_NEXT);
	desc[1].flag |= cpu_to_le16(HCLGE_COMM_CMD_FLAG_NEXT);

	ret = hclge_cmd_send(&hdev->hw, &desc[0], 3);
	if (ret) {
		dev_err(dev, "failed(%d) to query ROCEE AXI error sts\n", ret);
		return ret;
	}

	dev_err(dev, "AXI1: %08X %08X %08X %08X %08X %08X\n",
		le32_to_cpu(desc[0].data[0]), le32_to_cpu(desc[0].data[1]),
		le32_to_cpu(desc[0].data[2]), le32_to_cpu(desc[0].data[3]),
		le32_to_cpu(desc[0].data[4]), le32_to_cpu(desc[0].data[5]));
	dev_err(dev, "AXI2: %08X %08X %08X %08X %08X %08X\n",
		le32_to_cpu(desc[1].data[0]), le32_to_cpu(desc[1].data[1]),
		le32_to_cpu(desc[1].data[2]), le32_to_cpu(desc[1].data[3]),
		le32_to_cpu(desc[1].data[4]), le32_to_cpu(desc[1].data[5]));
	dev_err(dev, "AXI3: %08X %08X %08X %08X\n",
		le32_to_cpu(desc[2].data[0]), le32_to_cpu(desc[2].data[1]),
		le32_to_cpu(desc[2].data[2]), le32_to_cpu(desc[2].data[3]));

	return 0;
}

static int hclge_log_rocee_ecc_error(struct hclge_dev *hdev)
{
	struct device *dev = &hdev->pdev->dev;
	struct hclge_desc desc[2];
	int ret;

	ret = hclge_cmd_query_error(hdev, &desc[0],
				    HCLGE_QUERY_ROCEE_ECC_RAS_INFO_CMD,
				    HCLGE_COMM_CMD_FLAG_NEXT);
	if (ret) {
		dev_err(dev, "failed(%d) to query ROCEE ECC error sts\n", ret);
		return ret;
	}

	dev_err(dev, "ECC1: %08X %08X %08X %08X %08X %08X\n",
		le32_to_cpu(desc[0].data[0]), le32_to_cpu(desc[0].data[1]),
		le32_to_cpu(desc[0].data[2]), le32_to_cpu(desc[0].data[3]),
		le32_to_cpu(desc[0].data[4]), le32_to_cpu(desc[0].data[5]));
	dev_err(dev, "ECC2: %08X %08X %08X\n", le32_to_cpu(desc[1].data[0]),
		le32_to_cpu(desc[1].data[1]), le32_to_cpu(desc[1].data[2]));

	return 0;
}

static int hclge_log_rocee_ovf_error(struct hclge_dev *hdev)
{
	struct device *dev = &hdev->pdev->dev;
	struct hclge_desc desc[2];
	int ret;

	/* read overflow error status */
	ret = hclge_cmd_query_error(hdev, &desc[0], HCLGE_ROCEE_PF_RAS_INT_CMD,
				    0);
	if (ret) {
		dev_err(dev, "failed(%d) to query ROCEE OVF error sts\n", ret);
		return ret;
	}

	/* log overflow error */
	if (le32_to_cpu(desc[0].data[0]) & HCLGE_ROCEE_OVF_ERR_INT_MASK) {
		const struct hclge_hw_error *err;
		u32 err_sts;

		err = &hclge_rocee_qmm_ovf_err_int[0];
		err_sts = HCLGE_ROCEE_OVF_ERR_TYPE_MASK &
			  le32_to_cpu(desc[0].data[0]);
		while (err->msg) {
			if (err->int_msk == err_sts) {
				dev_err(dev, "%s [error status=0x%x] found\n",
					err->msg,
					le32_to_cpu(desc[0].data[0]));
				break;
			}
			err++;
		}
	}

	if (le32_to_cpu(desc[0].data[1]) & HCLGE_ROCEE_OVF_ERR_INT_MASK) {
		dev_err(dev, "ROCEE TSP OVF [error status=0x%x] found\n",
			le32_to_cpu(desc[0].data[1]));
	}

	if (le32_to_cpu(desc[0].data[2]) & HCLGE_ROCEE_OVF_ERR_INT_MASK) {
		dev_err(dev, "ROCEE SCC OVF [error status=0x%x] found\n",
			le32_to_cpu(desc[0].data[2]));
	}

	return 0;
}

static enum hnae3_reset_type
hclge_log_and_clear_rocee_ras_error(struct hclge_dev *hdev)
{
	enum hnae3_reset_type reset_type = HNAE3_NONE_RESET;
	struct device *dev = &hdev->pdev->dev;
	struct hclge_desc desc[2];
	unsigned int status;
	int ret;

	/* read RAS error interrupt status */
	ret = hclge_cmd_query_error(hdev, &desc[0],
				    HCLGE_QUERY_CLEAR_ROCEE_RAS_INT, 0);
	if (ret) {
		dev_err(dev, "failed(%d) to query ROCEE RAS INT SRC\n", ret);
		/* reset everything for now */
		return HNAE3_GLOBAL_RESET;
	}

	status = le32_to_cpu(desc[0].data[0]);
	if (status & HCLGE_ROCEE_AXI_ERR_INT_MASK) {
		if (status & HCLGE_ROCEE_RERR_INT_MASK)
			dev_err(dev, "ROCEE RAS AXI rresp error\n");

		if (status & HCLGE_ROCEE_BERR_INT_MASK)
			dev_err(dev, "ROCEE RAS AXI bresp error\n");

		reset_type = HNAE3_FUNC_RESET;

		hclge_report_hw_error(hdev, HNAE3_ROCEE_AXI_RESP_ERROR);

		ret = hclge_log_rocee_axi_error(hdev);
		if (ret)
			return HNAE3_GLOBAL_RESET;
	}

	if (status & HCLGE_ROCEE_ECC_INT_MASK) {
		dev_err(dev, "ROCEE RAS 2bit ECC error\n");
		reset_type = HNAE3_GLOBAL_RESET;

		ret = hclge_log_rocee_ecc_error(hdev);
		if (ret)
			return HNAE3_GLOBAL_RESET;
	}

	if (status & HCLGE_ROCEE_OVF_INT_MASK) {
		ret = hclge_log_rocee_ovf_error(hdev);
		if (ret) {
			dev_err(dev, "failed(%d) to process ovf error\n", ret);
			/* reset everything for now */
			return HNAE3_GLOBAL_RESET;
		}
	}

	/* clear error status */
	hclge_comm_cmd_reuse_desc(&desc[0], false);
	ret = hclge_cmd_send(&hdev->hw, &desc[0], 1);
	if (ret) {
		dev_err(dev, "failed(%d) to clear ROCEE RAS error\n", ret);
		/* reset everything for now */
		return HNAE3_GLOBAL_RESET;
	}

	return reset_type;
}

int hclge_config_rocee_ras_interrupt(struct hclge_dev *hdev, bool en)
{
	struct device *dev = &hdev->pdev->dev;
	struct hclge_desc desc;
	int ret;

	if (hdev->ae_dev->dev_version < HNAE3_DEVICE_VERSION_V2 ||
	    !hnae3_dev_roce_supported(hdev))
		return 0;

	hclge_cmd_setup_basic_desc(&desc, HCLGE_CONFIG_ROCEE_RAS_INT_EN, false);
	if (en) {
		/* enable ROCEE hw error interrupts */
		desc.data[0] = cpu_to_le32(HCLGE_ROCEE_RAS_NFE_INT_EN);
		desc.data[1] = cpu_to_le32(HCLGE_ROCEE_RAS_CE_INT_EN);

		hclge_log_and_clear_rocee_ras_error(hdev);
	}
	desc.data[2] = cpu_to_le32(HCLGE_ROCEE_RAS_NFE_INT_EN_MASK);
	desc.data[3] = cpu_to_le32(HCLGE_ROCEE_RAS_CE_INT_EN_MASK);

	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
	if (ret)
		dev_err(dev, "failed(%d) to config ROCEE RAS interrupt\n", ret);

	return ret;
}

static void hclge_handle_rocee_ras_error(struct hnae3_ae_dev *ae_dev)
{
	struct hclge_dev *hdev = ae_dev->priv;
	enum hnae3_reset_type reset_type;

	if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state))
		return;

	reset_type = hclge_log_and_clear_rocee_ras_error(hdev);
	if (reset_type != HNAE3_NONE_RESET)
		set_bit(reset_type, &ae_dev->hw_err_reset_req);
}

static const struct hclge_hw_blk hw_blk[] = {
	{
		.msk = BIT(0),
		.name = "IGU_EGU",
		.config_err_int = hclge_config_igu_egu_hw_err_int,
	}, {
		.msk = BIT(1),
		.name = "PPP",
		.config_err_int = hclge_config_ppp_hw_err_int,
	}, {
		.msk = BIT(2),
		.name = "SSU",
		.config_err_int = hclge_config_ssu_hw_err_int,
	}, {
		.msk = BIT(3),
		.name = "PPU",
		.config_err_int = hclge_config_ppu_hw_err_int,
	}, {
		.msk = BIT(4),
		.name = "TM",
		.config_err_int = hclge_config_tm_hw_err_int,
	}, {
		.msk = BIT(5),
		.name = "COMMON",
		.config_err_int = hclge_config_common_hw_err_int,
	}, {
		.msk = BIT(8),
		.name = "MAC",
		.config_err_int = hclge_config_mac_err_int,
	}, {
		/* sentinel */
	}
};

static void hclge_config_all_msix_error(struct hclge_dev *hdev, bool enable)
{
	u32 reg_val;

	reg_val = hclge_read_dev(&hdev->hw, HCLGE_PF_OTHER_INT_REG);

	if (enable)
		reg_val |= BIT(HCLGE_VECTOR0_ALL_MSIX_ERR_B);
	else
		reg_val &= ~BIT(HCLGE_VECTOR0_ALL_MSIX_ERR_B);

	hclge_write_dev(&hdev->hw, HCLGE_PF_OTHER_INT_REG, reg_val);
}

int hclge_config_nic_hw_error(struct hclge_dev *hdev, bool state)
{
	const struct hclge_hw_blk *module = hw_blk;
	int ret = 0;

	hclge_config_all_msix_error(hdev, state);

	while (module->name) {
		if (module->config_err_int) {
			ret = module->config_err_int(hdev, state);
			if (ret)
				return ret;
		}
		module++;
	}

	return ret;
}

pci_ers_result_t hclge_handle_hw_ras_error(struct hnae3_ae_dev *ae_dev)
{
	struct hclge_dev *hdev = ae_dev->priv;
	struct device *dev = &hdev->pdev->dev;
	u32 status;

	if (!test_bit(HCLGE_STATE_SERVICE_INITED, &hdev->state)) {
		dev_err(dev,
			"Can't recover - RAS error reported during dev init\n");
		return PCI_ERS_RESULT_NONE;
	}

	status = hclge_read_dev(&hdev->hw, HCLGE_RAS_PF_OTHER_INT_STS_REG);
	if (status & HCLGE_RAS_REG_NFE_MASK ||
	    status & HCLGE_RAS_REG_ROCEE_ERR_MASK)
		ae_dev->hw_err_reset_req = 0;
	else
		goto out;

	/* Handling Non-fatal HNS RAS errors */
	if (status & HCLGE_RAS_REG_NFE_MASK) {
		dev_err(dev,
			"HNS Non-Fatal RAS error(status=0x%x) identified\n",
			status);
		hclge_handle_all_ras_errors(hdev);
	}

	/* Handling Non-fatal Rocee RAS errors */
	if (hdev->ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V2 &&
	    status & HCLGE_RAS_REG_ROCEE_ERR_MASK) {
		dev_err(dev, "ROCEE Non-Fatal RAS error identified\n");
		hclge_handle_rocee_ras_error(ae_dev);
	}

	if (ae_dev->hw_err_reset_req)
		return PCI_ERS_RESULT_NEED_RESET;

out:
	return PCI_ERS_RESULT_RECOVERED;
}

static int hclge_clear_hw_msix_error(struct hclge_dev *hdev,
				     struct hclge_desc *desc, bool is_mpf,
				     u32 bd_num)
{
	if (is_mpf)
		desc[0].opcode =
			cpu_to_le16(HCLGE_QUERY_CLEAR_ALL_MPF_MSIX_INT);
	else
		desc[0].opcode = cpu_to_le16(HCLGE_QUERY_CLEAR_ALL_PF_MSIX_INT);

	desc[0].flag = cpu_to_le16(HCLGE_COMM_CMD_FLAG_NO_INTR |
				   HCLGE_COMM_CMD_FLAG_IN);

	return hclge_cmd_send(&hdev->hw, &desc[0], bd_num);
}

/* hclge_query_8bd_info: query information about over_8bd_nfe_err
 * @hdev: pointer to struct hclge_dev
 * @vf_id: Index of the virtual function with error
 * @q_id: Physical index of the queue with error
 *
 * This function get specific index of queue and function which causes
 * over_8bd_nfe_err by using command. If vf_id is 0, it means error is
 * caused by PF instead of VF.
 */
static int hclge_query_over_8bd_err_info(struct hclge_dev *hdev, u16 *vf_id,
					 u16 *q_id)
{
	struct hclge_query_ppu_pf_other_int_dfx_cmd *req;
	struct hclge_desc desc;
	int ret;

	hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_PPU_PF_OTHER_INT_DFX, true);
	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
	if (ret)
		return ret;

	req = (struct hclge_query_ppu_pf_other_int_dfx_cmd *)desc.data;
	*vf_id = le16_to_cpu(req->over_8bd_no_fe_vf_id);
	*q_id = le16_to_cpu(req->over_8bd_no_fe_qid);

	return 0;
}

/* hclge_handle_over_8bd_err: handle MSI-X error named over_8bd_nfe_err
 * @hdev: pointer to struct hclge_dev
 * @reset_requests: reset level that we need to trigger later
 *
 * over_8bd_nfe_err is a special MSI-X because it may caused by a VF, in
 * that case, we need to trigger VF reset. Otherwise, a PF reset is needed.
 */
static void hclge_handle_over_8bd_err(struct hclge_dev *hdev,
				      unsigned long *reset_requests)
{
	struct device *dev = &hdev->pdev->dev;
	u16 vf_id;
	u16 q_id;
	int ret;

	ret = hclge_query_over_8bd_err_info(hdev, &vf_id, &q_id);
	if (ret) {
		dev_err(dev, "fail(%d) to query over_8bd_no_fe info\n",
			ret);
		return;
	}

	dev_err(dev, "PPU_PF_ABNORMAL_INT_ST over_8bd_no_fe found, vport(%u), queue_id(%u)\n",
		vf_id, q_id);

	if (vf_id) {
		if (vf_id >= hdev->num_alloc_vport) {
			dev_err(dev, "invalid vport(%u)\n", vf_id);
			return;
		}

		/* If we need to trigger other reset whose level is higher
		 * than HNAE3_VF_FUNC_RESET, no need to trigger a VF reset
		 * here.
		 */
		if (*reset_requests != 0)
			return;

		ret = hclge_inform_reset_assert_to_vf(&hdev->vport[vf_id]);
		if (ret)
			dev_err(dev, "inform reset to vport(%u) failed %d!\n",
				vf_id, ret);
	} else {
		set_bit(HNAE3_FUNC_RESET, reset_requests);
	}
}

/* hclge_handle_mpf_msix_error: handle all main PF MSI-X errors
 * @hdev: pointer to struct hclge_dev
 * @desc: descriptor for describing the command
 * @mpf_bd_num: number of extended command structures
 * @reset_requests: record of the reset level that we need
 *
 * This function handles all the main PF MSI-X errors in the hw register/s
 * using command.
 */
static int hclge_handle_mpf_msix_error(struct hclge_dev *hdev,
				       struct hclge_desc *desc,
				       int mpf_bd_num,
				       unsigned long *reset_requests)
{
	struct device *dev = &hdev->pdev->dev;
	__le32 *desc_data;
	u32 status;
	int ret;
	/* query all main PF MSIx errors */
	hclge_cmd_setup_basic_desc(&desc[0], HCLGE_QUERY_CLEAR_ALL_MPF_MSIX_INT,
				   true);
	ret = hclge_cmd_send(&hdev->hw, &desc[0], mpf_bd_num);
	if (ret) {
		dev_err(dev, "query all mpf msix int cmd failed (%d)\n", ret);
		return ret;
	}

	/* log MAC errors */
	desc_data = (__le32 *)&desc[1];
	status = le32_to_cpu(*desc_data);
	if (status)
		hclge_log_error(dev, "MAC_AFIFO_TNL_INT_R",
				&hclge_mac_afifo_tnl_int[0], status,
				reset_requests);

	/* log PPU(RCB) MPF errors */
	desc_data = (__le32 *)&desc[5];
	status = le32_to_cpu(*(desc_data + 2)) &
			HCLGE_PPU_MPF_INT_ST2_MSIX_MASK;
	if (status)
		dev_err(dev, "PPU_MPF_ABNORMAL_INT_ST2 rx_q_search_miss found [dfx status=0x%x\n]",
			status);

	/* clear all main PF MSIx errors */
	ret = hclge_clear_hw_msix_error(hdev, desc, true, mpf_bd_num);
	if (ret)
		dev_err(dev, "clear all mpf msix int cmd failed (%d)\n", ret);

	return ret;
}

/* hclge_handle_pf_msix_error: handle all PF MSI-X errors
 * @hdev: pointer to struct hclge_dev
 * @desc: descriptor for describing the command
 * @mpf_bd_num: number of extended command structures
 * @reset_requests: record of the reset level that we need
 *
 * This function handles all the PF MSI-X errors in the hw register/s using
 * command.
 */
static int hclge_handle_pf_msix_error(struct hclge_dev *hdev,
				      struct hclge_desc *desc,
				      int pf_bd_num,
				      unsigned long *reset_requests)
{
	struct device *dev = &hdev->pdev->dev;
	__le32 *desc_data;
	u32 status;
	int ret;

	/* query all PF MSIx errors */
	hclge_cmd_setup_basic_desc(&desc[0], HCLGE_QUERY_CLEAR_ALL_PF_MSIX_INT,
				   true);
	ret = hclge_cmd_send(&hdev->hw, &desc[0], pf_bd_num);
	if (ret) {
		dev_err(dev, "query all pf msix int cmd failed (%d)\n", ret);
		return ret;
	}

	/* log SSU PF errors */
	status = le32_to_cpu(desc[0].data[0]) & HCLGE_SSU_PORT_INT_MSIX_MASK;
	if (status)
		hclge_log_error(dev, "SSU_PORT_BASED_ERR_INT",
				&hclge_ssu_port_based_pf_int[0],
				status, reset_requests);

	/* read and log PPP PF errors */
	desc_data = (__le32 *)&desc[2];
	status = le32_to_cpu(*desc_data);
	if (status)
		hclge_log_error(dev, "PPP_PF_ABNORMAL_INT_ST0",
				&hclge_ppp_pf_abnormal_int[0],
				status, reset_requests);

	/* log PPU(RCB) PF errors */
	desc_data = (__le32 *)&desc[3];
	status = le32_to_cpu(*desc_data) & HCLGE_PPU_PF_INT_MSIX_MASK;
	if (status)
		hclge_log_error(dev, "PPU_PF_ABNORMAL_INT_ST",
				&hclge_ppu_pf_abnormal_int[0],
				status, reset_requests);

	status = le32_to_cpu(*desc_data) & HCLGE_PPU_PF_OVER_8BD_ERR_MASK;
	if (status)
		hclge_handle_over_8bd_err(hdev, reset_requests);

	/* clear all PF MSIx errors */
	ret = hclge_clear_hw_msix_error(hdev, desc, false, pf_bd_num);
	if (ret)
		dev_err(dev, "clear all pf msix int cmd failed (%d)\n", ret);

	return ret;
}

static int hclge_handle_all_hw_msix_error(struct hclge_dev *hdev,
					  unsigned long *reset_requests)
{
	u32 mpf_bd_num, pf_bd_num, bd_num;
	struct hclge_desc *desc;
	int ret;

	/* query the number of bds for the MSIx int status */
	ret = hclge_query_bd_num(hdev, false, &mpf_bd_num, &pf_bd_num);
	if (ret)
		goto out;

	bd_num = max_t(u32, mpf_bd_num, pf_bd_num);
	desc = kcalloc(bd_num, sizeof(struct hclge_desc), GFP_KERNEL);
	if (!desc)
		return -ENOMEM;

	ret = hclge_handle_mpf_msix_error(hdev, desc, mpf_bd_num,
					  reset_requests);
	if (ret)
		goto msi_error;

	memset(desc, 0, bd_num * sizeof(struct hclge_desc));
	ret = hclge_handle_pf_msix_error(hdev, desc, pf_bd_num, reset_requests);
	if (ret)
		goto msi_error;

	ret = hclge_handle_mac_tnl(hdev);

msi_error:
	kfree(desc);
out:
	return ret;
}

int hclge_handle_hw_msix_error(struct hclge_dev *hdev,
			       unsigned long *reset_requests)
{
	struct device *dev = &hdev->pdev->dev;

	if (!test_bit(HCLGE_STATE_SERVICE_INITED, &hdev->state)) {
		dev_err(dev,
			"failed to handle msix error during dev init\n");
		return -EAGAIN;
	}

	return hclge_handle_all_hw_msix_error(hdev, reset_requests);
}

int hclge_handle_mac_tnl(struct hclge_dev *hdev)
{
	struct hclge_mac_tnl_stats mac_tnl_stats;
	struct device *dev = &hdev->pdev->dev;
	struct hclge_desc desc;
	u32 status;
	int ret;

	/* query and clear mac tnl interruptions */
	hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_QUERY_MAC_TNL_INT, true);
	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
	if (ret) {
		dev_err(dev, "failed to query mac tnl int, ret = %d.\n", ret);
		return ret;
	}

	status = le32_to_cpu(desc.data[0]);
	if (status) {
		/* When mac tnl interrupt occurs, we record current time and
		 * register status here in a fifo, then clear the status. So
		 * that if link status changes suddenly at some time, we can
		 * query them by debugfs.
		 */
		mac_tnl_stats.time = local_clock();
		mac_tnl_stats.status = status;
		kfifo_put(&hdev->mac_tnl_log, mac_tnl_stats);
		ret = hclge_clear_mac_tnl_int(hdev);
		if (ret)
			dev_err(dev, "failed to clear mac tnl int, ret = %d.\n",
				ret);
	}

	return ret;
}

void hclge_handle_all_hns_hw_errors(struct hnae3_ae_dev *ae_dev)
{
	struct hclge_dev *hdev = ae_dev->priv;
	struct device *dev = &hdev->pdev->dev;
	u32 mpf_bd_num, pf_bd_num, bd_num;
	struct hclge_desc *desc;
	u32 status;
	int ret;

	ae_dev->hw_err_reset_req = 0;
	status = hclge_read_dev(&hdev->hw, HCLGE_RAS_PF_OTHER_INT_STS_REG);

	/* query the number of bds for the MSIx int status */
	ret = hclge_query_bd_num(hdev, false, &mpf_bd_num, &pf_bd_num);
	if (ret)
		return;

	bd_num = max_t(u32, mpf_bd_num, pf_bd_num);
	desc = kcalloc(bd_num, sizeof(struct hclge_desc), GFP_KERNEL);
	if (!desc)
		return;

	/* Clear HNS hw errors reported through msix  */
	memset(&desc[0].data[0], 0xFF, mpf_bd_num * sizeof(struct hclge_desc) -
	       HCLGE_DESC_NO_DATA_LEN);
	ret = hclge_clear_hw_msix_error(hdev, desc, true, mpf_bd_num);
	if (ret) {
		dev_err(dev, "fail(%d) to clear mpf msix int during init\n",
			ret);
		goto msi_error;
	}

	memset(&desc[0].data[0], 0xFF, pf_bd_num * sizeof(struct hclge_desc) -
	       HCLGE_DESC_NO_DATA_LEN);
	ret = hclge_clear_hw_msix_error(hdev, desc, false, pf_bd_num);
	if (ret) {
		dev_err(dev, "fail(%d) to clear pf msix int during init\n",
			ret);
		goto msi_error;
	}

	/* Handle Non-fatal HNS RAS errors */
	if (status & HCLGE_RAS_REG_NFE_MASK) {
		dev_err(dev, "HNS hw error(RAS) identified during init\n");
		hclge_handle_all_ras_errors(hdev);
	}

msi_error:
	kfree(desc);
}

bool hclge_find_error_source(struct hclge_dev *hdev)
{
	u32 msix_src_flag, hw_err_src_flag;

	msix_src_flag = hclge_read_dev(&hdev->hw, HCLGE_MISC_VECTOR_INT_STS) &
			HCLGE_VECTOR0_REG_MSIX_MASK;

	hw_err_src_flag = hclge_read_dev(&hdev->hw,
					 HCLGE_RAS_PF_OTHER_INT_STS_REG) &
			  HCLGE_RAS_REG_ERR_MASK;

	return msix_src_flag || hw_err_src_flag;
}

void hclge_handle_occurred_error(struct hclge_dev *hdev)
{
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(hdev->pdev);

	if (hclge_find_error_source(hdev))
		hclge_handle_error_info_log(ae_dev);
}

static bool
hclge_handle_error_type_reg_log(struct hclge_dev *hdev,
				struct hclge_mod_err_info *mod_info,
				struct hclge_type_reg_err_info *type_reg_info)
{
#define HCLGE_ERR_TYPE_MASK 0x7F
#define HCLGE_ERR_TYPE_IS_RAS_OFFSET 7

	u8 mod_id, total_module, type_id, total_type, i, is_ras;
	struct device *dev = &hdev->pdev->dev;
	u8 index_module = MODULE_NONE;
	u8 index_type = NONE_ERROR;
	bool cause_by_vf = false;

	mod_id = mod_info->mod_id;
	type_id = type_reg_info->type_id & HCLGE_ERR_TYPE_MASK;
	is_ras = type_reg_info->type_id >> HCLGE_ERR_TYPE_IS_RAS_OFFSET;

	total_module = ARRAY_SIZE(hclge_hw_module_id_st);
	total_type = ARRAY_SIZE(hclge_hw_type_id_st);

	for (i = 0; i < total_module; i++) {
		if (mod_id == hclge_hw_module_id_st[i].module_id) {
			index_module = i;
			break;
		}
	}

	for (i = 0; i < total_type; i++) {
		if (type_id == hclge_hw_type_id_st[i].type_id) {
			index_type = i;
			cause_by_vf = hclge_hw_type_id_st[i].cause_by_vf;
			break;
		}
	}

	if (index_module != MODULE_NONE && index_type != NONE_ERROR)
		dev_err(dev,
			"found %s %s, is %s error.\n",
			hclge_hw_module_id_st[index_module].msg,
			hclge_hw_type_id_st[index_type].msg,
			is_ras ? "ras" : "msix");
	else
		dev_err(dev,
			"unknown module[%u] or type[%u].\n", mod_id, type_id);

	dev_err(dev, "reg_value:\n");
	for (i = 0; i < type_reg_info->reg_num; i++)
		dev_err(dev, "0x%08x\n", type_reg_info->hclge_reg[i]);

	if (hclge_hw_module_id_st[index_module].query_reg_info)
		hclge_hw_module_id_st[index_module].query_reg_info(hdev);

	return cause_by_vf;
}

static void hclge_handle_error_module_log(struct hnae3_ae_dev *ae_dev,
					  const u32 *buf, u32 buf_size)
{
	struct hclge_type_reg_err_info *type_reg_info;
	struct hclge_dev *hdev = ae_dev->priv;
	struct device *dev = &hdev->pdev->dev;
	struct hclge_mod_err_info *mod_info;
	struct hclge_sum_err_info *sum_info;
	bool cause_by_vf = false;
	u8 mod_num, err_num, i;
	u32 offset = 0;

	sum_info = (struct hclge_sum_err_info *)&buf[offset++];
	if (sum_info->reset_type &&
	    sum_info->reset_type != HNAE3_NONE_RESET)
		set_bit(sum_info->reset_type, &ae_dev->hw_err_reset_req);
	mod_num = sum_info->mod_num;

	while (mod_num--) {
		if (offset >= buf_size) {
			dev_err(dev, "The offset(%u) exceeds buf's size(%u).\n",
				offset, buf_size);
			return;
		}
		mod_info = (struct hclge_mod_err_info *)&buf[offset++];
		err_num = mod_info->err_num;

		for (i = 0; i < err_num; i++) {
			if (offset >= buf_size) {
				dev_err(dev,
					"The offset(%u) exceeds buf size(%u).\n",
					offset, buf_size);
				return;
			}

			type_reg_info = (struct hclge_type_reg_err_info *)
					    &buf[offset++];
			if (hclge_handle_error_type_reg_log(hdev, mod_info,
							    type_reg_info))
				cause_by_vf = true;

			offset += type_reg_info->reg_num;
		}
	}

	if (hnae3_ae_dev_vf_fault_supported(hdev->ae_dev) && cause_by_vf)
		set_bit(HNAE3_VF_EXP_RESET, &ae_dev->hw_err_reset_req);
}

static int hclge_query_all_err_bd_num(struct hclge_dev *hdev, u32 *bd_num)
{
	struct device *dev = &hdev->pdev->dev;
	struct hclge_desc desc_bd;
	int ret;

	hclge_cmd_setup_basic_desc(&desc_bd, HCLGE_QUERY_ALL_ERR_BD_NUM, true);
	ret = hclge_cmd_send(&hdev->hw, &desc_bd, 1);
	if (ret) {
		dev_err(dev, "failed to query error bd_num, ret = %d.\n", ret);
		return ret;
	}

	*bd_num = le32_to_cpu(desc_bd.data[0]);
	if (!(*bd_num)) {
		dev_err(dev, "The value of bd_num is 0!\n");
		return -EINVAL;
	}

	return 0;
}

static int hclge_query_all_err_info(struct hclge_dev *hdev,
				    struct hclge_desc *desc, u32 bd_num)
{
	struct device *dev = &hdev->pdev->dev;
	int ret;

	hclge_cmd_setup_basic_desc(desc, HCLGE_QUERY_ALL_ERR_INFO, true);
	ret = hclge_cmd_send(&hdev->hw, desc, bd_num);
	if (ret)
		dev_err(dev, "failed to query error info, ret = %d.\n", ret);

	return ret;
}

int hclge_handle_error_info_log(struct hnae3_ae_dev *ae_dev)
{
	u32 bd_num, desc_len, buf_len, buf_size, i;
	struct hclge_dev *hdev = ae_dev->priv;
	struct hclge_desc *desc;
	__le32 *desc_data;
	u32 *buf;
	int ret;

	ret = hclge_query_all_err_bd_num(hdev, &bd_num);
	if (ret)
		goto out;

	desc_len = bd_num * sizeof(struct hclge_desc);
	desc = kzalloc(desc_len, GFP_KERNEL);
	if (!desc) {
		ret = -ENOMEM;
		goto out;
	}

	ret = hclge_query_all_err_info(hdev, desc, bd_num);
	if (ret)
		goto err_desc;

	buf_len = bd_num * sizeof(struct hclge_desc) - HCLGE_DESC_NO_DATA_LEN;
	buf_size = buf_len / sizeof(u32);

	desc_data = kzalloc(buf_len, GFP_KERNEL);
	if (!desc_data) {
		ret = -ENOMEM;
		goto err_desc;
	}

	buf = kzalloc(buf_len, GFP_KERNEL);
	if (!buf) {
		ret = -ENOMEM;
		goto err_buf_alloc;
	}

	memcpy(desc_data, &desc[0].data[0], buf_len);
	for (i = 0; i < buf_size; i++)
		buf[i] = le32_to_cpu(desc_data[i]);

	hclge_handle_error_module_log(ae_dev, buf, buf_size);
	kfree(buf);

err_buf_alloc:
	kfree(desc_data);
err_desc:
	kfree(desc);
out:
	return ret;
}

static bool hclge_reset_vf_in_bitmap(struct hclge_dev *hdev,
				     unsigned long *bitmap)
{
	struct hclge_vport *vport;
	bool exist_set = false;
	int func_id;
	int ret;

	func_id = find_first_bit(bitmap, HCLGE_VPORT_NUM);
	if (func_id == PF_VPORT_ID)
		return false;

	while (func_id != HCLGE_VPORT_NUM) {
		vport = hclge_get_vf_vport(hdev,
					   func_id - HCLGE_VF_VPORT_START_NUM);
		if (!vport) {
			dev_err(&hdev->pdev->dev, "invalid func id(%d)\n",
				func_id);
			return false;
		}

		dev_info(&hdev->pdev->dev, "do function %d recovery.", func_id);

		ret = hclge_reset_tqp(&vport->nic);
		if (ret) {
			dev_err(&hdev->pdev->dev,
				"failed to reset tqp, ret = %d.", ret);
			return false;
		}

		ret = hclge_inform_vf_reset(vport, HNAE3_VF_FUNC_RESET);
		if (ret) {
			dev_err(&hdev->pdev->dev,
				"failed to reset func %d, ret = %d.",
				func_id, ret);
			return false;
		}

		exist_set = true;
		clear_bit(func_id, bitmap);
		func_id = find_first_bit(bitmap, HCLGE_VPORT_NUM);
	}

	return exist_set;
}

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;

	BUILD_BUG_ON(HCLGE_FIR_FAULT_BYTES + HCLGE_SEC_FAULT_BYTES !=
		     BITS_TO_BYTES(HCLGE_VPORT_NUM));

	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);
}

int hclge_handle_vf_queue_err_ras(struct hclge_dev *hdev)
{
	unsigned long vf_fault_bitmap[BITS_TO_LONGS(HCLGE_VPORT_NUM)];
	struct hclge_desc desc[2];
	bool cause_by_vf = false;
	int ret;

	if (!test_and_clear_bit(HNAE3_VF_EXP_RESET,
				&hdev->ae_dev->hw_err_reset_req) ||
	    !hnae3_ae_dev_vf_fault_supported(hdev->ae_dev))
		return 0;

	hclge_comm_cmd_setup_basic_desc(&desc[0], HCLGE_OPC_GET_QUEUE_ERR_VF,
					true);
	desc[0].flag |= cpu_to_le16(HCLGE_COMM_CMD_FLAG_NEXT);
	hclge_comm_cmd_setup_basic_desc(&desc[1], HCLGE_OPC_GET_QUEUE_ERR_VF,
					true);

	ret = hclge_comm_cmd_send(&hdev->hw.hw, desc, 2);
	if (ret) {
		dev_err(&hdev->pdev->dev,
			"failed to get vf bitmap, ret = %d.\n", ret);
		return ret;
	}
	hclge_get_vf_fault_bitmap(desc, vf_fault_bitmap);

	cause_by_vf = hclge_reset_vf_in_bitmap(hdev, vf_fault_bitmap);
	if (cause_by_vf)
		hdev->ae_dev->hw_err_reset_req = 0;

	return 0;
}
