Skip to content

Commit

Permalink
test/efd: fix sockets mask size
Browse files Browse the repository at this point in the history
[ upstream commit 3b0e34e ]

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: 8751a7e ("efd: allow more CPU sockets in table creation")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
  • Loading branch information
pablodelara authored and bluca committed Feb 28, 2022
1 parent 3fc564b commit 5cd3c07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/test/test_efd.c
Expand Up @@ -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);
}

Expand Down

0 comments on commit 5cd3c07

Please sign in to comment.