From owner-svn-src-head@FreeBSD.ORG Thu May 22 07:25:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03DAEE1; Thu, 22 May 2014 07:25:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E605B227B; Thu, 22 May 2014 07:25:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4M7PaNV088485; Thu, 22 May 2014 07:25:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M7PaQA088484; Thu, 22 May 2014 07:25:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405220725.s4M7PaQA088484@svn.freebsd.org> From: Adrian Chadd Date: Thu, 22 May 2014 07:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266537 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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: Thu, 22 May 2014 07:25:37 -0000 Author: adrian Date: Thu May 22 07:25:36 2014 New Revision: 266537 URL: http://svnweb.freebsd.org/changeset/base/266537 Log: Use CPU_FIRST() / CPU_NEXT() to iterate over the valid CPU IDs. Modified: head/sys/netinet/in_rss.c Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Thu May 22 06:40:07 2014 (r266536) +++ head/sys/netinet/in_rss.c Thu May 22 07:25:36 2014 (r266537) @@ -176,6 +176,7 @@ static void rss_init(__unused void *arg) { u_int i; + u_int cpuid; /* * Validate tunables, coerce to sensible values. @@ -245,11 +246,12 @@ rss_init(__unused void *arg) /* * Set up initial CPU assignments: round-robin by default. - * - * XXXRW: Need a mapping to non-contiguous IDs here. */ - for (i = 0; i < rss_buckets; i++) - rss_table[i].rte_cpu = i % rss_ncpus; + cpuid = CPU_FIRST(); + for (i = 0; i < rss_buckets; i++) { + rss_table[i].rte_cpu = cpuid; + cpuid = CPU_NEXT(cpuid); + } /* * Randomize rrs_key.