Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 May 2015 21:51:37 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r283303 - in stable/10/sys: amd64/include netpfil/pf
Message-ID:  <201505222151.t4MLpb76094089@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Fri May 22 21:51:36 2015
New Revision: 283303
URL: https://svnweb.freebsd.org/changeset/base/283303

Log:
  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.

Modified:
  stable/10/sys/amd64/include/param.h
  stable/10/sys/netpfil/pf/pf.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/include/param.h
==============================================================================
--- stable/10/sys/amd64/include/param.h	Fri May 22 21:38:11 2015	(r283302)
+++ stable/10/sys/amd64/include/param.h	Fri May 22 21:51:36 2015	(r283303)
@@ -65,7 +65,7 @@
 
 #if defined(SMP) || defined(KLD_MODULE)
 #ifndef MAXCPU
-#define MAXCPU		64
+#define MAXCPU		256
 #endif
 #else
 #define MAXCPU		1

Modified: stable/10/sys/netpfil/pf/pf.c
==============================================================================
--- stable/10/sys/netpfil/pf/pf.c	Fri May 22 21:38:11 2015	(r283302)
+++ stable/10/sys/netpfil/pf/pf.c	Fri May 22 21:51:36 2015	(r283303)
@@ -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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505222151.t4MLpb76094089>