From: Narcisa Vasile Date: Wed, 18 Aug 2021 13:46:00 +0000 (-0700) Subject: eal/windows: fix CPU cores counting X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=694c81721ef0a04432cd725642cfe74075a32f19;p=dpdk.git eal/windows: fix CPU cores counting On Windows, -l/--lcores EAL option was unable to process CPU sets containing CPUs other than 0 and 1, because CPU_COUNT() macro only checked these CPUs in the set. Fix CPU_COUNT() by enumerating all possible CPU indices. Fixes: e8428a9d89f1 ("eal/windows: add some basic functions and macros") Cc: stable@dpdk.org Signed-off-by: Narcisa Vasile Acked-by: Dmitry Kozlyuk Acked-by: Pallavi Kadam --- diff --git a/lib/eal/windows/include/sched.h b/lib/eal/windows/include/sched.h index ff572b5dcb..bc31cc8465 100644 --- a/lib/eal/windows/include/sched.h +++ b/lib/eal/windows/include/sched.h @@ -49,7 +49,7 @@ count_cpu(rte_cpuset_t *s) unsigned int _i; int count = 0; - for (_i = 0; _i < _NUM_SETS(CPU_SETSIZE); _i++) + for (_i = 0; _i < CPU_SETSIZE; _i++) if (CPU_ISSET(_i, s) != 0LL) count++; return count;