FreeBSD kernel CXGBE device code
cudbg_lib.c File Reference
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/param.h>
#include "common/common.h"
#include "common/t4_regs.h"
#include "cudbg.h"
#include "cudbg_lib_common.h"
#include "cudbg_lib.h"
#include "cudbg_entity.h"
Include dependency graph for cudbg_lib.c:

Go to the source code of this file.

Macros

#define BUFFER_WARN_LIMIT   10000000
 
#define ulp_region(reg)
 
#define FW_PARAM_DEV_A(param)
 
#define FW_PARAM_PFVF_A(param)
 
#define MAX_ATIDS_A   8192U
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int is_fw_attached (struct cudbg_init *pdbg_init)
 
static void align_debug_buffer (struct cudbg_buffer *dbg_buff, struct cudbg_entity_hdr *entity_hdr)
 
static void read_sge_ctxt (struct cudbg_init *pdbg_init, u32 cid, enum ctxt_type ctype, u32 *data)
 
static int get_next_ext_entity_hdr (void *outbuf, u32 *ext_size, struct cudbg_buffer *dbg_buff, struct cudbg_entity_hdr **entity_hdr)
 
static int wr_entity_to_flash (void *handle, struct cudbg_buffer *dbg_buff, u32 cur_entity_data_offset, u32 cur_entity_size, int entity_nu, u32 ext_size)
 
int cudbg_collect (void *handle, void *outbuf, u32 *outbuf_size)
 
void reset_skip_entity (void)
 
void skip_entity (int entity_code)
 
int is_large_entity (int entity_code)
 
int get_entity_hdr (void *outbuf, int i, u32 size, struct cudbg_entity_hdr **entity_hdr)
 
static int collect_rss (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_sw_state (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_ddp_stats (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_ulptx_la (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_ulprx_la (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_cpl_stats (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_wc_stats (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int mem_desc_cmp (const void *a, const void *b)
 
static int fill_meminfo (struct adapter *padap, struct struct_meminfo *meminfo_buff)
 
static int collect_meminfo (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_lb_stats (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_rdma_stats (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_er)
 
static int collect_clk_info (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_macstats (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_cim_pif_la (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_tp_la (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_fcoe_stats (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_tp_err_stats (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_tcp_stats (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_hw_sched (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_pm_stats (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_path_mtu (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_rss_key (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_rss_config (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_rss_vf_config (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_rss_pf_config (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int check_valid (u32 *buf, int type)
 
static int get_max_ctxt_qid (struct adapter *padap, struct struct_meminfo *meminfo, u32 *max_ctx_qid, u8 nelem)
 
static int collect_dump_context (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_fw_devlog (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_cim_obq_ulp0 (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_cim_obq_ulp1 (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_cim_obq_ulp2 (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_cim_obq_ulp3 (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_cim_obq_sge (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_cim_obq_ncsi (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_obq_sge_rx_q0 (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_obq_sge_rx_q1 (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int read_cim_obq (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err, int qid)
 
static int collect_cim_ibq_tp0 (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_cim_ibq_tp1 (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_cim_ibq_ulp (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_cim_ibq_sge0 (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_cim_ibq_sge1 (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_cim_ibq_ncsi (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int read_cim_ibq (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err, int qid)
 
static int collect_cim_ma_la (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_cim_la (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_cim_qcfg (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int read_fw_mem (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, u8 mem_type, unsigned long tot_len, struct cudbg_error *cudbg_err)
 
static void collect_mem_info (struct cudbg_init *pdbg_init, struct card_mem *mem_info)
 
static void cudbg_t4_fwcache (struct cudbg_init *pdbg_init, struct cudbg_error *cudbg_err)
 
static int collect_edc0_meminfo (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_edc1_meminfo (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_mc0_meminfo (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_mc1_meminfo (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_reg_dump (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_cctrl (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int check_busy_bit (struct adapter *padap)
 
static int cim_ha_rreg (struct adapter *padap, u32 addr, u32 *val)
 
static int dump_up_cim (struct adapter *padap, struct cudbg_init *pdbg_init, struct ireg_field *up_cim_reg, u32 *buff)
 
static int collect_up_cim_indirect (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_mbox_log (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_pbt_tables (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_pm_indirect (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_tid (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_tx_rate (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static void cudbg_tcamxy2valmask (u64 x, u64 y, u8 *addr, u64 *mask)
 
static void mps_rpl_backdoor (struct adapter *padap, struct fw_ldst_mps_rplc *mps_rplc)
 
static int collect_mps_tcam (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_pcie_config (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int cudbg_read_tid (struct cudbg_init *pdbg_init, u32 tid, struct cudbg_tid_data *tid_data)
 
static int collect_le_tcam (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_ma_indirect (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_hma_indirect (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_pcie_indirect (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_tp_indirect (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_sge_indirect (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_full (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 
static int collect_vpd_data (struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
 

Variables

struct large_entity large_entity_list []
 

Macro Definition Documentation

◆ BUFFER_WARN_LIMIT

#define BUFFER_WARN_LIMIT   10000000

Definition at line 39 of file cudbg_lib.c.

◆ FW_PARAM_DEV_A

#define FW_PARAM_DEV_A (   param)
Value:
V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_##param))
#define V_FW_PARAMS_MNEM(x)
@ FW_PARAMS_MNEM_DEV

◆ FW_PARAM_PFVF_A

#define FW_PARAM_PFVF_A (   param)
Value:
V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_PFVF_##param)| \
V_FW_PARAMS_PARAM_Y(0) | \
V_FW_PARAMS_PARAM_Z(0))
@ FW_PARAMS_MNEM_PFVF

◆ MAX_ATIDS_A

#define MAX_ATIDS_A   8192U

◆ ulp_region

#define ulp_region (   reg)
Value:
{\
md->base = t4_read_reg(padap, A_ULP_ ## reg ## _LLIMIT);\
(md++)->limit = t4_read_reg(padap, A_ULP_ ## reg ## _ULIMIT);\
}
static uint32_t t4_read_reg(struct adapter *sc, uint32_t reg)
Definition: adapter.h:1104

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ align_debug_buffer()

static void align_debug_buffer ( struct cudbg_buffer dbg_buff,
struct cudbg_entity_hdr entity_hdr 
)
static

Definition at line 56 of file cudbg_lib.c.

References cudbg_buffer::data, cudbg_entity_hdr::num_pad, cudbg_buffer::offset, cudbg_entity_hdr::size, and cudbg_entity_hdr::start_offset.

Referenced by cudbg_collect().

Here is the caller graph for this function:

◆ check_busy_bit()

static int check_busy_bit ( struct adapter padap)
static

Definition at line 2945 of file cudbg_lib.c.

References A_CIM_HOST_ACC_CTRL, CUDBG_CIM_BUSY_BIT, and t4_read_reg().

Referenced by cim_ha_rreg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_valid()

static int check_valid ( u32 buf,
int  type 
)
static

Definition at line 1726 of file cudbg_lib.c.

References CTXT_EGRESS, CTXT_FLM, and CTXT_INGRESS.

Referenced by collect_dump_context().

Here is the caller graph for this function:

◆ cim_ha_rreg()

static int cim_ha_rreg ( struct adapter padap,
u32  addr,
u32 val 
)
static

Definition at line 2965 of file cudbg_lib.c.

References A_CIM_HOST_ACC_CTRL, A_CIM_HOST_ACC_DATA, check_busy_bit(), t4_read_reg(), and t4_write_reg().

Referenced by collect_pbt_tables(), and dump_up_cim().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ collect_cctrl()

static int collect_cctrl ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_cim_ibq_ncsi()

static int collect_cim_ibq_ncsi ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 2226 of file cudbg_lib.c.

References read_cim_ibq().

Here is the call graph for this function:

◆ collect_cim_ibq_sge0()

static int collect_cim_ibq_sge0 ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 2206 of file cudbg_lib.c.

References read_cim_ibq().

Here is the call graph for this function:

◆ collect_cim_ibq_sge1()

static int collect_cim_ibq_sge1 ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 2216 of file cudbg_lib.c.

References read_cim_ibq().

Here is the call graph for this function:

◆ collect_cim_ibq_tp0()

static int collect_cim_ibq_tp0 ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 2176 of file cudbg_lib.c.

References read_cim_ibq().

Here is the call graph for this function:

◆ collect_cim_ibq_tp1()

static int collect_cim_ibq_tp1 ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 2186 of file cudbg_lib.c.

References read_cim_ibq().

Here is the call graph for this function:

◆ collect_cim_ibq_ulp()

static int collect_cim_ibq_ulp ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 2196 of file cudbg_lib.c.

References read_cim_ibq().

Here is the call graph for this function:

◆ collect_cim_la()

static int collect_cim_la ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_cim_ma_la()

static int collect_cim_ma_la ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_cim_obq_ncsi()

static int collect_cim_obq_ncsi ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 2089 of file cudbg_lib.c.

References read_cim_obq().

Here is the call graph for this function:

◆ collect_cim_obq_sge()

static int collect_cim_obq_sge ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 2078 of file cudbg_lib.c.

References read_cim_obq().

Here is the call graph for this function:

◆ collect_cim_obq_ulp0()

static int collect_cim_obq_ulp0 ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 2034 of file cudbg_lib.c.

References read_cim_obq().

Here is the call graph for this function:

◆ collect_cim_obq_ulp1()

static int collect_cim_obq_ulp1 ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 2045 of file cudbg_lib.c.

References read_cim_obq().

Here is the call graph for this function:

◆ collect_cim_obq_ulp2()

static int collect_cim_obq_ulp2 ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 2056 of file cudbg_lib.c.

References read_cim_obq().

Here is the call graph for this function:

◆ collect_cim_obq_ulp3()

static int collect_cim_obq_ulp3 ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 2067 of file cudbg_lib.c.

References read_cim_obq().

Here is the call graph for this function:

◆ collect_cim_pif_la()

static int collect_cim_pif_la ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_cim_qcfg()

◆ collect_clk_info()

◆ collect_cpl_stats()

static int collect_cpl_stats ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_ddp_stats()

static int collect_ddp_stats ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 640 of file cudbg_lib.c.

References cudbg_init::adap, compress_buff(), cudbg_buffer::data, get_scratch_buff(), release_scratch_buff(), t4_get_usm_stats(), and write_compression_hdr().

Here is the call graph for this function:

◆ collect_dump_context()

◆ collect_edc0_meminfo()

static int collect_edc0_meminfo ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_edc1_meminfo()

static int collect_edc1_meminfo ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_fcoe_stats()

static int collect_fcoe_stats ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_full()

static int collect_full ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_fw_devlog()

◆ collect_hma_indirect()

◆ collect_hw_sched()

◆ collect_lb_stats()

static int collect_lb_stats ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_le_tcam()

◆ collect_ma_indirect()

◆ collect_macstats()

◆ collect_mbox_log()

static int collect_mbox_log ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_mc0_meminfo()

static int collect_mc0_meminfo ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_mc1_meminfo()

static int collect_mc1_meminfo ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_mem_info()

◆ collect_meminfo()

static int collect_meminfo ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 1091 of file cudbg_lib.c.

References cudbg_init::adap, compress_buff(), cudbg_buffer::data, fill_meminfo(), get_scratch_buff(), release_scratch_buff(), and write_compression_hdr().

Here is the call graph for this function:

◆ collect_mps_tcam()

static int collect_mps_tcam ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 3506 of file cudbg_lib.c.

References A_MPS_CLS_TCAM_DATA2_CTL, A_MPS_CLS_TCAM_RDATA0_REQ_ID1, A_MPS_CLS_TCAM_RDATA1_REQ_ID1, A_MPS_CLS_TCAM_RDATA2_REQ_ID1, cudbg_init::adap, cudbg_mps_tcam::addr, begin_synchronized_op(), CHELSIO_T6, chip_id(), adapter::chip_params, cudbg_mps_tcam::cls_hi, cudbg_mps_tcam::cls_lo, compress_buff(), CUDBG_MAX_RPLC_SIZE, CUDBG_SYSTEM_ERROR, cudbg_tcamxy2valmask(), fw_ldst_cmd::cycles_to_len16, cudbg_buffer::data, cudbg_mps_tcam::dip_hit, end_synchronized_op(), F_DATADIPHIT, F_DATAVIDH2, F_FW_CMD_READ, F_FW_CMD_REQUEST, F_REPLICATE, F_T6_REPLICATE, fw_ldst_cmd::fw_ldst::fw_ldst_mps::fw_ldst_mps_rplc::fid_idx, FW_LDST_ADDRSPC_MPS, FW_LDST_CMD, FW_LDST_MPS_RPLC, FW_LEN16, G_DATALKPTYPE, G_DATAPORTNUM, G_DATAVIDH1, G_DMACH, G_VIDL, get_scratch_buff(), cudbg_mps_tcam::idx, INTR_OK, is_t5(), is_t6(), cudbg_mps_tcam::ivlan, cudbg_mps_tcam::lookup_type, M_DATALKPTYPE, cudbg_mps_tcam::mask, adapter::mbox, fw_ldst_cmd::fw_ldst::mps, MPS_CLS_SRAM_H, MPS_CLS_SRAM_L, MPS_CLS_TCAM_X_L, MPS_CLS_TCAM_Y_L, mps_rpl_backdoor(), chip_params::mps_rplc_size, chip_params::mps_tcam_size, fw_ldst_cmd::op_to_addrspace, cudbg_mps_tcam::port_num, release_scratch_buff(), cudbg_mps_tcam::repli, cudbg_mps_tcam::rplc, fw_ldst_cmd::fw_ldst::fw_ldst_mps::rplc, cudbg_mps_tcam::rplc_size, cudbg_buffer::size, SLEEP_OK, t4_read_reg(), t4_read_reg64(), t4_wr_mbox(), t4_write_reg(), fw_ldst_cmd::u, V_CTLCMDTYPE, V_CTLREQID, V_CTLTCAMINDEX, V_CTLTCAMSEL, V_CTLXYBITSEL, V_FW_CMD_OP, V_FW_LDST_CMD_ADDRSPACE, V_FW_LDST_CMD_FID, V_FW_LDST_CMD_IDX, cudbg_mps_tcam::vlan_vld, cudbg_mps_tcam::vnix, cudbg_mps_tcam::vniy, and write_compression_hdr().

Here is the call graph for this function:

◆ collect_obq_sge_rx_q0()

static int collect_obq_sge_rx_q0 ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 2100 of file cudbg_lib.c.

References read_cim_obq().

Here is the call graph for this function:

◆ collect_obq_sge_rx_q1()

static int collect_obq_sge_rx_q1 ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

Definition at line 2111 of file cudbg_lib.c.

References read_cim_obq().

Here is the call graph for this function:

◆ collect_path_mtu()

static int collect_path_mtu ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_pbt_tables()

◆ collect_pcie_config()

static int collect_pcie_config ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_pcie_indirect()

◆ collect_pm_indirect()

◆ collect_pm_stats()

static int collect_pm_stats ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_rdma_stats()

static int collect_rdma_stats ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_er 
)
static

Definition at line 1168 of file cudbg_lib.c.

References cudbg_init::adap, compress_buff(), cudbg_buffer::data, get_scratch_buff(), release_scratch_buff(), t4_tp_get_rdma_stats(), and write_compression_hdr().

Here is the call graph for this function:

◆ collect_reg_dump()

static int collect_reg_dump ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_rss()

static int collect_rss ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_rss_config()

◆ collect_rss_key()

static int collect_rss_key ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_rss_pf_config()

static int collect_rss_pf_config ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_rss_vf_config()

static int collect_rss_vf_config ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_sge_indirect()

◆ collect_sw_state()

static int collect_sw_state ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_tcp_stats()

static int collect_tcp_stats ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_tid()

static int collect_tid ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_tp_err_stats()

static int collect_tp_err_stats ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_tp_indirect()

◆ collect_tp_la()

static int collect_tp_la ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_tx_rate()

static int collect_tx_rate ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_ulprx_la()

static int collect_ulprx_la ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ collect_ulptx_la()

◆ collect_up_cim_indirect()

◆ collect_vpd_data()

◆ collect_wc_stats()

static int collect_wc_stats ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err 
)
static

◆ cudbg_collect()

int cudbg_collect ( void *  handle,
void *  outbuf,
u32 outbuf_size 
)

cudbg_collect - Collect and store debug information.

Parameters

@handle : A pointer returned by cudbg_alloc_handle. @outbuf : pointer to output buffer, to store the collected information or to use it as a scratch buffer in case HW flash is used to store the debug information. @outbuf_size : Size of output buffer.

Return

If the function succeeds, the return value will be size of debug information collected and stored. -ve value represent error.

Definition at line 203 of file cudbg_lib.c.

References cudbg_init::adap, align_debug_buffer(), BUFFER_WARN_LIMIT, cudbg_hdr::chip_ver, adapter_params::chipid, CUDBG_ALL, CUDBG_EXT_DATA_VALID, CUDBG_EXT_ENTITY, CUDBG_MAJOR_VERSION, CUDBG_MAX_ENTITY, CUDBG_MINOR_VERSION, CUDBG_SIGNATURE, CUDBG_STATUS_SMALL_BUFF, CUDBG_SYSTEM_ERROR, cudbg_buffer::data, cudbg_hdr::data_len, large_entity::entity_code, ENTITY_FLAG_FW_NO_ATTACH, entity_list, cudbg_entity_hdr::entity_type, cudbg_entity_hdr::flag, get_entity_hdr(), get_next_ext_entity_hdr(), cudbg_hdr::hdr_flags, cudbg_entity_hdr::hdr_flags, cudbg_hdr::hdr_len, is_fw_attached(), is_large_entity(), large_entity_list, cudbg_hdr::major_ver, cudbg_hdr::max_entities, cudbg_hdr::minor_ver, cudbg_entity_hdr::next_ext_offset, cudbg_buffer::offset, adapter::params, cudbg_init::print, process_entity, reset_skip_entity(), cudbg_hdr::signature, cudbg_entity_hdr::size, cudbg_buffer::size, skip_entity(), cudbg_entity_hdr::start_offset, cudbg_entity_hdr::sys_err, cudbg_error::sys_err, cudbg_entity_hdr::sys_warn, cudbg_error::sys_warn, t4_get_flash_params(), cudbg_init::use_flash, cudbg_init::verbose, and wr_entity_to_flash().

Referenced by cudbg_dump().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cudbg_read_tid()

◆ cudbg_t4_fwcache()

static void cudbg_t4_fwcache ( struct cudbg_init pdbg_init,
struct cudbg_error cudbg_err 
)
static

◆ cudbg_tcamxy2valmask()

static void cudbg_tcamxy2valmask ( u64  x,
u64  y,
u8 addr,
u64 mask 
)
inlinestatic

Definition at line 3472 of file cudbg_lib.c.

References __force, cpu_to_be64, and ETH_ALEN.

Referenced by collect_mps_tcam().

Here is the caller graph for this function:

◆ dump_up_cim()

static int dump_up_cim ( struct adapter padap,
struct cudbg_init pdbg_init,
struct ireg_field up_cim_reg,
u32 buff 
)
static

Definition at line 2984 of file cudbg_lib.c.

References cim_ha_rreg(), ireg_field::ireg_local_offset, ireg_field::ireg_offset_range, cudbg_init::print, and cudbg_init::verbose.

Referenced by collect_up_cim_indirect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fill_meminfo()

static int fill_meminfo ( struct adapter padap,
struct struct_meminfo meminfo_buff 
)
static

Definition at line 837 of file cudbg_lib.c.

References A_CIM_EXTMEM2_ADDR_SIZE, A_CIM_EXTMEM2_BASE_ADDR, A_CIM_SDRAM_ADDR_SIZE, A_CIM_SDRAM_BASE_ADDR, A_LE_DB_CONFIG, A_LE_DB_HASH_TBL_BASE_ADDR, A_LE_DB_HASH_TID_BASE, A_LE_DB_TID_HASHBASE, A_MA_EDRAM0_BAR, A_MA_EDRAM1_BAR, A_MA_EXT_MEMORY0_BAR, A_MA_EXT_MEMORY1_BAR, A_MA_EXT_MEMORY_BAR, A_MA_TARGET_MEM_ENABLE, A_MPS_RX_LPBK_BG_PG_CNT0, A_MPS_RX_MAC_BG_PG_CNT0, A_MPS_RX_PG_RSV0, A_MPS_RX_PG_RSV4, A_SGE_CONTROL2, A_SGE_DBQ_CTXT_BADDR, A_SGE_DBVFIFO_BADDR, A_SGE_DBVFIFO_SIZE, A_SGE_FLM_CACHE_BADDR, A_SGE_IMSG_CTXT_BADDR, A_TP_CMM_MM_BASE, A_TP_CMM_MM_PS_FLST_BASE, A_TP_CMM_MM_RX_FLST_BASE, A_TP_CMM_MM_TX_FLST_BASE, A_TP_CMM_TCB_BASE, A_TP_CMM_TIMER_BASE, A_TP_PMM_RX_BASE, A_TP_PMM_RX_MAX_PAGE, A_TP_PMM_RX_PAGE_SIZE, A_TP_PMM_TX_BASE, A_TP_PMM_TX_MAX_PAGE, A_TP_PMM_TX_PAGE_SIZE, A_ULP_RX_CTX_BASE, A_ULP_TX_ERR_TABLE_BASE, ARRAY_SIZE, struct_meminfo::avail, struct_meminfo::avail_c, struct_mem_desc::base, CHELSIO_T5, chip_id(), adapter::chip_params, CUDBG_STATUS_ENTITY_NOT_FOUND, F_EDRAM0_ENABLE, F_EDRAM1_ENABLE, F_EXT_MEM0_ENABLE, F_EXT_MEM1_ENABLE, F_EXT_MEM_ENABLE, F_HASHEN, F_PMRXNUMCHN, F_VFIFO_ENABLE, G_ALLOC, G_BASEADDR, G_DBVFIFO_SIZE, G_EDRAM0_BASE, G_EDRAM0_SIZE, G_EDRAM1_BASE, G_EDRAM1_SIZE, G_EXT_MEM1_BASE, G_EXT_MEM1_SIZE, G_EXT_MEM_BASE, G_EXT_MEM_SIZE, G_PMRXMAXPAGE, G_PMTXMAXPAGE, G_PMTXNUMCHN, G_T5_ALLOC, G_T5_USED, G_T6_DBVFIFO_SIZE, G_USED, struct_mem_desc::idx, is_t4(), is_t5(), is_t6(), struct_mem_desc::limit, struct_meminfo::loopback_alloc, struct_meminfo::loopback_used, struct_meminfo::mem, struct_meminfo::mem_c, mem_desc_cmp(), chip_params::nchan, struct_meminfo::port_alloc, struct_meminfo::port_used, region, struct_meminfo::rx_pages_data, t4_read_reg(), struct_meminfo::tx_pages_data, ulp_region, struct_meminfo::up_extmem2_hi, struct_meminfo::up_extmem2_lo, struct_meminfo::up_ram_hi, and struct_meminfo::up_ram_lo.

Referenced by collect_dump_context(), and collect_meminfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_entity_hdr()

int get_entity_hdr ( void *  outbuf,
int  i,
u32  size,
struct cudbg_entity_hdr **  entity_hdr 
)

Definition at line 555 of file cudbg_lib.c.

References CUDBG_STATUS_SMALL_BUFF, and cudbg_hdr::hdr_len.

Referenced by cudbg_collect().

Here is the caller graph for this function:

◆ get_max_ctxt_qid()

static int get_max_ctxt_qid ( struct adapter padap,
struct struct_meminfo meminfo,
u32 max_ctx_qid,
u8  nelem 
)
static

Get EGRESS, INGRESS, FLM, and CNM max qid.

For EGRESS and INGRESS, do the following calculation. max_qid = (DBQ/IMSG context region size in bytes) / (size of context in bytes).

For FLM, do the following calculation. max_qid = (FLM cache region size in bytes) / ((number of pointers cached in EDRAM) * 8 (bytes per pointer)).

There's a 1-to-1 mapping between FLM and CNM if there's no header splitting enabled; i.e., max CNM qid is equal to max FLM qid. However, if header splitting is enabled, then max CNM qid is half of max FLM qid.

Definition at line 1764 of file cudbg_lib.c.

References A_SGE_FLM_CFG, ARRAY_SIZE, struct_mem_desc::base, CTXT_CNM, CTXT_EGRESS, CTXT_FLM, CTXT_INGRESS, CUDBG_CTXT_SIZE_BYTES, CUDBG_MAX_CNM_QIDS, CUDBG_MAX_FL_QIDS, CUDBG_MAX_INGRESS_QIDS, G_EDRAMPTRCNT, struct_mem_desc::idx, struct_mem_desc::limit, M_CTXTQID, struct_meminfo::mem, struct_meminfo::mem_c, min_t, region, S_NOHDR, and t4_read_reg().

Referenced by collect_dump_context().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_next_ext_entity_hdr()

static int get_next_ext_entity_hdr ( void *  outbuf,
u32 ext_size,
struct cudbg_buffer dbg_buff,
struct cudbg_entity_hdr **  entity_hdr 
)
static

Definition at line 95 of file cudbg_lib.c.

References CUDBG_STATUS_BUFFER_SHORT, cudbg_hdr::data_len, cudbg_buffer::offset, cudbg_entity_hdr::size, and cudbg_buffer::size.

Referenced by cudbg_collect().

Here is the caller graph for this function:

◆ is_fw_attached()

static int is_fw_attached ( struct cudbg_init pdbg_init)
static

Definition at line 48 of file cudbg_lib.c.

References cudbg_init::adap, adapter::flags, and FW_OK.

Referenced by collect_vpd_data(), cudbg_collect(), cudbg_t4_fwcache(), and read_sge_ctxt().

Here is the caller graph for this function:

◆ is_large_entity()

int is_large_entity ( int  entity_code)

Definition at line 543 of file cudbg_lib.c.

References large_entity_list.

Referenced by cudbg_collect().

Here is the caller graph for this function:

◆ mem_desc_cmp()

static int mem_desc_cmp ( const void *  a,
const void *  b 
)
static

Definition at line 831 of file cudbg_lib.c.

Referenced by fill_meminfo().

Here is the caller graph for this function:

◆ mps_rpl_backdoor()

static void mps_rpl_backdoor ( struct adapter padap,
struct fw_ldst_mps_rplc *  mps_rplc 
)
static

Definition at line 3479 of file cudbg_lib.c.

References A_MPS_VF_RPLCT_MAP0, A_MPS_VF_RPLCT_MAP1, A_MPS_VF_RPLCT_MAP2, A_MPS_VF_RPLCT_MAP3, A_MPS_VF_RPLCT_MAP4, A_MPS_VF_RPLCT_MAP5, A_MPS_VF_RPLCT_MAP6, A_MPS_VF_RPLCT_MAP7, is_t5(), and t4_read_reg().

Referenced by collect_mps_tcam().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_cim_ibq()

static int read_cim_ibq ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
struct cudbg_error cudbg_err,
int  qid 
)
static

◆ read_cim_obq()

◆ read_fw_mem()

static int read_fw_mem ( struct cudbg_init pdbg_init,
struct cudbg_buffer dbg_buff,
u8  mem_type,
unsigned long  tot_len,
struct cudbg_error cudbg_err 
)
static

Fetch the TX/RX payload regions start and end.

@padap (IN): adapter handle. @mem_type (IN): EDC0, EDC1, MC/MC0/MC1. @mem_tot_len (IN): total length of @mem_type memory region to read. @payload_type (IN): TX or RX Payload. @reg_info (OUT): store the payload region info.

Fetch the TX/RX payload region information from meminfo. However, reading from the @mem_type region starts at 0 and not from whatever base info is stored in meminfo. Hence, if the payload region exists, then calculate the payload region start and end wrt 0 and @mem_tot_len, respectively, and set @reg_info->exist to true. Otherwise, set @reg_info->exist to false.

Definition at line 2548 of file cudbg_lib.c.

References cudbg_init::adap, ARRAY_SIZE, compress_buff(), CUDBG_CHUNK_SIZE, CUDBG_STATUS_NO_SCRATCH_MEM, CUDBG_STATUS_NOT_IMPLEMENTED, cudbg_buffer::data, struct_region_info::end, struct_region_info::exist, get_scratch_buff(), min_t, cudbg_init::print, region, release_scratch_buff(), cudbg_buffer::size, struct_region_info::start, cudbg_error::sys_err, cudbg_init::verbose, and write_compression_hdr().

Referenced by collect_edc0_meminfo(), collect_edc1_meminfo(), collect_mc0_meminfo(), and collect_mc1_meminfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_sge_ctxt()

static void read_sge_ctxt ( struct cudbg_init pdbg_init,
u32  cid,
enum ctxt_type  ctype,
u32 data 
)
static

Definition at line 74 of file cudbg_lib.c.

References cudbg_init::adap, begin_synchronized_op(), end_synchronized_op(), INTR_OK, is_fw_attached(), adapter::mbox, SLEEP_OK, t4_sge_ctxt_rd(), and t4_sge_ctxt_rd_bd().

Referenced by collect_dump_context().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset_skip_entity()

void reset_skip_entity ( void  )

Definition at line 525 of file cudbg_lib.c.

References ARRAY_SIZE, and large_entity_list.

Referenced by cudbg_collect().

Here is the caller graph for this function:

◆ skip_entity()

void skip_entity ( int  entity_code)

Definition at line 533 of file cudbg_lib.c.

References large_entity_list, and large_entity::skip_flag.

Referenced by cudbg_collect().

Here is the caller graph for this function:

◆ wr_entity_to_flash()

static int wr_entity_to_flash ( void *  handle,
struct cudbg_buffer dbg_buff,
u32  cur_entity_data_offset,
u32  cur_entity_size,
int  entity_nu,
u32  ext_size 
)
static

Definition at line 147 of file cudbg_lib.c.

References CUDBG_FLASH_SIZE, CUDBG_MAX_ENTITY, CUDBG_STATUS_FLASH_FULL, cudbg_write_flash(), cudbg_private::dbg_init, FLASH_CUDBG_NSECS, cudbg_init::print, cudbg_private::sec_info, cudbg_flash_hdr::timestamp, update_skip_size(), and cudbg_init::verbose.

Referenced by cudbg_collect().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ large_entity_list

struct large_entity large_entity_list[]
Initial value:
= {
{CUDBG_EDC0, 0, 0},
{CUDBG_EDC1, 0 , 0},
{CUDBG_MC0, 0, 0},
{CUDBG_MC1, 0, 0}
}
@ CUDBG_MC1
Definition: cudbg.h:170
@ CUDBG_MC0
Definition: cudbg.h:169
@ CUDBG_EDC1
Definition: cudbg.h:168
@ CUDBG_EDC0
Definition: cudbg.h:167

Definition at line 41 of file cudbg_lib.c.

Referenced by cudbg_collect(), is_large_entity(), reset_skip_entity(), and skip_entity().