From mboxrd@z Thu Jan 1 00:00:00 1970 From: "David S. Miller" Subject: Re: [PATCH] fix iptables on systems with discontiguous processor ids Date: Mon, 10 Oct 2005 15:06:23 -0700 (PDT) Message-ID: <20051010.150623.94217913.davem@davemloft.net> References: <20051010.141518.60492651.davem@davemloft.net> <434AE017.2020905@trash.net> <434AE28B.2070607@trash.net> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: laforge@netfilter.org, netfilter-devel@lists.netfilter.org Return-path: To: kaber@trash.net In-Reply-To: <434AE28B.2070607@trash.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: netfilter-devel-bounces@lists.netfilter.org Errors-To: netfilter-devel-bounces@lists.netfilter.org List-Id: netfilter-devel.vger.kernel.org From: Patrick McHardy Date: Mon, 10 Oct 2005 23:52:11 +0200 > I don't know which other architectures are affected by this, but for > the case Dave mentioned some function > > static inline int cpu_physical_id(void) > { > return smp_processor_id() >> 1; > } > > should also solve the problem. Even if not as easily implementable > as this. it looks like a logical complement to num_possible_cpus(). Stop papering around this issue, please. :-) The cpu ID space is discontiguous, period. If you need to allocate per-cpu data there are very straightforward ways to do this. Many other subsystems do this in an error free manner and I think netfilter iptables can do it too. :)