From owner-freebsd-current@FreeBSD.ORG Fri Jan 27 06:52:47 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EEE8A16A420 for ; Fri, 27 Jan 2006 06:52:47 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id B5C5F43D53 for ; Fri, 27 Jan 2006 06:52:47 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.12.11) with ESMTP id k0R6qifn037651; Thu, 26 Jan 2006 22:52:44 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id k0R6qieo037650; Thu, 26 Jan 2006 22:52:44 -0800 (PST) (envelope-from rizzo) Date: Thu, 26 Jan 2006 22:52:44 -0800 From: Luigi Rizzo To: "M. Warner Losh" Message-ID: <20060126225244.B37507@xorpc.icir.org> References: <20060124075437.B67285@xorpc.icir.org> <20060126.210322.56187611.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20060126.210322.56187611.imp@bsdimp.com>; from imp@bsdimp.com on Thu, Jan 26, 2006 at 09:03:22PM -0700 Cc: current@freebsd.org Subject: Re: if_flags usage etc. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2006 06:52:48 -0000 On Thu, Jan 26, 2006 at 09:03:22PM -0700, M. Warner Losh wrote: > In message: <20060124075437.B67285@xorpc.icir.org> > Luigi Rizzo writes: > : - some drivers try to manipulate flags that they should not e.g. > : if_ed > : sets IFF_ALTPHYS (IFF_LINK*, but it is almost a capability here) > > Why is this wrong? if possible, i think each IFF_ flag should be modified only by one entity (the stack or the driver). This way you can split them into different variables and reduce the amount of synchronization required to access them. The link flags are kind-of special in that some drivers use them to request a specific media, others (e.g. ed here, but some others too) to report up whatever they found by probing the link. I guess (though haven't looked in detail) that the "mii" approach has a cleaner way to deal with these issues. cheers luigi