From owner-freebsd-stable@FreeBSD.ORG Wed Jul 18 03:55:33 2007 Return-Path: X-Original-To: stable@freebsd.org 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 C6A0916A401 for ; Wed, 18 Jul 2007 03:55:33 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.228]) by mx1.freebsd.org (Postfix) with ESMTP id 7DB1413C4B4 for ; Wed, 18 Jul 2007 03:55:33 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by nz-out-0506.google.com with SMTP id l8so45475nzf for ; Tue, 17 Jul 2007 20:55:33 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=WeixKTzoCPOrkhw/1hbUKF2kG2sz1QN4uE0LecXc6GeaM74EipnsBIEosgAHSviM7JWQ2tBovyjbUhHve0c51aEx3Hj9HV0LzGHkOZRPDADDxjKt7TslG0kDV68z3tvGpvINR6A41vawEfu9l9MQATKe2lVY6WWkpChLc7RYUgs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=Z5e4YXQpko/dBOyaR2wh0nuDG1uB8ZlllHkBfLT1OL7LWOuTn2gqArLYNIqwvh4e27p/PbMJsdwPl+tR2UnQdv7yukazJhYmzij6T7iwP/clHEXPY+1V/A/BwM9iQQJS9sPOR3hHmayKuFEi1hFMZyqXDtyZzs3XCjwnC6l4gbg= Received: by 10.114.153.18 with SMTP id a18mr1059026wae.1184730932397; Tue, 17 Jul 2007 20:55:32 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.google.com with ESMTPS id n38sm636470wag.2007.07.17.20.55.28 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Jul 2007 20:55:30 -0700 (PDT) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id l6I3tP9i038969 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Jul 2007 12:55:25 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id l6I3tOTt038968; Wed, 18 Jul 2007 12:55:24 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Wed, 18 Jul 2007 12:55:20 +0900 From: Pyun YongHyeon To: "[CPS] AkirA" Message-ID: <20070718035519.GB37935@cdnetworks.co.kr> References: <487D1F4CFF854EC485B96B8A7AC0B31C@nintendo> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="mP3DRpeJDSE+ciuQ" Content-Disposition: inline In-Reply-To: <487D1F4CFF854EC485B96B8A7AC0B31C@nintendo> User-Agent: Mutt/1.4.2.1i Cc: stable@freebsd.org, yongari@freebsd.org Subject: Re: nfe trouble 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: Wed, 18 Jul 2007 03:55:33 -0000 --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jul 17, 2007 at 09:37:56PM +0300, [CPS] AkirA wrote: [...] > after theat > > > nfe0: port 0xb000-0xb007 mem > 0xfe02a000-0xfe02afff,0xfe029000-0xfe0290ff,0xfe028000-0xfe02800f irq 23 at > device 8.0 on pci0 > nfe0: could not allocate DMA'able memory for jumbo pool > device_attach: nfe0 attach returned 12 > nfe1: port 0xac00-0xac07 mem > 0xfe027000-0xfe027fff,0xfe026000-0xfe0260ff,0xfe025000-0xfe02500f irq 20 at > device 9.0 on pci0 > nfe1: could not allocate DMA'able memory for jumbo pool > device_attach: nfe1 attach returned 12 > > > and not start to work network > Try attached one. I'm unure how well it could be applied to stable but you can probably patch manually the source in case of failure. -- Regards, Pyun YongHyeon --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="nfe.jumbo.patch" Index: if_nfe.c =================================================================== RCS file: /home/ncvs/src/sys/dev/nfe/if_nfe.c,v retrieving revision 1.18 diff -u -r1.18 if_nfe.c --- if_nfe.c 12 Jun 2007 02:35:01 -0000 1.18 +++ if_nfe.c 18 Jul 2007 03:51:22 -0000 @@ -108,7 +108,7 @@ static void nfe_init_locked(void *); static void nfe_stop(struct ifnet *); static int nfe_alloc_rx_ring(struct nfe_softc *, struct nfe_rx_ring *); -static int nfe_alloc_jrx_ring(struct nfe_softc *, struct nfe_jrx_ring *); +static void nfe_alloc_jrx_ring(struct nfe_softc *, struct nfe_jrx_ring *); static int nfe_init_rx_ring(struct nfe_softc *, struct nfe_rx_ring *); static int nfe_init_jrx_ring(struct nfe_softc *, struct nfe_jrx_ring *); static void nfe_free_rx_ring(struct nfe_softc *, struct nfe_rx_ring *); @@ -151,8 +151,10 @@ /* Tunables. */ static int msi_disable = 0; static int msix_disable = 0; +static int jumbo_disable = 0; TUNABLE_INT("hw.nfe.msi_disable", &msi_disable); TUNABLE_INT("hw.nfe.msix_disable", &msix_disable); +TUNABLE_INT("hw.nfe.jumbo_disable", &jumbo_disable); static device_method_t nfe_methods[] = { /* Device interface */ @@ -513,8 +515,7 @@ if ((error = nfe_alloc_rx_ring(sc, &sc->rxq)) != 0) goto fail; - if ((error = nfe_alloc_jrx_ring(sc, &sc->jrxq)) != 0) - goto fail; + nfe_alloc_jrx_ring(sc, &sc->jrxq); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -1140,7 +1141,7 @@ } -static int +static void nfe_alloc_jrx_ring(struct nfe_softc *sc, struct nfe_jrx_ring *ring) { struct nfe_dmamap_arg ctx; @@ -1151,7 +1152,12 @@ int i, error, descsize; if ((sc->nfe_flags & NFE_JUMBO_SUP) == 0) - return (0); + return; + if (jumbo_disable != 0) { + device_printf(sc->nfe_dev, "disabling jumbo frame support\n"); + sc->nfe_jumbo_disable = 1; + return; + } if (sc->nfe_flags & NFE_40BIT_ADDR) { desc = ring->jdesc64; @@ -1301,11 +1307,17 @@ jpool_entries); } - return (0); + return; fail: + /* + * Running without jumbo frame support is ok for most cases + * so don't fail on creating dma tag/map for jumbo frame. + */ nfe_free_jrx_ring(sc, ring); - return (error); + device_printf(sc->nfe_dev, "disabling jumbo frame support due to " + " resource shortage\n"); + sc->nfe_jumbo_disable = 1; } @@ -1746,7 +1758,8 @@ if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > NFE_JUMBO_MTU) error = EINVAL; else if (ifp->if_mtu != ifr->ifr_mtu) { - if ((sc->nfe_flags & NFE_JUMBO_SUP) == 0 && + if ((((sc->nfe_flags & NFE_JUMBO_SUP) == 0) || + (sc->nfe_jumbo_disable != 0)) && ifr->ifr_mtu > ETHERMTU) error = EINVAL; else { Index: if_nfevar.h =================================================================== RCS file: /home/ncvs/src/sys/dev/nfe/if_nfevar.h,v retrieving revision 1.4 diff -u -r1.4 if_nfevar.h --- if_nfevar.h 12 Jun 2007 02:16:02 -0000 1.4 +++ if_nfevar.h 18 Jul 2007 03:51:22 -0000 @@ -103,6 +103,7 @@ #define NFE_PWR_MGMT 0x0010 #define NFE_CORRECT_MACADDR 0x0020 #define NFE_TX_FLOW_CTRL 0x0040 + int nfe_jumbo_disable; uint32_t rxtxctl; uint8_t mii_phyaddr; uint8_t eaddr[ETHER_ADDR_LEN]; --mP3DRpeJDSE+ciuQ--