summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2015-05-22 21:51:36 +0000
committerjhb <jhb@FreeBSD.org>2015-05-22 21:51:36 +0000
commitb92445bf9a2ef33df94a7bff88476bf99d58a84b (patch)
tree6e5e85e6d461fcdf3c05690bc9350cd8df1ab060
parent59be327480c095b26da7900354fc02b4b776a5db (diff)
downloadFreeBSD-src-b92445bf9a2ef33df94a7bff88476bf99d58a84b.zip
FreeBSD-src-b92445bf9a2ef33df94a7bff88476bf99d58a84b.tar.gz
MFC 266852,270223:
- Fix pf(4) to build with MAXCPU set to 256. MAXCPU is actually a count, not a maximum ID value (so it is a cap on mp_ncpus, not mp_maxid). - Bump MAXCPU on amd64 from 64 to 256. In practice APIC only permits 255 CPUs (IDs 0 through 254). Getting above that limit requires x2APIC.
-rw-r--r--sys/amd64/include/param.h2
-rw-r--r--sys/netpfil/pf/pf.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/amd64/include/param.h b/sys/amd64/include/param.h
index 3d4722b..e8991b0 100644
--- a/sys/amd64/include/param.h
+++ b/sys/amd64/include/param.h
@@ -65,7 +65,7 @@
#if defined(SMP) || defined(KLD_MODULE)
#ifndef MAXCPU
-#define MAXCPU 64
+#define MAXCPU 256
#endif
#else
#define MAXCPU 1
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index 302771d..e03d2c2 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -195,7 +195,7 @@ VNET_DEFINE(uint64_t, pf_stateid[MAXCPU]);
#define PFID_CPUSHIFT (sizeof(uint64_t) * NBBY - PFID_CPUBITS)
#define PFID_CPUMASK ((uint64_t)((1 << PFID_CPUBITS) - 1) << PFID_CPUSHIFT)
#define PFID_MAXID (~PFID_CPUMASK)
-CTASSERT((1 << PFID_CPUBITS) > MAXCPU);
+CTASSERT((1 << PFID_CPUBITS) >= MAXCPU);
static void pf_src_tree_remove_state(struct pf_state *);
static void pf_init_threshold(struct pf_threshold *, u_int32_t,
OpenPOWER on IntegriCloud