From owner-svn-src-head@FreeBSD.ORG Fri Feb 4 18:56:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 476D41065675; Fri, 4 Feb 2011 18:56:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 181338FC1B; Fri, 4 Feb 2011 18:56:53 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id A10F046B17; Fri, 4 Feb 2011 13:56:52 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C40968A009; Fri, 4 Feb 2011 13:56:51 -0500 (EST) From: John Baldwin To: Julian Elischer Date: Fri, 4 Feb 2011 13:56:39 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201102031922.p13JML8i055697@svn.freebsd.org> <4D4C45C9.4080105@freebsd.org> In-Reply-To: <4D4C45C9.4080105@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102041356.39777.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Fri, 04 Feb 2011 13:56:51 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=0.5 required=4.2 tests=BAYES_00,MAY_BE_FORGED, RDNS_DYNAMIC autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson Subject: Re: svn commit: r218232 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Feb 2011 18:56:53 -0000 On Friday, February 04, 2011 1:30:33 pm Julian Elischer wrote: > On 2/4/11 9:38 AM, Robert Watson wrote: > > > > On Thu, 3 Feb 2011, John Baldwin wrote: > > > >>> 1) Move per John Baldwin to mp_maxid > >>> 2) Some signed/unsigned errors found by Mac OS compiler (from > >>> Michael) > >>> 3) a couple of copyright updates on the effected files. > >> > >> Note that mp_maxid is the maxium valid ID, so you typically have to > >> do things like: > >> > >> for (i = 0; i <= mp_maxid; i++) { > >> if (CPU_ABSENT(i)) > >> continue; > >> ... > >> } > >> > >> There is a CPU_FOREACH() macro that does the above (but assumes you > >> want to skip over non-existent CPUs). > > > > I'm finding the network stack requires quite a bit more along these > > lines, btw. I'd love also to have: > > > > PACKAGE_FOREACH() > > CORE_FOREACH() > > HWTHREAD_FOREACH() > > > > I agree, which is why I usually support adding such iterators though > some people scream about them. > (e.g. FOREACH_THREAD_IN_PROC and there is one for iterating through > vnets too.) The difference here is that FOREACH_THREAD_IN_PROC() is just a TAILQ_FOREACH(). The CPU iterators are more complex. I agree that that we should have topology-aware iterators, though part of the problem is what do you iterate? We'd have to create new sets of package and core IDs. For HWTHREAD_FOREACH() you can already use CPU_FOREACH(). -- John Baldwin