Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jul 2013 06:58:05 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r252452 - stable/9/sys/dev/bge
Message-ID:  <201307010658.r616w5PA006725@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Mon Jul  1 06:58:05 2013
New Revision: 252452
URL: http://svnweb.freebsd.org/changeset/base/252452

Log:
  MFC r251481:
    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.

Modified:
  stable/9/sys/dev/bge/if_bge.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/bge/if_bge.c
==============================================================================
--- stable/9/sys/dev/bge/if_bge.c	Mon Jul  1 06:44:27 2013	(r252451)
+++ stable/9/sys/dev/bge/if_bge.c	Mon Jul  1 06:58:05 2013	(r252452)
@@ -5608,6 +5608,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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307010658.r616w5PA006725>