Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Mar 2012 17:38:39 -0700
From:      YongHyeon PYUN <pyunyh@gmail.com>
To:        Paul Guyot <paulguyot@ieee.org>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: Changes brought to bce(4) disabling ipmi access during boot
Message-ID:  <20120318003838.GC1660@michelle.cdnetworks.com>
In-Reply-To: <F6D0F5AE-D31E-42D7-B641-ADDCC39E4169@ieee.org>
References:  <8D3993D8-074E-45E6-8AF7-DB51369F33BD@ieee.org> <20120315171018.GA3295@michelle.cdnetworks.com> <3D1680C7-39A2-47B9-BD40-A987238886EB@ieee.org> <20120316170650.GA6841@michelle.cdnetworks.com> <F6D0F5AE-D31E-42D7-B641-ADDCC39E4169@ieee.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--ftEhullJWpWg/VHq
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, Mar 16, 2012 at 11:41:51PM +0100, Paul Guyot wrote:
> 
> Le 16 mars 2012 ? 18:06, YongHyeon PYUN a ?crit :
> 
> > On Thu, Mar 15, 2012 at 09:19:27AM +0100, Paul Guyot wrote:
> >> Le 15 mars 2012 ? 18:10, YongHyeon PYUN a ?crit :
> >> 
> >>> On Wed, Mar 14, 2012 at 11:44:37PM +0100, Paul Guyot wrote:
> >>>> Hello,
> >>>> 
> >>>> Changes brought to bce(4) prevents booting a R410 Dell server with GELI-encrypted root ZFS partition requiring a passphrase, something that was possible with 9-RELEASE.
> >>>> 
> >>>> Using a binary search, the bug comes from the following revision:
> >>>> 
> >>>> Updating collection src-all/cvs
> >>>> Edit src/sys/dev/bce/if_bce.c
> >>>> Add delta 1.89.2.4 2012.01.09.19.07.14 yongari
> >>>> Edit src/sys/dev/bce/if_bcereg.h
> >>>> Add delta 1.35.2.3 2012.01.09.19.07.14 yongari
> >>>> Shutting down connection to server
> >>>> 
> >>> 
> >>> Could you try attach patch and let me know whether it recovers IPMI
> >>> functionality?
> >> 
> >> Thank you for your quick patch. Unfortunately, it does not recover IPMI functionality with STABLE@2012.01.09.19.08.00.
> >> 
> > 
> > Hmm, how about this one?
> 
> It did not work either. So I patched the original (RELEASE) driver to print information about the various conditions newly tested by the STABLE driver in bce_miibus_statchg. The result is the following. The box has two bce interfaces, the one connected is bce0. The loader was configured with boot_verbose.
> 
> Before the passphrase is entered:
> 
> bce0: <Broadcom NetXtreme II BCM5716 1000Base-T (C0)> mem 0xda000000-0xdbffffff irq 36 at device 0.0 on pci1
> bce0: attempting to allocate 1 MSI vectors (16 supported)
> bce0: using IRQ 256 for MSI
> miibus0: <MII bus> on bce0
> bce0: bpf attached
> bce0: Ethernet address: 78:2b:cb:18:22:75
> bce0: [1998] ifp != NULL
> bce0: [2000] (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0
> bce0: [2008] mii != NULL
> bce0: [2023] (mii->mii_media_status & IFM_ACTIVE) != IFM_ACTIVE)
> bce0: [2026] (mii->mii_media_status & IFM_AVALID) == IFM_AVALID)
> bce0: [2058] Unknown link speed, enabling default GMII interface.
> bce0: [2082] Disabling RX flow control.
> bce0: [2095] Disabling TX flow control.
> bce0: ASIC (0x57092008); Rev (C0); Bus (PCIe x4, 2.5Gbps); B/C (5.2.3); Bufs (RX:2;TX:2;PG:8); Flags (SPLT|MSI|MFW); MFW (NCSI 2.0.11)
> bce1: <Broadcom NetXtreme II BCM5716 1000Base-T (C0)> mem 0xdc000000-0xddffffff irq 48 at device 0.1 on pci1
> bce1: attempting to allocate 1 MSI vectors (16 supported)
> bce1: using IRQ 257 for MSI
> miibus1: <MII bus> on bce1
> bce1: bpf attached
> bce1: Ethernet address: 78:2b:cb:18:22:76
> bce1: [1998] ifp != NULL
> bce1: [2000] (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0
> bce1: [2008] mii != NULL
> bce1: [2023] (mii->mii_media_status & IFM_ACTIVE) != IFM_ACTIVE)
> bce1: [2026] (mii->mii_media_status & IFM_AVALID) == IFM_AVALID)
> bce1: [2058] Unknown link speed, enabling default GMII interface.
> bce1: [2082] Disabling RX flow control.
> bce1: [2095] Disabling TX flow control.
> bce1: ASIC (0x57092008); Rev (C0); Bus (PCIe x4, 2.5Gbps); B/C (5.2.3); Bufs (RX:2;TX:2;PG:8); Flags (SPLT|MSI|MFW); MFW (NCSI 2.0.11)
> 
> After the passphrase is entered and network is started:
> 
> bce0: [1998] ifp != NULL
> bce0: [2000] (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0
> bce0: [2008] mii != NULL
> bce0: [2023] (mii->mii_media_status & IFM_ACTIVE) != IFM_ACTIVE)
> bce0: [2026] (mii->mii_media_status & IFM_AVALID) == IFM_AVALID)
> bce0: [2058] Unknown link speed, enabling default GMII interface.
> bce0: [2082] Disabling RX flow control.
> bce0: [2095] Disabling TX flow control.
> bce0: [1998] ifp != NULL
> bce0: [2002] (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0
> bce0: [2008] mii != NULL
> bce0: [2018] (mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == (IFM_ACTIVE | IFM_AVALID)
> bce0: [2053] Enabling GMII interface.
> bce0: [2082] Disabling RX flow control.
> bce0: [2095] Disabling TX flow control.
> bce0: link state changed to UP
> bce0: Gigabit link up!
> bce0: Gigabit link up!
> bce0: Gigabit link up!
> 
> From what I understand, both new conditions that may return early are true ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 and later (mii->mii_media_status & IFM_ACTIVE) != IFM_ACTIVE), which yields bce_link_up to be FALSE. Yet I am confused by the role of actually writing to BCE_EMAC_MODE in order to keep the iDRAC link up, and wether the issue would not come from another part of the change.
> 

Because there is no publicly available documentation for ASF/IPMI
link handling it's not clear what steps should be taken whenever
its link state is changed.  Previously bce(4) seems to drive
bce_tick regardless of driver running state.
New patch attached.

> Paul
> 



--ftEhullJWpWg/VHq
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="bce.ipmi.diff3"

Index: sys/dev/bce/if_bce.c
===================================================================
--- sys/dev/bce/if_bce.c	(revision 233076)
+++ sys/dev/bce/if_bce.c	(working copy)
@@ -1462,6 +1462,10 @@
 	 * still running.
 	 */
 	bce_pulse(sc);
+	/* Track ASF/IPMI link state change. */
+	sc->bce_link_tick = TRUE;
+	sc->bce_link_up = FALSE;
+	callout_reset(&sc->bce_tick_callout, hz, bce_tick, sc);
 
 	bce_mgmt_init_locked(sc);
 	BCE_UNLOCK(sc);
@@ -1992,8 +1996,7 @@
 
 	ifp = sc->bce_ifp;
 	mii = device_get_softc(sc->bce_miibus);
-	if (mii == NULL || ifp == NULL ||
-	    (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+	if (mii == NULL || ifp == NULL)
 		return;
 
 	sc->bce_link_up = FALSE;
@@ -2038,9 +2041,6 @@
 		}
 	}
 
-	if (sc->bce_link_up == FALSE)
-		return;
-
 	/* Set half or full duplex based on PHY settings. */
 	if ((mii->mii_media_active & IFM_GMASK) == IFM_HDX) {
 		DBPRINT(sc, BCE_INFO_PHY,
@@ -8193,24 +8193,23 @@
 
 	BCE_LOCK_ASSERT(sc);
 
-	/* Schedule the next tick. */
-	callout_reset(&sc->bce_tick_callout, hz, bce_tick, sc);
+	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+		/* Update the statistics from the hardware statistics block. */
+		bce_stats_update(sc);
 
-	/* Update the statistics from the hardware statistics block. */
-	bce_stats_update(sc);
+		/*
+		 * ToDo: This is a safety measure.  Need to re-evaluate
+		 * high	level processing logic and eliminate this code.
+		 */
+		/* Top off the receive and page chains. */
+		if (bce_hdr_split == TRUE)
+			bce_fill_pg_chain(sc);
+		bce_fill_rx_chain(sc);
 
- 	/*
- 	 * ToDo: This is a safety measure.  Need to re-evaluate
- 	 * high	level processing logic and eliminate this code.
- 	 */
-	/* Top off the receive and page chains. */
-	if (bce_hdr_split == TRUE)
-		bce_fill_pg_chain(sc);
-	bce_fill_rx_chain(sc);
+		/* Check that chip hasn't hung. */
+		bce_watchdog(sc);
+	}
 
-	/* Check that chip hasn't hung. */
-	bce_watchdog(sc);
-
 	/* If link is up already up then we're done. */
 	if (sc->bce_link_tick == FALSE && sc->bce_link_up == TRUE)
 		goto bce_tick_exit;
@@ -8221,15 +8220,18 @@
 
 	sc->bce_link_tick = FALSE;
 	/* Now that link is up, handle any outstanding TX traffic. */
-	if (sc->bce_link_up == TRUE && !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
+	if (sc->bce_link_up == TRUE && ifp->if_drv_flags & IFF_DRV_RUNNING &&
+	    !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
 		DBPRINT(sc, BCE_VERBOSE_MISC,
 		    "%s(): Found pending TX traffic.\n", __FUNCTION__);
 		bce_start_locked(ifp);
 	}
 
 bce_tick_exit:
+	/* Schedule the next tick. */
+	callout_reset(&sc->bce_tick_callout, hz, bce_tick, sc);
+
 	DBEXIT(BCE_EXTREME_MISC);
-	return;
 }
 
 #ifdef BCE_DEBUG

--ftEhullJWpWg/VHq--



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