Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jun 2018 14:14:35 -0700
From:      Conrad Meyer <cem@freebsd.org>
To:        Navdeep Parhar <np@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:  <CAG6CVpWFV8mxF%2BMtyDLXDtRyG981izsBqR9huZX9y7bur231wg@mail.gmail.com>
In-Reply-To: <201806151804.w5FI4i46064041@repo.freebsd.org>
References:  <201806151804.w5FI4i46064041@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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?CAG6CVpWFV8mxF%2BMtyDLXDtRyG981izsBqR9huZX9y7bur231wg>