From owner-freebsd-mips@FreeBSD.ORG Sat Mar 10 22:55:15 2012 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00BEB106566B for ; Sat, 10 Mar 2012 22:55:00 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 475A98FC08 for ; Sat, 10 Mar 2012 22:54:59 +0000 (UTC) Received: by wern13 with SMTP id n13so332621wer.13 for ; Sat, 10 Mar 2012 14:54:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=33q2DDqK+HVYNgi1AVS20MU2zGG33XZ/hnXRhpV5eZA=; b=EDdUo8kbOo8GklBrxffsIJGR3meoYS9wzvAyc37LTvAattOi5CtcWhWYxpdquXRnNn yUHwtwY1ikSC2AsTmu/RPdlKKw9IzU/U8Q48r7Ql3SLMqUyq1FSsgJhPQ7GE6SyJOHCF bDwRfx2z5rLcOAv6mAcjIS88Je0yLIh0c2KRWAN0dWbe07p2syIdjko/Pa/wVLGhFnhI TcWSvavXxhXqpNlg21+hsRogKJerZBxWa0CAiz7Jtf26c3oAkMIVR7iX83CzlNPolqNb xQq8AjTOwc//JVylF9W+pofEJJC47CCXBdt0/Hcl+FXLLsu0WT3OpVgWd9eS5U63egRJ nAbg== Received: by 10.180.95.197 with SMTP id dm5mr15433590wib.20.1331420099218; Sat, 10 Mar 2012 14:54:59 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.180.96.231 with HTTP; Sat, 10 Mar 2012 14:54:39 -0800 (PST) In-Reply-To: References: <20120310151128.647d4a18.ray@ddteam.net> <20120311002908.58ea1513.ray@ddteam.net> From: Juli Mallett Date: Sat, 10 Mar 2012 14:54:39 -0800 X-Google-Sender-Auth: MvWIN43S2gSKR9Lvdmui3GNnLHM Message-ID: To: Aleksandr Rybalko Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlzU1ll2dgfMOXDLxxK7PPX5cNAh2YydtxEbbmTqR3Vv0mIPgLRXC1CIpEzaU29a3jMcs7+ Cc: freebsd-mips@freebsd.org Subject: Re: [PATCH] Fix for using NFS root with if_arge X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 22:55:15 -0000 On Sat, Mar 10, 2012 at 14:50, Juli Mallett wrote: > On Sat, Mar 10, 2012 at 14:29, Aleksandr Rybalko wrote: >> On Sat, 10 Mar 2012 14:24:09 -0800 >> Juli Mallett wrote: >>> This patch seems to cause interrupt storms on rb450g's arge1 >>> interface, at least if that interface is wired to the switch. =C2=A0I w= ould >>> guess it has to do with the MAC clock? >> >> Yeah, but not really this patch. This patch just workaround one problem >> which is unhide second. I'm still not sure what is real problem >> source, but think it is because clock for MAC output, or not run, or >> run on incorrect frequency. > > I guess I really don't understand the nature of the problem. =C2=A0It loo= ks > like this relates to moving the ring initialization out to attach-time > =E2=80=94 why not just make the stop function do the right thing and free > allocated resources, instead of doing the latter in detach? =C2=A0Is it > simply the lack of resetting the tx_prod, tx_cons, tx_cnt and rx_cons > fields in the init function if you move the ring initialization to > attach? =C2=A0It looks to me like that could be the problem. Indeed, that's the issue. If I modify your patch to instead be like below, no more interrupt storm: @@ -849,20 +860,17 @@ arge_stop(sc); - /* Init circular RX list. */ - if (arge_rx_ring_init(sc) !=3D 0) { - device_printf(sc->arge_dev, - "initialization failed: no memory for rx buffers\n"); - arge_stop(sc); - return; - } + /* + * Reset ring consumer and producer values, etc. + */ + sc->arge_cdata.arge_rx_cons =3D 0; - /* Init tx descriptors. */ - arge_tx_ring_init(sc); + sc->arge_cdata.arge_tx_prod =3D 0; + sc->arge_cdata.arge_tx_cons =3D 0; + sc->arge_cdata.arge_tx_cnt =3D 0; arge_reset_dma(sc); - if (sc->arge_miibus) { mii =3D device_get_softc(sc->arge_miibus); mii_mediachg(mii);