From owner-svn-src-all@FreeBSD.ORG Fri Mar 12 07:15:24 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64E52106564A; Fri, 12 Mar 2010 07:15:24 +0000 (UTC) (envelope-from julian@elischer.org) Received: from out-0.mx.aerioconnect.net (oute.internet-mail-service.net [216.240.47.228]) by mx1.freebsd.org (Postfix) with ESMTP id 3A9678FC27; Fri, 12 Mar 2010 07:15:24 +0000 (UTC) Received: from idiom.com (postfix@mx0.idiom.com [216.240.32.160]) by out-0.mx.aerioconnect.net (8.13.8/8.13.8) with ESMTP id o2C7FN0r006180; Thu, 11 Mar 2010 23:15:23 -0800 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id 868582D6017; Thu, 11 Mar 2010 23:15:22 -0800 (PST) Message-ID: <4B99EA09.80108@elischer.org> Date: Thu, 11 Mar 2010 23:15:21 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Juli Mallett References: <201003111756.o2BHukJu042449@svn.freebsd.org> <9ace436c1003111530s3bd0de9cq451671909fb6aa64@mail.gmail.com> <9ace436c1003111539t2af8439cn315c695d4b90e28d@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 216.240.47.51 Cc: svn-src-head@FreeBSD.org, Qing Li , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Robert Watson Subject: Re: svn commit: r205024 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Mar 2010 07:15:24 -0000 Juli Mallett wrote: > On Thu, Mar 11, 2010 at 15:39, Qing Li wrote: >> I guess it's a good time to clean things up. The if_link_state code has been >> around for quite some time, either it be fully utilized or not be there at all. >> The inconsistency is the root cause. > > Sure. There is an increasing amount of stuff that network drivers are > expected to do, but they work without doing them. It's easy to think > you have a functioning network driver and that you can get by without > adding support for media changes and link status reporting, etc. > >> I will try going through these tonight and hopefully the fix all take a >> common approach. probably should add a flag that means "we have media state" and if it is not set, assume it is always on. > > If you can think of a way to add some invariants (warn the first time > a driver receives a packet without having ever set the link state, > make sure the media status callback sets the valid flag in the > request, etc) that would probably be very helpful for people who are > writing network drivers. If I hadn't been following the threads about > your changes, I would have had to spend much longer fixing the Octeon > port's Ethernet driver, wondering why suddenly it broke and > instrumenting the routing code. A printf would go a long way. > > Juli.