From owner-freebsd-net@FreeBSD.ORG Thu Sep 23 21:07:49 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB930106566B for ; Thu, 23 Sep 2010 21:07:49 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7A3318FC0A for ; Thu, 23 Sep 2010 21:07:49 +0000 (UTC) Received: by iwn34 with SMTP id 34so2181781iwn.13 for ; Thu, 23 Sep 2010 14:07:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=wNhpEi5d1d7lWaVk30lhBGdH3q2+azeYtLzn4IhfTQc=; b=MezfzvQzz+aLSMXXPbYfMkgc+IDbv2LeuZR3bGdDmYkfQer3HgDvYJRegpi6RFOVtt ohjSnYQAtR2vkMPZVMWKS0Pvs+KwUgVX6Sw+vCx+Ve+fmA4GveLzdI7TaP+RTEqfNWnE 22CYmVMRZBjHivIwfLtOXhuPKglncrKNtWzvU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=GZlpInwmZIi8VGGiFEb3NedvjRP/rOel3KTZKv7VsYaC2+Tg8e9+0Dz2zZTppeGFwV mmBPG4atUxFrBH+7zxMySkw8BBH1iQXVWggcaPzaa/u74E+cNKa+QINb/x/qTusnJBpn 2MW2tQHjtRqRrfogGC97CG8XTLDrjvTYY0v6w= Received: by 10.231.172.83 with SMTP id k19mr2584230ibz.114.1285276068029; Thu, 23 Sep 2010 14:07:48 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id g31sm1243962ibh.10.2010.09.23.14.07.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 23 Sep 2010 14:07:46 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Thu, 23 Sep 2010 14:06:56 -0700 From: Pyun YongHyeon Date: Thu, 23 Sep 2010 14:06:56 -0700 To: David Christensen Message-ID: <20100923210656.GE15014@michelle.cdnetworks.com> References: <4C9B8A50.9060602@tomjudge.com> <5D267A3F22FD854F8F48B3D2B52381933B5A78B444@IRVEXCHCCR01.corp.ad.broadcom.com> <20100923182033.GA15014@michelle.cdnetworks.com> <5D267A3F22FD854F8F48B3D2B52381933B5A78B55C@IRVEXCHCCR01.corp.ad.broadcom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5D267A3F22FD854F8F48B3D2B52381933B5A78B55C@IRVEXCHCCR01.corp.ad.broadcom.com> User-Agent: Mutt/1.4.2.3i Cc: Tom Judge , "freebsd-net@freebsd.org" Subject: Re: bce(4) un hiding adapter info X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 21:07:49 -0000 On Thu, Sep 23, 2010 at 01:48:13PM -0700, David Christensen wrote: > > > What I'd really like to do is revamp the debug code so that it > > > can be enabled/disabled on the fly rather than requiring that > > > the driver be compiled. Adding some performance stuff would > > > > Couldn't it be implemented with sysctl? Users may set a variable > > something like dev.bce.0.diag_bitmap to activate debugging code. > > But it seems that requires a lot of code changes. > > I already have an extensive amount of conditionally compiled > debug code in the driver which uses a bitmap to adjust the > debug spew. For personal testing I've also added a sysctl > to allow that value to be modified at runtime. My concerns > are from a security standpoint (some of the debug code allows > direct register access), a code size perspective (adds a lot Normal users couldn't change a sysctl variable so that information is only available to root(Here I assume the feature is off by default). > of code most people don't use), and the performance penalty I think code size wouldn't be large compared to firmware code. If we switch to use firmware(9) I guess we can reduce the code size a lot. We don't have to carry that image after downloading the firmware. > (lots of bitmap checking even when all debug spew is turned > off). > That's correct. If that checking is not in fast path that wouldn't affect much I guess. > Probably worth the time to pull the most useful stuff into > the production driver and leave the more obscure code in the > debug only build. If there are no complaints I'll add that > to my task list. > > Dave >