[PATCH 04/10] net/nfp: improve the logic readability

Stephen Hemminger stephen at networkplumber.org
Thu Oct 10 17:10:44 CEST 2024


On Thu, 10 Oct 2024 17:17:10 +0800
Chaoyong He <chaoyong.he at corigine.com> wrote:

> +
> +port_cleanup:
> +	for (uint32_t j = 0; j < i; j++) {
> +		struct rte_eth_dev *eth_dev;
> +
> +		nfp_port_name_generate(port_name, sizeof(port_name), j, pf_dev);
> +		eth_dev = rte_eth_dev_get_by_name(port_name);
> +		if (eth_dev != NULL)
> +			rte_eth_dev_destroy(eth_dev, NULL);
> +	}
> +

You could skip the lookup if you kept an array of eth_dev's that were created?


More information about the dev mailing list