From: Willy Tarreau Date: Sat, 22 Apr 2023 17:26:07 +0000 (+0200) Subject: BUG/MINOR: config: fix NUMA topology detection on FreeBSD X-Git-Tag: v2.8-dev8~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1a0107f9c40b366efed75372c92029c13bb7b46;p=thirdparty%2Fhaproxy.git BUG/MINOR: config: fix NUMA topology detection on FreeBSD In 2.6-dev1, NUMA topology detection was enabled on FreeBSD with commit f5d48f8b3 ("MEDIUM: cfgparse: numa detect topology on FreeBSD."). But it suffers from a minor bug which is that it forgets to check for the number of domains and always emits a confusing warning indicating that multiple sockets were found while it's not the case. This can be backported to 2.6. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index a8b6bb8693..9855ee1cc5 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -2701,6 +2701,9 @@ static int numa_detect_topology() BUG_ON(ndomains > MAXMEMDOM); ha_cpuset_zero(&node_cpu_set); + if (ndomains < 2) + goto leave; + /* * We retrieve the first active valid CPU domain * with active cpu and binding it, we returns @@ -2726,7 +2729,7 @@ static int numa_detect_topology() } break; } - + leave: return ha_cpuset_count(&node_cpu_set); }