]> git.droids-corp.org - dpdk.git/commitdiff
test/efd: fix sockets mask size
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Fri, 25 Feb 2022 09:27:44 +0000 (09:27 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 27 Feb 2022 17:57:45 +0000 (18:57 +0100)
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: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
app/test/test_efd.c

index 7bea674086b9fa53ae1e23d9b309e2e03ebacbed..fa29e8f97aa3b6ace8cec956f76e9e489205fb63 100644 (file)
@@ -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);
        }