From 5cd3c071a3b084f79d6f6d5e51fac386b198ea7f Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 25 Feb 2022 09:27:44 +0000 Subject: [PATCH] test/efd: fix sockets mask size [ upstream commit 3b0e34e80b55bbd683f4aa8257e25cbea029489b ] 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") Signed-off-by: Pablo de Lara Acked-by: Yipeng Wang --- 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 180dc4748e..97498d57aa 100644 --- a/app/test/test_efd.c +++ b/app/test/test_efd.c @@ -98,7 +98,7 @@ static inline uint8_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); }