Date: Wed, 21 May 2014 06:25:18 -0700 From: Sean Bruno <sbruno@ignoranthack.me> To: Adrian Chadd <adrian@freebsd.org> Cc: FreeBSD Net <freebsd-net@freebsd.org> Subject: Re: [rfc] add non-contiguous CPU ID support to in_rss.c Message-ID: <1400678718.973.0.camel@bruno> In-Reply-To: <CAJ-Vmomv%2BwEbfmUz5TALpM0OezzeCF_X4juyLjzERT4Us8Yweg@mail.gmail.com> References: <CAJ-Vmomv%2BwEbfmUz5TALpM0OezzeCF_X4juyLjzERT4Us8Yweg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2014-05-20 at 23:52 -0700, Adrian Chadd wrote:
> Hi Robert,
>
> This patch uses CPU_FIRST() and CPU_NEXT() to iterate over the CPU IDs.
>
> Think this is alright?
>
> -a
>
>
> Index: sys/netinet/in_rss.c
> ===================================================================
> --- sys/netinet/in_rss.c (revision 266429)
> +++ sys/netinet/in_rss.c (working copy)
> @@ -176,6 +176,7 @@
> rss_init(__unused void *arg)
> {
> u_int i;
> + u_int cpuid;
>
> /*
> * Validate tunables, coerce to sensible values.
> @@ -245,11 +246,12 @@
>
> /*
> * 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.
> __
Yah, I did something similar in igb(4) to assign queues to CPU more
correctly.
sean
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1400678718.973.0.camel>
