From owner-freebsd-net@FreeBSD.ORG Mon Oct 10 17:49:39 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A645A106564A; Mon, 10 Oct 2011 17:49:39 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id D539F8FC0C; Mon, 10 Oct 2011 17:49:38 +0000 (UTC) Received: by wyj26 with SMTP id 26so9562213wyj.13 for ; Mon, 10 Oct 2011 10:49:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=341ZnWmy8nKjRvLqrJiaJuaTucBqf0XkjO+fh/SCsag=; b=dor6mmRK2ffqA5+71db6OfjcXwr5lY47Pm6B9gHmzAXkUB0VyvLrB18WGW+rYfBxEW 4VNWN1AFxfKr5bo/16+UUEy4cBlA+fY88VQm6j5FVTuDd/Ys5uqIt/lw6bIv0tqzwPB9 28dcRm/5Jmpk/OJbTbtRQ0nckK8HvCukKDItE= Received: by 10.227.37.214 with SMTP id y22mr6727271wbd.76.1318268977633; Mon, 10 Oct 2011 10:49:37 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id e7sm1374247wbh.12.2011.10.10.10.49.33 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Oct 2011 10:49:35 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 10 Oct 2011 10:47:49 -0700 From: YongHyeon PYUN Date: Mon, 10 Oct 2011 10:47:49 -0700 To: Sean Bruno Message-ID: <20111010174749.GA1781@michelle.cdnetworks.com> References: <1317315666.2777.8.camel@hitfishpass-lx.corp.yahoo.com> <1317323418.2777.14.camel@hitfishpass-lx.corp.yahoo.com> <1317343996.2777.33.camel@hitfishpass-lx.corp.yahoo.com> <1317346748.2777.36.camel@hitfishpass-lx.corp.yahoo.com> <5D267A3F22FD854F8F48B3D2B523819385F35B4738@IRVEXCHCCR01.corp.ad.broadcom.com> <1317683178.15510.25.camel@hitfishpass-lx.corp.yahoo.com> <20111007191154.GB11808@michelle.cdnetworks.com> <1318018310.27029.10.camel@hitfishpass-lx.corp.yahoo.com> <20111007205254.GC11808@michelle.cdnetworks.com> <1318264942.1236.6.camel@hitfishpass-lx.corp.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="YiEDa0DAkWCtVeE4" Content-Disposition: inline In-Reply-To: <1318264942.1236.6.camel@hitfishpass-lx.corp.yahoo.com> User-Agent: Mutt/1.4.2.3i Cc: "freebsd-net@freebsd.org" , David Christensen , "davidch@freebsd.org" , Pyun YongHyeon Subject: Re: bce(4) with IPMI X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2011 17:49:39 -0000 --YiEDa0DAkWCtVeE4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Oct 10, 2011 at 09:42:22AM -0700, Sean Bruno wrote: > On Fri, 2011-10-07 at 13:52 -0700, YongHyeon PYUN wrote: > > > > Could you try attached patch? > > Yeah, this does work on the r410 ... however, I can't test the > "negative" case here where the bce(4) driver runs across a chipset where > sc->bce_flags & BCE_MFW_ENABLE_FLAG == 0 > > I tried disabling the Dell IPMI controller, but the h/w is still there > doing "things". So, this may not be the flag you want to use. > Hmm, then could you try attached patch again? > Sean > --YiEDa0DAkWCtVeE4 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="bce.mfm.diff2" Index: sys/dev/bce/if_bce.c =================================================================== --- sys/dev/bce/if_bce.c (revision 226123) +++ sys/dev/bce/if_bce.c (working copy) @@ -761,7 +761,7 @@ bce_print_adapter_info(struct bce_softc *sc) printf("2.5G"); i++; } - if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) { + if (sc->bce_flags & BCE_MFW_PRESENT_FLAG) { if (i > 0) printf("|"); printf("MFW); MFW (%s)\n", sc->bce_mfw_ver); } else { @@ -1221,7 +1221,7 @@ bce_attach(device_t dev) /* Check if any management firwmare is enabled. */ val = bce_shmem_rd(sc, BCE_PORT_FEATURE); if (val & BCE_PORT_FEATURE_ASF_ENABLED) { - sc->bce_flags |= BCE_MFW_ENABLE_FLAG; + sc->bce_flags |= BCE_MFW_PRESENT_FLAG; /* Allow time for firmware to enter the running state. */ for (int i = 0; i < 30; i++) { @@ -1246,6 +1246,7 @@ bce_attach(device_t dev) memcpy(&sc->bce_mfw_ver[i], &val, 4); i += 4; } + sc->bce_flags |= BCE_MFW_ENABLE_FLAG; } else { /* May cause firmware synchronization timeouts. */ BCE_PRINTF("%s(%d): Management firmware enabled " @@ -6158,7 +6159,8 @@ bce_ifmedia_sts(struct ifnet *ifp, struct ifmediar BCE_LOCK(sc); - if ((ifp->if_flags & IFF_UP) == 0) { + if ((ifp->if_flags & IFF_UP) == 0 && + (sc->bce_flags & BCE_MFW_PRESENT_FLAG) == 0) { BCE_UNLOCK(sc); return; } Index: sys/dev/bce/if_bcereg.h =================================================================== --- sys/dev/bce/if_bcereg.h (revision 226123) +++ sys/dev/bce/if_bcereg.h (working copy) @@ -6431,11 +6431,12 @@ struct bce_softc #define BCE_NO_WOL_FLAG 0x00000008 #define BCE_USING_DAC_FLAG 0x00000010 #define BCE_USING_MSI_FLAG 0x00000020 -#define BCE_MFW_ENABLE_FLAG 0x00000040 -#define BCE_ONE_SHOT_MSI_FLAG 0x00000080 -#define BCE_USING_MSIX_FLAG 0x00000100 -#define BCE_PCIE_FLAG 0x00000200 -#define BCE_USING_TX_FLOW_CONTROL 0x00000400 +#define BCE_MFW_PRESENT_FLAG 0x00000040 +#define BCE_MFW_ENABLE_FLAG 0x00000080 +#define BCE_ONE_SHOT_MSI_FLAG 0x00000100 +#define BCE_USING_MSIX_FLAG 0x00000200 +#define BCE_PCIE_FLAG 0x00000400 +#define BCE_USING_TX_FLOW_CONTROL 0x00000800 /* Controller capability flags. */ u32 bce_cap_flags; --YiEDa0DAkWCtVeE4--