Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Apr 2004 13:51:11 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Alexey Dokuchaev <danfe@nsu.ru>
Cc:        Nate Lawson <nate@root.org>
Subject:   Re: cvs commit: src/sys/pci if_ste.c
Message-ID:  <20040404134458.C2452@gamplex.bde.org>
In-Reply-To: <20040403200844.GA18516@regency.nsu.ru>
References:  <20040331211028.37B5016A4E2@hub.freebsd.org> <20040331134609.N90425@root.org> <20040401105857.GA72284@regency.nsu.ru> <20040403200844.GA18516@regency.nsu.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 4 Apr 2004, Alexey Dokuchaev wrote:

> On Thu, Apr 01, 2004 at 04:50:11PM +0300, Ruslan Ermilov wrote:
> > On Thu, Apr 01, 2004 at 05:58:57PM +0700, Alexey Dokuchaev wrote:
> > > On Thu, Apr 01, 2004 at 09:42:41AM +0300, Ruslan Ermilov wrote:
> > > > On Wed, Mar 31, 2004 at 01:47:16PM -0800, Nate Lawson wrote:
> > [...]
> > > > > This pollutes the toplevel hw sysctl space.  Please move it to
> > > > > hw.ste.rxsyncs or better, debug.*.
> > > > >
> > > > Seems I followed the bad practice from dc(4) and fxp(4).  I will
> > > > move it to hw.ste, thanks.
> > >
> > > Care to fix this "bad practice" in dc(4) and fxp(4) as well? :)  Or
> > > should we wait for their maintainers, or possibly filling the PR ?
> > >
> > Better submit a patch, it should be pretty trivial.  ;)
>
> OK, I'll do it in a couple of days, hopefully for both dc(4) and fxp(4).

Using sysctl in device drivers is bad practice, but fixing this is
nontrivial.

Bugs result from this bad practice even for the new sysctl in if_ste.c:
- the counter is global but the problem is per-interface.  Sysctls
  using globals are easy to hack up, but this don't work so well for
  multiple interfaces.
- accesses to the global counter are not locked.  SE_LOCK() is
  per-interface.

Fortunately, this bad practice is missing in most network drivers.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040404134458.C2452>