src/dpdk/drivers/net/qede/qede_debug.c
static u32 qed_grc_dump_registers(struct ecore_hwfn *p_hwfn,
				  struct ecore_ptt *p_ptt,
				  u32 *dump_buf,
				  bool dump,
				  bool block_enable[MAX_BLOCK_ID],
				  const char *reg_type_name)
{
	struct virt_mem_desc *dbg_buf =
	    &p_hwfn->dbg_arrays[BIN_BUF_DBG_DUMP_REG];
	struct dbg_tools_data *dev_data = &p_hwfn->dbg_info;
	u32 offset = 0, input_offset = 0;

	while (input_offset < BYTES_TO_DWORDS(dbg_buf->size)) {
		const struct dbg_dump_split_hdr *split_hdr;
		struct virt_mem_desc curr_input_regs_arr;
		enum init_split_types split_type;
		u16 split_count = 0;
		u32 split_data_size;
		u8 split_id;

		split_hdr =
		    (const struct dbg_dump_split_hdr *)
		    dbg_buf->ptr + input_offset++;
		split_type =
		    GET_FIELD(split_hdr->hdr,
			      DBG_DUMP_SPLIT_HDR_SPLIT_TYPE_ID);
		split_data_size = GET_FIELD(split_hdr->hdr,
					    DBG_DUMP_SPLIT_HDR_DATA_SIZE);
		curr_input_regs_arr.ptr =
		    (u32 *)p_hwfn->dbg_arrays[BIN_BUF_DBG_DUMP_REG].ptr +
		    input_offset;
		curr_input_regs_arr.size = DWORDS_TO_BYTES(split_data_size);

		switch (split_type) {
		case SPLIT_TYPE_NONE:
			split_count = 1;
			break;
		case SPLIT_TYPE_PORT:
			split_count = dev_data->num_ports;
			break;
		case SPLIT_TYPE_PF:
		case SPLIT_TYPE_PORT_PF:
			split_count = dev_data->num_ports *
			    dev_data->num_pfs_per_port;
			break;
		case SPLIT_TYPE_VF:
			split_count = dev_data->num_vfs;
			break;
		default:
			return 0;
		}

		for (split_id = 0; split_id < split_count; split_id++)
			offset += qed_grc_dump_split_data(p_hwfn, p_ptt,
							  curr_input_regs_arr,
							  dump_buf + offset,
							  dump, block_enable,
							  split_type,
							  split_id,
							  reg_type_name);

		input_offset += split_data_size;
	}

	/* Cancel pretends (pretend to original PF) */
	if (dump) {
		ecore_fid_pretend(p_hwfn, p_ptt,
				FIELD_VALUE(PXP_PRETEND_CONCRETE_FID_PFID,
					    p_hwfn->rel_pf_id));
		dev_data->pretend.split_type = SPLIT_TYPE_NONE;
		dev_data->pretend.split_id = 0;
	}

	return offset;
}
/* Dumps registers according to the input registers array. Returns the dumped
 * size in dwords.
 */
Dumps registers according to the input registers array. Returns the dumped
size in dwords.
Dumps registers according to the input registers array . Returns the dumped size in dwords .
static u32 qed_grc_dump_registers(struct ecore_hwfn *p_hwfn,
				  struct ecore_ptt *p_ptt,
				  u32 *dump_buf,
				  bool dump,
				  bool block_enable[MAX_BLOCK_ID],
				  const char *reg_type_name)
{
	struct virt_mem_desc *dbg_buf =
	    &p_hwfn->dbg_arrays[BIN_BUF_DBG_DUMP_REG];
	struct dbg_tools_data *dev_data = &p_hwfn->dbg_info;
	u32 offset = 0, input_offset = 0;
	while (input_offset < BYTES_TO_DWORDS(dbg_buf->size)) {
		const struct dbg_dump_split_hdr *split_hdr;
		struct virt_mem_desc curr_input_regs_arr;
		enum init_split_types split_type;
		u16 split_count = 0;
		u32 split_data_size;
		u8 split_id;
		split_hdr =
		    (const struct dbg_dump_split_hdr *)
		    dbg_buf->ptr + input_offset++;
		split_type =
		    GET_FIELD(split_hdr->hdr,
			      DBG_DUMP_SPLIT_HDR_SPLIT_TYPE_ID);
		split_data_size = GET_FIELD(split_hdr->hdr,
					    DBG_DUMP_SPLIT_HDR_DATA_SIZE);
		curr_input_regs_arr.ptr =
		    (u32 *)p_hwfn->dbg_arrays[BIN_BUF_DBG_DUMP_REG].ptr +
		    input_offset;
		curr_input_regs_arr.size = DWORDS_TO_BYTES(split_data_size);
		switch (split_type) {
		case SPLIT_TYPE_NONE:
			split_count = 1;
			break;
		case SPLIT_TYPE_PORT:
			split_count = dev_data->num_ports;
			break;
		case SPLIT_TYPE_PF:
		case SPLIT_TYPE_PORT_PF:
			split_count = dev_data->num_ports *
			    dev_data->num_pfs_per_port;
			break;
		case SPLIT_TYPE_VF:
			split_count = dev_data->num_vfs;
			break;
		default:
			return 0;
		}
		for (split_id = 0; split_id < split_count; split_id++)
			offset += qed_grc_dump_split_data(p_hwfn, p_ptt,
							  curr_input_regs_arr,
							  dump_buf + offset,
							  dump, block_enable,
							  split_type,
							  split_id,
							  reg_type_name);
		input_offset += split_data_size;
	}
	if (dump) {
		ecore_fid_pretend(p_hwfn, p_ptt,
				FIELD_VALUE(PXP_PRETEND_CONCRETE_FID_PFID,
					    p_hwfn->rel_pf_id));
		dev_data->pretend.split_type = SPLIT_TYPE_NONE;
		dev_data->pretend.split_id = 0;
	}
	return offset;
}
static u32 qed_grc_dump_registers ( struct ecore_hwfn * p_hwfn , struct ecore_ptt * p_ptt , u32 * dump_buf , bool dump , bool block_enable [ MAX_BLOCK_ID ] , const char * reg_type_name ) { struct virt_mem_desc * dbg_buf = & p_hwfn -> dbg_arrays [ BIN_BUF_DBG_DUMP_REG ] ; struct dbg_tools_data * dev_data = & p_hwfn -> dbg_info ; u32 offset = 0 , input_offset = 0 ; while ( input_offset < BYTES_TO_DWORDS ( dbg_buf -> size ) ) { const struct dbg_dump_split_hdr * split_hdr ; struct virt_mem_desc curr_input_regs_arr ; enum init_split_types split_type ; u16 split_count = 0 ; u32 split_data_size ; u8 split_id ; split_hdr = ( const struct dbg_dump_split_hdr * ) dbg_buf -> ptr + input_offset ++ ; split_type = GET_FIELD ( split_hdr -> hdr , DBG_DUMP_SPLIT_HDR_SPLIT_TYPE_ID ) ; split_data_size = GET_FIELD ( split_hdr -> hdr , DBG_DUMP_SPLIT_HDR_DATA_SIZE ) ; curr_input_regs_arr . ptr = ( u32 * ) p_hwfn -> dbg_arrays [ BIN_BUF_DBG_DUMP_REG ] . ptr + input_offset ; curr_input_regs_arr . size = DWORDS_TO_BYTES ( split_data_size ) ; switch ( split_type ) { case SPLIT_TYPE_NONE : split_count = 1 ; break ; case SPLIT_TYPE_PORT : split_count = dev_data -> num_ports ; break ; case SPLIT_TYPE_PF : case SPLIT_TYPE_PORT_PF : split_count = dev_data -> num_ports * dev_data -> num_pfs_per_port ; break ; case SPLIT_TYPE_VF : split_count = dev_data -> num_vfs ; break ; default : return 0 ; } for ( split_id = 0 ; split_id < split_count ; split_id ++ ) offset += qed_grc_dump_split_data ( p_hwfn , p_ptt , curr_input_regs_arr , dump_buf + offset , dump , block_enable , split_type , split_id , reg_type_name ) ; input_offset += split_data_size ; } if ( dump ) { ecore_fid_pretend ( p_hwfn , p_ptt , FIELD_VALUE ( PXP_PRETEND_CONCRETE_FID_PFID , p_hwfn -> rel_pf_id ) ) ; dev_data -> pretend . split_type = SPLIT_TYPE_NONE ; dev_data -> pretend . split_id = 0 ; } return offset ; }
Dumps registers according to the input registers array.
Dumps registers according to the input registers array .
/* Cancel pretends (pretend to original PF) */