From owner-svn-src-head@freebsd.org Fri Jun 15 21:20:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C87AD101D069; Fri, 15 Jun 2018 21:20:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com [209.85.223.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69E7B840A3; Fri, 15 Jun 2018 21:20:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f181.google.com with SMTP id d185-v6so11946496ioe.0; Fri, 15 Jun 2018 14:20:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=EY9hwJplPCSOiAXV/cOVQzii5fI3hNKGAZ9T5eWhjv0=; b=bnQomT/oR9LBF9d4+aU4E7zZ8bbD7G7RXMOR4CPnJ/aE9w5MGZ2JR3d/1hhEpmAWVB CoRjDsKdZ22rMzQipYjx8+TLUCwDFUsFT2ho8VUeib71B52z7i8UELfaCxsK8LXiCoa1 aBV/bFURKaiP7LwFfQ13CV6AVotuSttv+K7YC11Y3RQAZ25hFjXvdQbd/hYqsCgVIP6u RlgdGMihkyYy0eZs+nH6TP5NqlI8K70MKbRmuF+B0zLqj/hW8GkghTZbVe+v4POCVir0 u4noeFGQooKY2KbpDFRd0iUqtyQVx9RUtUITNhHYkVaoClWZyKKB05RyV4aOZ743JguV ZbxA== X-Gm-Message-State: APt69E2q7swOi6UKAxt6vL8mPkNbvzAOFK2vmiHXlYRJPBmukJAyPm61 hajMXkRINj92hT326pf9WEEFVF3H X-Google-Smtp-Source: ADUXVKL4nG2JNvmn/s1IwpScrHj5i1DQprwhqJSr4Jc171bgP6KdBkKeH4NMtml4fcMwjxlj9o2Yyg== X-Received: by 2002:a6b:2550:: with SMTP id l77-v6mr2774918iol.47.1529097276043; Fri, 15 Jun 2018 14:14:36 -0700 (PDT) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com. [209.85.214.46]) by smtp.gmail.com with ESMTPSA id m13-v6sm3411491iob.86.2018.06.15.14.14.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jun 2018 14:14:35 -0700 (PDT) Received: by mail-it0-f46.google.com with SMTP id v83-v6so4600084itc.3; Fri, 15 Jun 2018 14:14:35 -0700 (PDT) X-Received: by 2002:a24:ed4a:: with SMTP id r71-v6mr2684082ith.53.1529097275795; Fri, 15 Jun 2018 14:14:35 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:5995:0:0:0:0:0 with HTTP; Fri, 15 Jun 2018 14:14:35 -0700 (PDT) In-Reply-To: <201806151804.w5FI4i46064041@repo.freebsd.org> References: <201806151804.w5FI4i46064041@repo.freebsd.org> From: Conrad Meyer Date: Fri, 15 Jun 2018 14:14:35 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335223 - head/sys/dev/cxgbe To: Navdeep Parhar Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 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: Fri, 15 Jun 2018 21:20:43 -0000 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 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);