[PATCH v2 07/10] test/eal: fix core check in c flag test

Bruce Richardson bruce.richardson at intel.com
Fri Nov 15 10:07:42 CET 2024


On Thu, Nov 14, 2024 at 11:25:05AM -0800, Stephen Hemminger wrote:
> The expression for checking which lcore is enabled for 0-7
> was wrong (missing case for 6).
> 
> Link: https://pvs-studio.com/en/blog/posts/cpp/1179/
> 
> Fixes: b0209034f2bb ("test/eal: check number of cores before running subtests")
> Cc: msantana at redhat.com
> Cc: stable at dpdk.org
> 
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>

Just wondering would it not be better/safer to put in an actual loop check
here? 
However, I'm also ok with keeping the fix as-is, so:

Acked-by: Bruce Richardson <bruce.richardson at intel.com>


> ---
>  app/test/test_eal_flags.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
> index d37d6b8627..e32f83d3c8 100644
> --- a/app/test/test_eal_flags.c
> +++ b/app/test/test_eal_flags.c
> @@ -677,8 +677,8 @@ test_missing_c_flag(void)
>  
>  	if (rte_lcore_is_enabled(0) && rte_lcore_is_enabled(1) &&
>  	    rte_lcore_is_enabled(2) && rte_lcore_is_enabled(3) &&
> -	    rte_lcore_is_enabled(3) && rte_lcore_is_enabled(5) &&
> -	    rte_lcore_is_enabled(4) && rte_lcore_is_enabled(7) &&
> +	    rte_lcore_is_enabled(4) && rte_lcore_is_enabled(5) &&
> +	    rte_lcore_is_enabled(6) && rte_lcore_is_enabled(7) &&
>  	    launch_proc(argv29) != 0) {
>  		printf("Error - "
>  		       "process did not run ok with valid corelist value\n");
> -- 
> 2.45.2
> 


More information about the dev mailing list