[PATCH] app/pdump: check lcore is not the maximum core

Stephen Hemminger stephen at networkplumber.org
Fri Feb 18 17:27:23 CET 2022


On Fri, 18 Feb 2022 15:18:41 +0000
Reshma Pattan <reshma.pattan at intel.com> wrote:

>  	lcore_id = rte_get_next_lcore(lcore_id, 1, 0);
> +	if (lcore_id == RTE_MAX_LCORE) {
> +		printf("Invalid core %u for the packet capture!\n", lcore_id);
> +		return;
> +	}

Since nothing useful can be done, maybe rte_exit()?
Or at least print to stderr and return error status.

Also, if you write same code in two places, it should
be a function.


More information about the stable mailing list