From owner-cvs-src@FreeBSD.ORG Wed Jun 2 16:14:02 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 652D216A4CE; Wed, 2 Jun 2004 16:14:02 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5385B43D41; Wed, 2 Jun 2004 16:14:02 -0700 (PDT) (envelope-from mux@freebsd.org) Received: by elvis.mu.org (Postfix, from userid 1920) id 4E20E5C84E; Wed, 2 Jun 2004 16:14:02 -0700 (PDT) Date: Thu, 3 Jun 2004 01:14:02 +0200 From: Maxime Henrion To: Scott Long Message-ID: <20040602231402.GI9228@elvis.mu.org> References: <200406022252.i52MqJFp094240@repoman.freebsd.org> <40BE5CE4.60304@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40BE5CE4.60304@freebsd.org> User-Agent: Mutt/1.4.2.1i cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/dev/fxp if_fxp.c if_fxpvar.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2004 23:14:02 -0000 Scott Long wrote: > Maxime Henrion wrote: > >mux 2004/06/02 15:52:18 PDT > > > > FreeBSD src repository > > > > Modified files: > > sys/dev/fxp if_fxp.c if_fxpvar.h > > Log: > > Use the device sysctl tree instead of rolling our own. Some of the > > sysctls were global (hw.fxp_rnr and hw.fxp_noflow), all of them are > > now per-device. Sample output of "sysctl dev.fxp0" with this patch, > > with the standard %foo nodes removed : > > > > dev.fxp0.int_delay: 1000 > > dev.fxp0.bundle_max: 6 > > dev.fxp0.rnr: 0 > > dev.fxp0.noflow: 0 > > > > Revision Changes Path > > 1.213 +18 -24 src/sys/dev/fxp/if_fxp.c > > 1.31 +2 -2 src/sys/dev/fxp/if_fxpvar.h > > Not having the ability to deal with global settings is a bit > of a pain. I had envisioned that something like this would > be: > > dev.fxp.N.instance_variable > > dev.fxp.global_variable It doesn't matter for the rnr sysctl, which is just a counter of RNR events. It used to be read/write though, but that was bogus because it's never read in the code, and only incremented, so I changed it to be read-only. The noflow sysctl is actually a tunable so most of the time people using it are already forced to use it per-device since AFAIK, tunables are only per-devices. It's however a read/write sysctl because since it's read in fxp_init(), it could be useful to set it to 1 and just run "ifconfig fxp0 down; ifconfig fxp0 up" so that it's used. But once you know you need this, you'll want to set it as a tunable anyway. Now I think you're raising a problem that we're likely to have in a near future when more drivers are converted to use the device sysctl tree, and when those drivers have settings that are likely to be useful globally. I already pondered having devinfo(8) renamed to devctl(8) and handle settings we want to do on devices via the sysctl device tree. Taking the detour through a userland program would allow us to have more elaborated features, like setting something on all devices at once. Anyways, I didn't think about this long enough to be really sure it's a good idea, and I don't have the time to handle such a task right now. I thought that could be of some interest to others. :-) > Anyways, this work still looks very nice =-) Thanks :-) Maxime