[v3] eal/windows: ensure all enabled CPUs are counted
Checks
Commit Message
From: Narcisa Vasile <navasile@microsoft.com>
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: pallavi.kadam@intel.com
Cc: stable@dpdk.org
Signed-off-by: Narcisa Vasile <navasile@microsoft.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Pallavi Kadam <pallavi.kadam@intel.com>
---
lib/eal/windows/include/sched.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, Aug 18, 2021 at 06:46:00AM -0700, Narcisa Ana Maria Vasile wrote:
> From: Narcisa Vasile <navasile@microsoft.com>
>
> 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: pallavi.kadam@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Narcisa Vasile <navasile@microsoft.com>
> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> Acked-by: Pallavi Kadam <pallavi.kadam@intel.com>
> ---
Can this be merged? This small fix will solve the issues related to threads
affinity on Windows. Thanks!
18/08/2021 15:46, Narcisa Ana Maria Vasile:
> From: Narcisa Vasile <navasile@microsoft.com>
>
> 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: pallavi.kadam@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Narcisa Vasile <navasile@microsoft.com>
> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> Acked-by: Pallavi Kadam <pallavi.kadam@intel.com>
Applied, thanks.
Sorry for the delay.
@@ -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;