From owner-cvs-all@FreeBSD.ORG Sun Apr 4 18:12:52 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D54616A4CE; Sun, 4 Apr 2004 18:12:52 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9012243D45; Sun, 4 Apr 2004 18:12:51 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.10/8.12.9) with ESMTP id i34LRWkj083403; Sun, 4 Apr 2004 15:30:02 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 04 Apr 2004 15:27:59 -0600 (MDT) Message-Id: <20040404.152759.13025361.imp@bsdimp.com> To: bde@zeta.org.au From: "M. Warner Losh" In-Reply-To: <20040404134458.C2452@gamplex.bde.org> References: <20040401135011.GB378@ip.net.ua> <20040403200844.GA18516@regency.nsu.ru> <20040404134458.C2452@gamplex.bde.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: danfe@nsu.ru cc: src-committers@FreeBSD.org cc: cvs-src@FreeBSD.org cc: cvs-all@FreeBSD.org cc: ru@FreeBSD.org cc: nate@root.org Subject: Re: cvs commit: src/sys/pci if_ste.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2004 01:12:52 -0000 In message: <20040404134458.C2452@gamplex.bde.org> Bruce Evans writes: : Using sysctl in device drivers is bad practice, but fixing this is : nontrivial. I'm curious, what makes it bad practice? Is there a layering violation? Is there something else? I ask because I think that there's support for having both a hw.* heirarchy to control the global aspects of drivers (which is wide spread) and dev.* to reflect the dev tree to userland (DES' set of patches, or similar, have been warmly received on arch@), as well as provide per-interface tunables and statistics. : 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. This is true. : - accesses to the global counter are not locked. SE_LOCK() is : per-interface. This is also true. Warner