[PATCH v2 1/2] test/efd: fix size of constant

Wang, Yipeng1 yipeng1.wang at intel.com
Thu Feb 24 18:15:12 CET 2022


> -----Original Message-----
> From: De Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>
> Sent: Thursday, February 24, 2022 7:58 AM
> To: Wang, Yipeng1 <yipeng1.wang at intel.com>; Marohn, Byron
> <byron.marohn at intel.com>
> Cc: dev at dpdk.org; De Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>;
> stable at dpdk.org
> Subject: [PATCH v2 1/2] test/efd: fix size of constant
> 
> Constant value 1 has a size of 32 bits, and shifting it more than 32 bits to the
> left overflows. 1ULL is needed to be able to get a 64-bit value.
> 
> Coverity ID: 375846
> Fixes: 8751a7e9832b ("efd: allow more CPU sockets in table creation")
> Cc: pablo.de.lara.guarch at intel.com
> Cc: stable at dpdk.org
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
> ---
>  app/test/test_efd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test/test_efd.c b/app/test/test_efd.c index
> 7bea674086..fa29e8f97a 100644
> --- a/app/test/test_efd.c
> +++ b/app/test/test_efd.c
> @@ -107,7 +107,7 @@ static inline uint64_t
> efd_get_all_sockets_bitmask(void)
>  	unsigned int next_lcore = rte_get_main_lcore();
>  	const int val_true = 1, val_false = 0;
>  	for (i = 0; i < rte_lcore_count(); i++) {
> -		all_cpu_sockets_bitmask |= 1 <<
> rte_lcore_to_socket_id(next_lcore);
> +		all_cpu_sockets_bitmask |= 1ULL <<
> +rte_lcore_to_socket_id(next_lcore);
>  		next_lcore = rte_get_next_lcore(next_lcore, val_false,
> val_true);
>  	}
> 
> --
> 2.25.1
Acked-by: Yipeng Wang <yipeng1.wang at intel.com>



More information about the stable mailing list