src/dpdk/drivers/net/qede/qede_debug.c
static u32 qed_idle_chk_dump(struct ecore_hwfn *p_hwfn,
			     struct ecore_ptt *p_ptt, u32 *dump_buf, bool dump)
{
	struct virt_mem_desc *dbg_buf =
	    &p_hwfn->dbg_arrays[BIN_BUF_DBG_IDLE_CHK_RULES];
	u32 num_failing_rules_offset, offset = 0,
	    input_offset = 0, num_failing_rules = 0;

	/* Dump global params  - 1 must match below amount of params */
	offset += qed_dump_common_global_params(p_hwfn,
						p_ptt,
						dump_buf + offset, dump, 1);
	offset += qed_dump_str_param(dump_buf + offset,
				     dump, "dump-type", "idle-chk");

	/* Dump idle check section header with a single parameter */
	offset += qed_dump_section_hdr(dump_buf + offset, dump, "idle_chk", 1);
	num_failing_rules_offset = offset;
	offset += qed_dump_num_param(dump_buf + offset, dump, "num_rules", 0);

	while (input_offset < BYTES_TO_DWORDS(dbg_buf->size)) {
		const struct dbg_idle_chk_cond_hdr *cond_hdr =
		    (const struct dbg_idle_chk_cond_hdr *)dbg_buf->ptr +
		    input_offset++;
		bool eval_mode, mode_match = true;
		u32 curr_failing_rules;
		u16 modes_buf_offset;

		/* Check 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) {
			const struct dbg_idle_chk_rule *rule =
			    (const struct dbg_idle_chk_rule *)((u32 *)
							       dbg_buf->ptr
							       + input_offset);
			u32 num_input_rules =
				cond_hdr->data_size / IDLE_CHK_RULE_SIZE_DWORDS;
			offset +=
			    qed_idle_chk_dump_rule_entries(p_hwfn,
							   p_ptt,
							   dump_buf +
							   offset,
							   dump,
							   rule,
							   num_input_rules,
							   &curr_failing_rules);
			num_failing_rules += curr_failing_rules;
		}

		input_offset += cond_hdr->data_size;
	}

	/* Overwrite num_rules parameter */
	if (dump)
		qed_dump_num_param(dump_buf + num_failing_rules_offset,
				   dump, "num_rules", num_failing_rules);

	/* Dump last section */
	offset += qed_dump_last_section(dump_buf, offset, dump);

	return offset;
}
/* Performs Idle Check Dump to the specified buffer.
 * Returns the dumped size in dwords.
 */
Performs Idle Check Dump to the specified buffer.
Returns the dumped size in dwords.
Performs Idle Check Dump to the specified buffer . Returns the dumped size in dwords .
static u32 qed_idle_chk_dump(struct ecore_hwfn *p_hwfn,
			     struct ecore_ptt *p_ptt, u32 *dump_buf, bool dump)
{
	struct virt_mem_desc *dbg_buf =
	    &p_hwfn->dbg_arrays[BIN_BUF_DBG_IDLE_CHK_RULES];
	u32 num_failing_rules_offset, offset = 0,
	    input_offset = 0, num_failing_rules = 0;
	offset += qed_dump_common_global_params(p_hwfn,
						p_ptt,
						dump_buf + offset, dump, 1);
	offset += qed_dump_str_param(dump_buf + offset,
				     dump, "dump-type", "idle-chk");
	offset += qed_dump_section_hdr(dump_buf + offset, dump, "idle_chk", 1);
	num_failing_rules_offset = offset;
	offset += qed_dump_num_param(dump_buf + offset, dump, "num_rules", 0);
	while (input_offset < BYTES_TO_DWORDS(dbg_buf->size)) {
		const struct dbg_idle_chk_cond_hdr *cond_hdr =
		    (const struct dbg_idle_chk_cond_hdr *)dbg_buf->ptr +
		    input_offset++;
		bool eval_mode, mode_match = true;
		u32 curr_failing_rules;
		u16 modes_buf_offset;
		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) {
			const struct dbg_idle_chk_rule *rule =
			    (const struct dbg_idle_chk_rule *)((u32 *)
							       dbg_buf->ptr
							       + input_offset);
			u32 num_input_rules =
				cond_hdr->data_size / IDLE_CHK_RULE_SIZE_DWORDS;
			offset +=
			    qed_idle_chk_dump_rule_entries(p_hwfn,
							   p_ptt,
							   dump_buf +
							   offset,
							   dump,
							   rule,
							   num_input_rules,
							   &curr_failing_rules);
			num_failing_rules += curr_failing_rules;
		}
		input_offset += cond_hdr->data_size;
	}
	if (dump)
		qed_dump_num_param(dump_buf + num_failing_rules_offset,
				   dump, "num_rules", num_failing_rules);
	offset += qed_dump_last_section(dump_buf, offset, dump);
	return offset;
}
static u32 qed_idle_chk_dump ( struct ecore_hwfn * p_hwfn , struct ecore_ptt * p_ptt , u32 * dump_buf , bool dump ) { struct virt_mem_desc * dbg_buf = & p_hwfn -> dbg_arrays [ BIN_BUF_DBG_IDLE_CHK_RULES ] ; u32 num_failing_rules_offset , offset = 0 , input_offset = 0 , num_failing_rules = 0 ; offset += qed_dump_common_global_params ( p_hwfn , p_ptt , dump_buf + offset , dump , 1 ) ; offset += qed_dump_str_param ( dump_buf + offset , dump , " " , " " ) ; offset += qed_dump_section_hdr ( dump_buf + offset , dump , " " , 1 ) ; num_failing_rules_offset = offset ; offset += qed_dump_num_param ( dump_buf + offset , dump , " " , 0 ) ; while ( input_offset < BYTES_TO_DWORDS ( dbg_buf -> size ) ) { const struct dbg_idle_chk_cond_hdr * cond_hdr = ( const struct dbg_idle_chk_cond_hdr * ) dbg_buf -> ptr + input_offset ++ ; bool eval_mode , mode_match = true ; u32 curr_failing_rules ; u16 modes_buf_offset ; 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 ) { const struct dbg_idle_chk_rule * rule = ( const struct dbg_idle_chk_rule * ) ( ( u32 * ) dbg_buf -> ptr + input_offset ) ; u32 num_input_rules = cond_hdr -> data_size / IDLE_CHK_RULE_SIZE_DWORDS ; offset += qed_idle_chk_dump_rule_entries ( p_hwfn , p_ptt , dump_buf + offset , dump , rule , num_input_rules , & curr_failing_rules ) ; num_failing_rules += curr_failing_rules ; } input_offset += cond_hdr -> data_size ; } if ( dump ) qed_dump_num_param ( dump_buf + num_failing_rules_offset , dump , " " , num_failing_rules ) ; offset += qed_dump_last_section ( dump_buf , offset , dump ) ; return offset ; }
Performs Idle Check Dump to the specified buffer.
Performs Idle Check Dump to the specified buffer .
/* Dump global params  - 1 must match below amount of params */ /* Dump idle check section header with a single parameter */ /* Check mode */ /* Overwrite num_rules parameter */ /* Dump last section */