From owner-freebsd-net@FreeBSD.ORG Mon Jan 5 15:24:54 2009 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61B021065675 for ; Mon, 5 Jan 2009 15:24:54 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from k7.mavetju.org (ppp121-44-155-248.lns10.syd7.internode.on.net [121.44.155.248]) by mx1.freebsd.org (Postfix) with ESMTP id 0AA9E8FC23 for ; Mon, 5 Jan 2009 15:24:53 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: by k7.mavetju.org (Postfix, from userid 1001) id 621574505A; Mon, 5 Jan 2009 21:43:25 +1100 (EST) Date: Mon, 5 Jan 2009 21:43:25 +1100 From: Edwin Groothuis To: Pyun YongHyeon Message-ID: <20090105104325.GA70686@mavetju.org> References: <20081224021016.GF95088@cdnetworks.co.kr> <20090105095135.GH1842@cdnetworks.co.kr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090105095135.GH1842@cdnetworks.co.kr> User-Agent: Mutt/1.4.2.3i Cc: Garrett Cooper , net@freebsd.org Subject: Re: Annoyance with msk(4) going up and down when initializing interface X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jan 2009 15:24:54 -0000 On Mon, Jan 05, 2009 at 06:51:35PM +0900, Pyun YongHyeon wrote: > On Fri, Jan 02, 2009 at 03:31:33PM -0800, Garrett Cooper wrote: > > Hi Pyun, > > I've noticed an issue for a while now with my chipset (I think that > > this is post an MFC between 7.0 and 7.1, but I could be wrong). > > Basically, each CPU (with the ULE scheduler) grabs the task to check > > for media status, goes out and attempts to get an IP, and if the > > timing of the status modifications is just right, one of the CPU's > > will mark the link up and others will mark it down, and it will stay > > down. > > No, the link state change event is protected by driver lock. > > > Same thing occurs when trying to get a DHCP request -- there will > > typically be multiple requests and ACK's for any given requests. > > This occurs with my onboard NICs on my P5K-e motherboards on 7.1- > > rc[12], and also 8-CURRENT. > > If you're referring to multiple link UP/DOWN messages when > dhclient(8) trying to get an IP address via DHCP it's normal for > drivers that rely on mii(4) state change event. Technically it's > not normal but it's the way how it was implemented on most drivers. > Ideally drivers should not need to reset controllers when it's not > absolutely required to reset hardwares but most drivers blindly > reset hardware which in turn results in link renegotiation. You can > see similiar behavour when alias addresseses are added to the > interface. Because controllers that have complex firmware/embedded > OS will take time to complete the reset operation, the reset > operation would be pain to these controllers. Long time ago I added > a hack to em(4) to mitigate the issue but I don't think it's way to > go. > NetBSD seems to have right fix in ioctl handler. However the > approach will require careful checking of multicasting code of all > drivers. I don't have all hardwares to test this and I don't know > hardware internals of all drivers. When booting diskless via PXE I sometimes run into this problem too: machine boots via NFS, NIC gets down and up and oh, it doesn't work anymore. Edwin -- Edwin Groothuis Website: http://www.mavetju.org/ edwin@mavetju.org Weblog: http://www.mavetju.org/weblog/