[dpdk-dev] [PATCH v3 6/7] app/proc-info: provide way to request info on owned ports
Thomas Monjalon
thomas at monjalon.net
Fri Jul 17 17:01:00 CEST 2020
15/07/2020 23:22, Stephen Hemminger:
> --- a/app/proc-info/Makefile
> +++ b/app/proc-info/Makefile
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
not needed in app/
> +CFLAGS += -O3
> CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -Wno-deprecated-declarations
Which deprecated function is used?
We must not use deprecated functions.
> + /* If no port mask was specified, one will be provided */
Would be nice to help the user by printing a port mask
of owned and unowned ports.
> + if (enabled_port_mask == 0) {
> + RTE_ETH_FOREACH_DEV(i) {
> + enabled_port_mask |= 1u << i;
> }
> }
>
> + for (port_mask = enabled_port_mask; port_mask != 0;
> + port_mask &= ~(1u << i)) {
Please would be good to help drunk or sleepy readers with few comments.
> + /* ffs() first bit is 1 not 0 */
> + i = ffs(port_mask) - 1;
> +
> + if (i >= RTE_MAX_ETHPORTS)
> + break;
This check is already done in rte_eth_dev_is_valid_port().
> +
> + if (!rte_eth_dev_is_valid_port(i))
> + continue;
More information about the dev
mailing list