linux/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c

// 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[] =;

static const struct hclge_hw_error hclge_cmdq_nic_mem_ecc_int[] =;

static const struct hclge_hw_error hclge_tqp_int_ecc_int[] =;

static const struct hclge_hw_error hclge_msix_sram_ecc_int[] =;

static const struct hclge_hw_error hclge_igu_int[] =;

static const struct hclge_hw_error hclge_igu_egu_tnl_int[] =;

static const struct hclge_hw_error hclge_ncsi_err_int[] =;

static const struct hclge_hw_error hclge_ppp_mpf_abnormal_int_st1[] =;

static const struct hclge_hw_error hclge_ppp_pf_abnormal_int[] =;

static const struct hclge_hw_error hclge_ppp_mpf_abnormal_int_st3[] =;

static const struct hclge_hw_error hclge_tm_sch_rint[] =;

static const struct hclge_hw_error hclge_qcn_fifo_rint[] =;

static const struct hclge_hw_error hclge_qcn_ecc_rint[] =;

static const struct hclge_hw_error hclge_mac_afifo_tnl_int[] =;

static const struct hclge_hw_error hclge_ppu_mpf_abnormal_int_st2[] =;

static const struct hclge_hw_error hclge_ppu_mpf_abnormal_int_st3[] =;

static const struct hclge_hw_error hclge_ppu_pf_abnormal_int[] =;

static const struct hclge_hw_error hclge_ssu_com_err_int[] =;

#define HCLGE_SSU_MEM_ECC_ERR(x)

static const struct hclge_hw_error hclge_ssu_mem_ecc_err_int[] =;

static const struct hclge_hw_error hclge_ssu_port_based_err_int[] =;

static const struct hclge_hw_error hclge_ssu_fifo_overflow_int[] =;

static const struct hclge_hw_error hclge_ssu_ets_tcg_int[] =;

static const struct hclge_hw_error hclge_ssu_port_based_pf_int[] =;

static const struct hclge_hw_error hclge_rocee_qmm_ovf_err_int[] =;

static const struct hclge_mod_reg_info hclge_ssu_reg_0_info[] =;

static const struct hclge_mod_reg_info hclge_ssu_reg_1_info[] =;

static const struct hclge_mod_reg_info hclge_rpu_reg_0_info[] =;

static const struct hclge_mod_reg_info hclge_rpu_reg_1_info[] =;

static const struct hclge_mod_reg_info hclge_igu_egu_reg_info[] =;

static const struct hclge_mod_reg_info hclge_gen_reg_info_tnl[] =;

static const struct hclge_mod_reg_info hclge_gen_reg_info[] =;

static const struct hclge_mod_reg_common_msg hclge_ssu_reg_common_msg[] =;

static int
hclge_print_mod_reg_info(struct device *dev, struct hclge_desc *desc,
			 const struct hclge_mod_reg_info *reg_info, int size)
{}

static bool hclge_err_mod_check_support_cmd(enum hclge_opcode_type opcode,
					    struct hclge_dev *hdev)
{}

/* 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)
{}

static void hclge_query_reg_info_of_ssu(struct hclge_dev *hdev)
{}

static const struct hclge_hw_module_id hclge_hw_module_id_st[] =;

static const struct hclge_hw_type_id hclge_hw_type_id_st[] =;

static void hclge_log_error(struct device *dev, char *reg,
			    const struct hclge_hw_error *err,
			    u32 err_sts, unsigned long *reset_requests)
{}

/* 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)
{}

static int hclge_clear_mac_tnl_int(struct hclge_dev *hdev)
{}

static int hclge_config_common_hw_err_int(struct hclge_dev *hdev, bool en)
{}

static int hclge_config_ncsi_hw_err_int(struct hclge_dev *hdev, bool en)
{}

static int hclge_config_igu_egu_hw_err_int(struct hclge_dev *hdev, bool en)
{}

static int hclge_config_ppp_error_interrupt(struct hclge_dev *hdev, u32 cmd,
					    bool en)
{}

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

static int hclge_config_tm_hw_err_int(struct hclge_dev *hdev, bool en)
{}

static int hclge_config_mac_err_int(struct hclge_dev *hdev, bool en)
{}

int hclge_config_mac_tnl_int(struct hclge_dev *hdev, bool en)
{}

static int hclge_config_ppu_error_interrupts(struct hclge_dev *hdev, u32 cmd,
					     bool en)
{}

static int hclge_config_ppu_hw_err_int(struct hclge_dev *hdev, bool en)
{}

static int hclge_config_ssu_hw_err_int(struct hclge_dev *hdev, bool en)
{}

/* 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)
{}

/* 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)
{}

/* 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)
{}

static int hclge_handle_all_ras_errors(struct hclge_dev *hdev)
{}

static int hclge_log_rocee_axi_error(struct hclge_dev *hdev)
{}

static int hclge_log_rocee_ecc_error(struct hclge_dev *hdev)
{}

static int hclge_log_rocee_ovf_error(struct hclge_dev *hdev)
{}

static enum hnae3_reset_type
hclge_log_and_clear_rocee_ras_error(struct hclge_dev *hdev)
{}

int hclge_config_rocee_ras_interrupt(struct hclge_dev *hdev, bool en)
{}

static void hclge_handle_rocee_ras_error(struct hnae3_ae_dev *ae_dev)
{}

static const struct hclge_hw_blk hw_blk[] =;

static void hclge_config_all_msix_error(struct hclge_dev *hdev, bool enable)
{}

int hclge_config_nic_hw_error(struct hclge_dev *hdev, bool state)
{}

pci_ers_result_t hclge_handle_hw_ras_error(struct hnae3_ae_dev *ae_dev)
{}

static int hclge_clear_hw_msix_error(struct hclge_dev *hdev,
				     struct hclge_desc *desc, bool is_mpf,
				     u32 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)
{}

/* 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)
{}

/* 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)
{}

/* 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)
{}

static int hclge_handle_all_hw_msix_error(struct hclge_dev *hdev,
					  unsigned long *reset_requests)
{}

int hclge_handle_hw_msix_error(struct hclge_dev *hdev,
			       unsigned long *reset_requests)
{}

int hclge_handle_mac_tnl(struct hclge_dev *hdev)
{}

void hclge_handle_all_hns_hw_errors(struct hnae3_ae_dev *ae_dev)
{}

bool hclge_find_error_source(struct hclge_dev *hdev)
{}

void hclge_handle_occurred_error(struct hclge_dev *hdev)
{}

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

static void hclge_handle_error_module_log(struct hnae3_ae_dev *ae_dev,
					  const u32 *buf, u32 buf_size)
{}

static int hclge_query_all_err_bd_num(struct hclge_dev *hdev, u32 *bd_num)
{}

static int hclge_query_all_err_info(struct hclge_dev *hdev,
				    struct hclge_desc *desc, u32 bd_num)
{}

int hclge_handle_error_info_log(struct hnae3_ae_dev *ae_dev)
{}

static bool hclge_reset_vf_in_bitmap(struct hclge_dev *hdev,
				     unsigned long *bitmap)
{}

static void hclge_get_vf_fault_bitmap(struct hclge_desc *desc,
				      unsigned long *bitmap)
{}

int hclge_handle_vf_queue_err_ras(struct hclge_dev *hdev)
{}