Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 May 2014 07:25:36 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r266537 - head/sys/netinet
Message-ID:  <201405220725.s4M7PaQA088484@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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.



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