Date: Fri, 15 Jun 2018 14:34:31 -0700 From: Navdeep Parhar <np@FreeBSD.org> To: cem@freebsd.org Cc: src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335223 - head/sys/dev/cxgbe Message-ID: <e9497d49-46de-e469-89e5-8bb566749dff@FreeBSD.org> In-Reply-To: <CAG6CVpWFV8mxF%2BMtyDLXDtRyG981izsBqR9huZX9y7bur231wg@mail.gmail.com> References: <201806151804.w5FI4i46064041@repo.freebsd.org> <CAG6CVpWFV8mxF%2BMtyDLXDtRyG981izsBqR9huZX9y7bur231wg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
I'm all for these sysctls becoming %intr_cpus and %local_cpus and being filled up by the device's parent automatically. But I'd like to tweak the output a bit so that it can be fed directly to cpuset -l. Regards, Navdeep On 06/15/18 14:14, Conrad Meyer wrote: > This seems generally useful, and nothing about the code is specific to > cxgbe. Could it be adapted to be driver-agnostic? > > Thanks, > Conrad > > On Fri, Jun 15, 2018 at 11:04 AM, Navdeep Parhar <np@freebsd.org> wrote: >> Author: np >> Date: Fri Jun 15 18:04:44 2018 >> New Revision: 335223 >> URL: https://svnweb.freebsd.org/changeset/base/335223 >> >> Log: >> cxgbe(4): sysctls to display the local and intr CPUs for the adapter. >> ... >> +} >> + >> +static int >> +sysctl_cpus(SYSCTL_HANDLER_ARGS) >> +{ >> ... >> + rc = bus_get_cpus(sc->dev, op, sizeof(cpuset), &cpuset); >> + if (rc != 0) >> + return (rc); >> + >> ... >> + CPU_FOREACH(i) >> + sbuf_printf(sb, "%d ", i); >> + rc = sbuf_finish(sb); >> + sbuf_delete(sb);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e9497d49-46de-e469-89e5-8bb566749dff>