From owner-freebsd-stable@FreeBSD.ORG Sat Mar 17 08:38:42 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E6CF106564A for ; Sat, 17 Mar 2012 08:38:42 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5AB338FC17 for ; Sat, 17 Mar 2012 08:38:42 +0000 (UTC) Received: by dald2 with SMTP id d2so7730370dal.13 for ; Sat, 17 Mar 2012 01:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=V7hqtgGlVo3uxtjvJ5bQPOOhpDxXEu+CACOp2cSSbPA=; b=eofkgnHu4gXtOKLhHnFrdjGEG1mWT/5Yq6ptaFGI0rZCzT6pVezEKgkoQm11ctBaRA P4jn+d8sBMNtjbApkIBS/NE/MwLXz2y1qVauV/Zpb4zedaIITWekEutGg0FB2zGxwu8C FcHyaX9y41wwdd6jH/ESiq1UYOby+wCjZhPjavA73ncE6CjM8NFFeN8zIXLEpDQZrD84 OOM7+RKT6OmYgLF5a87nfBHej9MuQHdmdSki9QE/WjUcdGRpBk92+OEq3X0ZH3bLa3k8 zuz/C96fiH60pywG8u1huPmDGoCUwwEJzWcsylxmM+cC0EKHRCz/XZei5OpYaAoWXEUL S2Yw== Received: by 10.68.242.201 with SMTP id ws9mr21976930pbc.67.1331973521896; Sat, 17 Mar 2012 01:38:41 -0700 (PDT) Received: from pyunyh@gmail.com ([114.111.62.249]) by mx.google.com with ESMTPS id l4sm6216869pbl.27.2012.03.17.01.38.39 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 17 Mar 2012 01:38:41 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Sat, 17 Mar 2012 17:38:39 -0700 From: YongHyeon PYUN Date: Sat, 17 Mar 2012 17:38:39 -0700 To: Paul Guyot Message-ID: <20120318003838.GC1660@michelle.cdnetworks.com> 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> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ftEhullJWpWg/VHq" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-stable@freebsd.org Subject: Re: Changes brought to bce(4) disabling ipmi access during boot X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 08:38:42 -0000 --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: 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: 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: 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: 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--