Thread (9 messages) flat view 9 messages, 4 authors, 2021-10-11

[dpdk-dev] [PATCH] eal/windows: ensure all the CPUs in the set are checked

From: Narcisa Ana Maria Vasile <hidden>
Date: 2021-06-25 00:27:36
Subsystem: library code, the rest · Maintainers: Andrew Morton, Linus Torvalds

From: Narcisa Vasile <redacted>

Fix count_cpu() to ensure it iterates through all the CPUs in a set.
count_cpu() iterates through the CPUs in the set 's' and counts the
selected ones.

Previously, it was incorrectly using the number of CPUSETS to iterate
through the CPUs.

Signed-off-by: Narcisa Vasile <redacted>
---
 lib/eal/windows/include/sched.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
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;
-- 
2.31.0.vfs.0.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help