DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] test/efd: fix size of constant
@ 2022-02-24 15:48 Pablo de Lara
  2022-02-24 15:48 ` [PATCH 2/2] efd: fix uninitialized structure Pablo de Lara
  2022-02-24 15:57 ` [PATCH v2 1/2] test/efd: fix size of constant Pablo de Lara
  0 siblings, 2 replies; 9+ messages in thread
From: Pablo de Lara @ 2022-02-24 15:48 UTC (permalink / raw)
  To: yipeng1.wang, byron.marohn; +Cc: dev, Pablo de Lara, stable

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@intel.com
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-02-27 17:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24 15:48 [PATCH 1/2] test/efd: fix size of constant Pablo de Lara
2022-02-24 15:48 ` [PATCH 2/2] efd: fix uninitialized structure Pablo de Lara
2022-02-24 15:57 ` [PATCH v2 1/2] test/efd: fix size of constant Pablo de Lara
2022-02-24 15:57   ` [PATCH v2 2/2] efd: fix uninitialized structure Pablo de Lara
2022-02-24 17:14     ` Wang, Yipeng1
2022-02-24 17:15   ` [PATCH v2 1/2] test/efd: fix size of constant Wang, Yipeng1
2022-02-25  9:27   ` [PATCH v3 " Pablo de Lara
2022-02-25  9:27     ` [PATCH v3 2/2] efd: fix uninitialized structure Pablo de Lara
2022-02-27 17:59       ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).