src/dpdk/drivers/net/qede/qede_debug.c
static u32 qed_ilt_dump_pages_section(struct ecore_hwfn *p_hwfn,
				      u32 *dump_buf,
				      bool dump,
				      u32 valid_conn_pf_pages,
				      u32 valid_conn_vf_pages,
				      struct phys_mem_desc *ilt_pages,
				      bool dump_page_ids)
{
	struct ecore_ilt_client_cfg *clients = p_hwfn->p_cxt_mngr->clients;
	u32 pf_start_line, start_page_id, offset = 0;
	u32 cdut_pf_init_pages, cdut_vf_init_pages;
	u32 cdut_pf_work_pages, cdut_vf_work_pages;
	u32 base_data_offset, size_param_offset;
	u32 cdut_pf_pages, cdut_vf_pages;
	const char *section_name;
	u8 i;

	section_name = dump_page_ids ? "ilt_page_ids" : "ilt_page_mem";
	cdut_pf_init_pages = ecore_get_cdut_num_pf_init_pages(p_hwfn);
	cdut_vf_init_pages = ecore_get_cdut_num_vf_init_pages(p_hwfn);
	cdut_pf_work_pages = ecore_get_cdut_num_pf_work_pages(p_hwfn);
	cdut_vf_work_pages = ecore_get_cdut_num_vf_work_pages(p_hwfn);
	cdut_pf_pages = cdut_pf_init_pages + cdut_pf_work_pages;
	cdut_vf_pages = cdut_vf_init_pages + cdut_vf_work_pages;
	pf_start_line = p_hwfn->p_cxt_mngr->pf_start_line;

	offset +=
	    qed_dump_section_hdr(dump_buf + offset, dump, section_name, 1);

	/* Dump size parameter (0 for now, overwritten with real size later) */
	size_param_offset = offset;
	offset += qed_dump_num_param(dump_buf + offset, dump, "size", 0);
	base_data_offset = offset;

	/* CDUC pages are ordered as follows:
	 * - PF pages - valid section (included in PF connection type mapping)
	 * - PF pages - invalid section (not dumped)
	 * - For each VF in the PF:
	 *   - VF pages - valid section (included in VF connection type mapping)
	 *   - VF pages - invalid section (not dumped)
	 */
	if (qed_grc_get_param(p_hwfn, DBG_GRC_PARAM_DUMP_ILT_CDUC)) {
		/* Dump connection PF pages */
		start_page_id = clients[ILT_CLI_CDUC].first.val - pf_start_line;
		offset += qed_ilt_dump_pages_range(dump_buf + offset,
						   dump,
						   start_page_id,
						   valid_conn_pf_pages,
						   ilt_pages, dump_page_ids);

		/* Dump connection VF pages */
		start_page_id += clients[ILT_CLI_CDUC].pf_total_lines;
		for (i = 0; i < p_hwfn->p_cxt_mngr->vf_count;
		     i++, start_page_id += clients[ILT_CLI_CDUC].vf_total_lines)
			offset += qed_ilt_dump_pages_range(dump_buf + offset,
							   dump,
							   start_page_id,
							   valid_conn_vf_pages,
							   ilt_pages,
							   dump_page_ids);
	}

	/* CDUT pages are ordered as follows:
	 * - PF init pages (not dumped)
	 * - PF work pages
	 * - For each VF in the PF:
	 *   - VF init pages (not dumped)
	 *   - VF work pages
	 */
	if (qed_grc_get_param(p_hwfn, DBG_GRC_PARAM_DUMP_ILT_CDUT)) {
		/* Dump task PF pages */
		start_page_id = clients[ILT_CLI_CDUT].first.val +
		    cdut_pf_init_pages - pf_start_line;
		offset += qed_ilt_dump_pages_range(dump_buf + offset,
						   dump,
						   start_page_id,
						   cdut_pf_work_pages,
						   ilt_pages, dump_page_ids);

		/* Dump task VF pages */
		start_page_id = clients[ILT_CLI_CDUT].first.val +
		    cdut_pf_pages + cdut_vf_init_pages - pf_start_line;
		for (i = 0; i < p_hwfn->p_cxt_mngr->vf_count;
		     i++, start_page_id += cdut_vf_pages)
			offset += qed_ilt_dump_pages_range(dump_buf + offset,
							   dump,
							   start_page_id,
							   cdut_vf_work_pages,
							   ilt_pages,
							   dump_page_ids);
	}

	/* Overwrite size param */
	if (dump)
		qed_dump_num_param(dump_buf + size_param_offset,
				   dump, "size", offset - base_data_offset);

	return offset;
}
/* Dumps a section containing the dumped ILT pages.
 * Returns the dumped size in dwords.
 */
Dumps a section containing the dumped ILT pages.
Returns the dumped size in dwords.
Dumps a section containing the dumped ILT pages . Returns the dumped size in dwords .
static u32 qed_ilt_dump_pages_section(struct ecore_hwfn *p_hwfn,
				      u32 *dump_buf,
				      bool dump,
				      u32 valid_conn_pf_pages,
				      u32 valid_conn_vf_pages,
				      struct phys_mem_desc *ilt_pages,
				      bool dump_page_ids)
{
	struct ecore_ilt_client_cfg *clients = p_hwfn->p_cxt_mngr->clients;
	u32 pf_start_line, start_page_id, offset = 0;
	u32 cdut_pf_init_pages, cdut_vf_init_pages;
	u32 cdut_pf_work_pages, cdut_vf_work_pages;
	u32 base_data_offset, size_param_offset;
	u32 cdut_pf_pages, cdut_vf_pages;
	const char *section_name;
	u8 i;
	section_name = dump_page_ids ? "ilt_page_ids" : "ilt_page_mem";
	cdut_pf_init_pages = ecore_get_cdut_num_pf_init_pages(p_hwfn);
	cdut_vf_init_pages = ecore_get_cdut_num_vf_init_pages(p_hwfn);
	cdut_pf_work_pages = ecore_get_cdut_num_pf_work_pages(p_hwfn);
	cdut_vf_work_pages = ecore_get_cdut_num_vf_work_pages(p_hwfn);
	cdut_pf_pages = cdut_pf_init_pages + cdut_pf_work_pages;
	cdut_vf_pages = cdut_vf_init_pages + cdut_vf_work_pages;
	pf_start_line = p_hwfn->p_cxt_mngr->pf_start_line;
	offset +=
	    qed_dump_section_hdr(dump_buf + offset, dump, section_name, 1);
	size_param_offset = offset;
	offset += qed_dump_num_param(dump_buf + offset, dump, "size", 0);
	base_data_offset = offset;
	if (qed_grc_get_param(p_hwfn, DBG_GRC_PARAM_DUMP_ILT_CDUC)) {
		start_page_id = clients[ILT_CLI_CDUC].first.val - pf_start_line;
		offset += qed_ilt_dump_pages_range(dump_buf + offset,
						   dump,
						   start_page_id,
						   valid_conn_pf_pages,
						   ilt_pages, dump_page_ids);
		start_page_id += clients[ILT_CLI_CDUC].pf_total_lines;
		for (i = 0; i < p_hwfn->p_cxt_mngr->vf_count;
		     i++, start_page_id += clients[ILT_CLI_CDUC].vf_total_lines)
			offset += qed_ilt_dump_pages_range(dump_buf + offset,
							   dump,
							   start_page_id,
							   valid_conn_vf_pages,
							   ilt_pages,
							   dump_page_ids);
	}
	if (qed_grc_get_param(p_hwfn, DBG_GRC_PARAM_DUMP_ILT_CDUT)) {
		start_page_id = clients[ILT_CLI_CDUT].first.val +
		    cdut_pf_init_pages - pf_start_line;
		offset += qed_ilt_dump_pages_range(dump_buf + offset,
						   dump,
						   start_page_id,
						   cdut_pf_work_pages,
						   ilt_pages, dump_page_ids);
		start_page_id = clients[ILT_CLI_CDUT].first.val +
		    cdut_pf_pages + cdut_vf_init_pages - pf_start_line;
		for (i = 0; i < p_hwfn->p_cxt_mngr->vf_count;
		     i++, start_page_id += cdut_vf_pages)
			offset += qed_ilt_dump_pages_range(dump_buf + offset,
							   dump,
							   start_page_id,
							   cdut_vf_work_pages,
							   ilt_pages,
							   dump_page_ids);
	}
	if (dump)
		qed_dump_num_param(dump_buf + size_param_offset,
				   dump, "size", offset - base_data_offset);
	return offset;
}
static u32 qed_ilt_dump_pages_section ( struct ecore_hwfn * p_hwfn , u32 * dump_buf , bool dump , u32 valid_conn_pf_pages , u32 valid_conn_vf_pages , struct phys_mem_desc * ilt_pages , bool dump_page_ids ) { struct ecore_ilt_client_cfg * clients = p_hwfn -> p_cxt_mngr -> clients ; u32 pf_start_line , start_page_id , offset = 0 ; u32 cdut_pf_init_pages , cdut_vf_init_pages ; u32 cdut_pf_work_pages , cdut_vf_work_pages ; u32 base_data_offset , size_param_offset ; u32 cdut_pf_pages , cdut_vf_pages ; const char * section_name ; u8 i ; section_name = dump_page_ids ? " " : " " ; cdut_pf_init_pages = ecore_get_cdut_num_pf_init_pages ( p_hwfn ) ; cdut_vf_init_pages = ecore_get_cdut_num_vf_init_pages ( p_hwfn ) ; cdut_pf_work_pages = ecore_get_cdut_num_pf_work_pages ( p_hwfn ) ; cdut_vf_work_pages = ecore_get_cdut_num_vf_work_pages ( p_hwfn ) ; cdut_pf_pages = cdut_pf_init_pages + cdut_pf_work_pages ; cdut_vf_pages = cdut_vf_init_pages + cdut_vf_work_pages ; pf_start_line = p_hwfn -> p_cxt_mngr -> pf_start_line ; offset += qed_dump_section_hdr ( dump_buf + offset , dump , section_name , 1 ) ; size_param_offset = offset ; offset += qed_dump_num_param ( dump_buf + offset , dump , " " , 0 ) ; base_data_offset = offset ; if ( qed_grc_get_param ( p_hwfn , DBG_GRC_PARAM_DUMP_ILT_CDUC ) ) { start_page_id = clients [ ILT_CLI_CDUC ] . first . val - pf_start_line ; offset += qed_ilt_dump_pages_range ( dump_buf + offset , dump , start_page_id , valid_conn_pf_pages , ilt_pages , dump_page_ids ) ; start_page_id += clients [ ILT_CLI_CDUC ] . pf_total_lines ; for ( i = 0 ; i < p_hwfn -> p_cxt_mngr -> vf_count ; i ++ , start_page_id += clients [ ILT_CLI_CDUC ] . vf_total_lines ) offset += qed_ilt_dump_pages_range ( dump_buf + offset , dump , start_page_id , valid_conn_vf_pages , ilt_pages , dump_page_ids ) ; } if ( qed_grc_get_param ( p_hwfn , DBG_GRC_PARAM_DUMP_ILT_CDUT ) ) { start_page_id = clients [ ILT_CLI_CDUT ] . first . val + cdut_pf_init_pages - pf_start_line ; offset += qed_ilt_dump_pages_range ( dump_buf + offset , dump , start_page_id , cdut_pf_work_pages , ilt_pages , dump_page_ids ) ; start_page_id = clients [ ILT_CLI_CDUT ] . first . val + cdut_pf_pages + cdut_vf_init_pages - pf_start_line ; for ( i = 0 ; i < p_hwfn -> p_cxt_mngr -> vf_count ; i ++ , start_page_id += cdut_vf_pages ) offset += qed_ilt_dump_pages_range ( dump_buf + offset , dump , start_page_id , cdut_vf_work_pages , ilt_pages , dump_page_ids ) ; } if ( dump ) qed_dump_num_param ( dump_buf + size_param_offset , dump , " " , offset - base_data_offset ) ; return offset ; }
Dumps a section containing the dumped ILT pages.
Dumps a section containing the dumped ILT pages .
/* Dump size parameter (0 for now, overwritten with real size later) */ /* CDUC pages are ordered as follows:
	 * - PF pages - valid section (included in PF connection type mapping)
	 * - PF pages - invalid section (not dumped)
	 * - For each VF in the PF:
	 *   - VF pages - valid section (included in VF connection type mapping)
	 *   - VF pages - invalid section (not dumped)
	 */ /* Dump connection PF pages */ /* Dump connection VF pages */ /* CDUT pages are ordered as follows:
	 * - PF init pages (not dumped)
	 * - PF work pages
	 * - For each VF in the PF:
	 *   - VF init pages (not dumped)
	 *   - VF work pages
	 */ /* Dump task PF pages */ /* Dump task VF pages */ /* Overwrite size param */