On Sat, 19 Feb 2022 09:59:16 +0800
"Min Hu (Connor)" <humi...@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?

Reply via email to