From owner-svn-src-head@FreeBSD.ORG Fri Jun 7 01:01:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 11D3D319; Fri, 7 Jun 2013 01:01:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 040261F4A; Fri, 7 Jun 2013 01:01:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5711das077231; Fri, 7 Jun 2013 01:01:39 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5711dWn077230; Fri, 7 Jun 2013 01:01:39 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201306070101.r5711dWn077230@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 7 Jun 2013 01:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251481 - head/sys/dev/bge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2013 01:01:40 -0000 Author: yongari Date: Fri Jun 7 01:01:39 2013 New Revision: 251481 URL: http://svnweb.freebsd.org/changeset/base/251481 Log: Do not report current link status if driver is not running. Reporting link status in driver has a side-effect that makes mii(4) check current link status. mii(4) will call link status change callback when it sees link state change. Normally this wouldn't have problems. However, ASF/IPMI firmware can actively access PHY regardless of driver's running state such that reporting link status for not-running interface can generate meaningless link UP/DOWN messages. This change also makes dhclient think driver got a valid link regardless of link establishment so it will bypass dhclient's initial link status check. I think that wouldn't be issue though. Tested by: Daniel Braniss Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Fri Jun 7 00:48:01 2013 (r251480) +++ head/sys/dev/bge/if_bge.c Fri Jun 7 01:01:39 2013 (r251481) @@ -5583,6 +5583,10 @@ bge_ifmedia_sts(struct ifnet *ifp, struc BGE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + BGE_UNLOCK(sc); + return; + } if (sc->bge_flags & BGE_FLAG_TBI) { ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER;