src/dpdk/drivers/net/qede/qede_debug.c
static u32 qed_grc_dump_mem_entries(struct ecore_hwfn *p_hwfn,
				    struct ecore_ptt *p_ptt,
				    struct virt_mem_desc input_mems_arr,
				    u32 *dump_buf, bool dump)
{
	u32 i, offset = 0, input_offset = 0;
	bool mode_match = true;

	while (input_offset < BYTES_TO_DWORDS(input_mems_arr.size)) {
		const struct dbg_dump_cond_hdr *cond_hdr;
		u16 modes_buf_offset;
		u32 num_entries;
		bool eval_mode;

		cond_hdr =
		    (const struct dbg_dump_cond_hdr *)input_mems_arr.ptr +
		    input_offset++;
		num_entries = cond_hdr->data_size / MEM_DUMP_ENTRY_SIZE_DWORDS;

		/* Check required mode */
		eval_mode = GET_FIELD(cond_hdr->mode.data,
				      DBG_MODE_HDR_EVAL_MODE) > 0;
		if (eval_mode) {
			modes_buf_offset =
				GET_FIELD(cond_hdr->mode.data,
					  DBG_MODE_HDR_MODES_BUF_OFFSET);
			mode_match = qed_is_mode_match(p_hwfn,
						       &modes_buf_offset);
		}

		if (!mode_match) {
			input_offset += cond_hdr->data_size;
			continue;
		}

		for (i = 0; i < num_entries;
		     i++, input_offset += MEM_DUMP_ENTRY_SIZE_DWORDS) {
			const struct dbg_dump_mem *mem =
			    (const struct dbg_dump_mem *)((u32 *)
							  input_mems_arr.ptr
							  + input_offset);
			const struct dbg_block *block;
			char storm_letter = 0;
			u32 mem_addr, mem_len;
			bool mem_wide_bus;
			u8 mem_group_id;

			mem_group_id = GET_FIELD(mem->dword0,
						 DBG_DUMP_MEM_MEM_GROUP_ID);
			if (mem_group_id >= MEM_GROUPS_NUM) {
				DP_NOTICE(p_hwfn, false, "Invalid mem_group_id\n");
				return 0;
			}

			if (!qed_grc_is_mem_included(p_hwfn,
						     (enum block_id)
						     cond_hdr->block_id,
						     mem_group_id))
				continue;

			mem_addr = GET_FIELD(mem->dword0, DBG_DUMP_MEM_ADDRESS);
			mem_len = GET_FIELD(mem->dword1, DBG_DUMP_MEM_LENGTH);
			mem_wide_bus = GET_FIELD(mem->dword1,
						 DBG_DUMP_MEM_WIDE_BUS);

			block = get_dbg_block(p_hwfn,
					      cond_hdr->block_id);

			/* If memory is associated with Storm,
			 * update storm details
			 */
			if (block->associated_storm_letter)
				storm_letter = block->associated_storm_letter;

			/* Dump memory */
			offset += qed_grc_dump_mem(p_hwfn,
						p_ptt,
						dump_buf + offset,
						dump,
						NULL,
						mem_addr,
						mem_len,
						mem_wide_bus,
						0,
						false,
						s_mem_group_names[mem_group_id],
						storm_letter);
		}
	}

	return offset;
}
/* Dumps GRC memories entries. Returns the dumped size in dwords. */
Dumps GRC memories entries. Returns the dumped size in dwords.
Dumps GRC memories entries . Returns the dumped size in dwords .
static u32 qed_grc_dump_mem_entries(struct ecore_hwfn *p_hwfn,
				    struct ecore_ptt *p_ptt,
				    struct virt_mem_desc input_mems_arr,
				    u32 *dump_buf, bool dump)
{
	u32 i, offset = 0, input_offset = 0;
	bool mode_match = true;
	while (input_offset < BYTES_TO_DWORDS(input_mems_arr.size)) {
		const struct dbg_dump_cond_hdr *cond_hdr;
		u16 modes_buf_offset;
		u32 num_entries;
		bool eval_mode;
		cond_hdr =
		    (const struct dbg_dump_cond_hdr *)input_mems_arr.ptr +
		    input_offset++;
		num_entries = cond_hdr->data_size / MEM_DUMP_ENTRY_SIZE_DWORDS;
		eval_mode = GET_FIELD(cond_hdr->mode.data,
				      DBG_MODE_HDR_EVAL_MODE) > 0;
		if (eval_mode) {
			modes_buf_offset =
				GET_FIELD(cond_hdr->mode.data,
					  DBG_MODE_HDR_MODES_BUF_OFFSET);
			mode_match = qed_is_mode_match(p_hwfn,
						       &modes_buf_offset);
		}
		if (!mode_match) {
			input_offset += cond_hdr->data_size;
			continue;
		}
		for (i = 0; i < num_entries;
		     i++, input_offset += MEM_DUMP_ENTRY_SIZE_DWORDS) {
			const struct dbg_dump_mem *mem =
			    (const struct dbg_dump_mem *)((u32 *)
							  input_mems_arr.ptr
							  + input_offset);
			const struct dbg_block *block;
			char storm_letter = 0;
			u32 mem_addr, mem_len;
			bool mem_wide_bus;
			u8 mem_group_id;
			mem_group_id = GET_FIELD(mem->dword0,
						 DBG_DUMP_MEM_MEM_GROUP_ID);
			if (mem_group_id >= MEM_GROUPS_NUM) {
				DP_NOTICE(p_hwfn, false, "Invalid mem_group_id\n");
				return 0;
			}
			if (!qed_grc_is_mem_included(p_hwfn,
						     (enum block_id)
						     cond_hdr->block_id,
						     mem_group_id))
				continue;
			mem_addr = GET_FIELD(mem->dword0, DBG_DUMP_MEM_ADDRESS);
			mem_len = GET_FIELD(mem->dword1, DBG_DUMP_MEM_LENGTH);
			mem_wide_bus = GET_FIELD(mem->dword1,
						 DBG_DUMP_MEM_WIDE_BUS);
			block = get_dbg_block(p_hwfn,
					      cond_hdr->block_id);
			if (block->associated_storm_letter)
				storm_letter = block->associated_storm_letter;
			offset += qed_grc_dump_mem(p_hwfn,
						p_ptt,
						dump_buf + offset,
						dump,
						NULL,
						mem_addr,
						mem_len,
						mem_wide_bus,
						0,
						false,
						s_mem_group_names[mem_group_id],
						storm_letter);
		}
	}
	return offset;
}
static u32 qed_grc_dump_mem_entries ( struct ecore_hwfn * p_hwfn , struct ecore_ptt * p_ptt , struct virt_mem_desc input_mems_arr , u32 * dump_buf , bool dump ) { u32 i , offset = 0 , input_offset = 0 ; bool mode_match = true ; while ( input_offset < BYTES_TO_DWORDS ( input_mems_arr . size ) ) { const struct dbg_dump_cond_hdr * cond_hdr ; u16 modes_buf_offset ; u32 num_entries ; bool eval_mode ; cond_hdr = ( const struct dbg_dump_cond_hdr * ) input_mems_arr . ptr + input_offset ++ ; num_entries = cond_hdr -> data_size / MEM_DUMP_ENTRY_SIZE_DWORDS ; eval_mode = GET_FIELD ( cond_hdr -> mode . data , DBG_MODE_HDR_EVAL_MODE ) > 0 ; if ( eval_mode ) { modes_buf_offset = GET_FIELD ( cond_hdr -> mode . data , DBG_MODE_HDR_MODES_BUF_OFFSET ) ; mode_match = qed_is_mode_match ( p_hwfn , & modes_buf_offset ) ; } if ( ! mode_match ) { input_offset += cond_hdr -> data_size ; continue ; } for ( i = 0 ; i < num_entries ; i ++ , input_offset += MEM_DUMP_ENTRY_SIZE_DWORDS ) { const struct dbg_dump_mem * mem = ( const struct dbg_dump_mem * ) ( ( u32 * ) input_mems_arr . ptr + input_offset ) ; const struct dbg_block * block ; char storm_letter = 0 ; u32 mem_addr , mem_len ; bool mem_wide_bus ; u8 mem_group_id ; mem_group_id = GET_FIELD ( mem -> dword0 , DBG_DUMP_MEM_MEM_GROUP_ID ) ; if ( mem_group_id >= MEM_GROUPS_NUM ) { DP_NOTICE ( p_hwfn , false , " \n " ) ; return 0 ; } if ( ! qed_grc_is_mem_included ( p_hwfn , ( enum block_id ) cond_hdr -> block_id , mem_group_id ) ) continue ; mem_addr = GET_FIELD ( mem -> dword0 , DBG_DUMP_MEM_ADDRESS ) ; mem_len = GET_FIELD ( mem -> dword1 , DBG_DUMP_MEM_LENGTH ) ; mem_wide_bus = GET_FIELD ( mem -> dword1 , DBG_DUMP_MEM_WIDE_BUS ) ; block = get_dbg_block ( p_hwfn , cond_hdr -> block_id ) ; if ( block -> associated_storm_letter ) storm_letter = block -> associated_storm_letter ; offset += qed_grc_dump_mem ( p_hwfn , p_ptt , dump_buf + offset , dump , NULL , mem_addr , mem_len , mem_wide_bus , 0 , false , s_mem_group_names [ mem_group_id ] , storm_letter ) ; } } return offset ; }
Dumps GRC memories entries.
Dumps GRC memories entries .
/* Check required mode */ /* If memory is associated with Storm,
			 * update storm details
			 */ /* Dump memory */