[PATCH] app/procinfo: add device private info dump

Stephen Hemminger stephen at networkplumber.org
Sun Feb 20 02:04:43 CET 2022


On Sat, 19 Feb 2022 09:59:16 +0800
"Min Hu (Connor)" <humin29 at huawei.com> wrote:

> +static void
> +show_port_private_info(void)
> +{
> +	int i;
> +
> +	snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD Private ");
> +	STATS_BDR_STR(10, bdr_str);
> +
> +	for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
> +		/* Skip if port is not in mask */
> +		if ((enabled_port_mask & (1ul << i)) == 0)
> +			continue;
> +
> +		/* Skip if port is unused */
> +		if (!rte_eth_dev_is_valid_port(i))
> +			continue;

Maybe use RTE_ETH_FOREACH_DEV(i) here?

Procinfo is somewhat inconsistent, some code uses, and some does not.
The difference is that FOREACH skips ports that are "owned" i.e
associated with another port.

There probably should be a clear policy in the comments about
how this command should handle ports.  My preference would be
that it shows all valid ports, all the time since this is a diagnostic
command used to debug misconfiguration. 

There is RTE_ETH_FOREACH_VALID_DEV but it is marked internal?


More information about the dev mailing list