Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Mar 2012 14:54:39 -0800
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Aleksandr Rybalko <ray@ddteam.net>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: [PATCH] Fix for using NFS root with if_arge
Message-ID:  <CACVs6=-tkvt4y=7L5-w%2By7x8yFbemB87cC3d5F6K7Fao3WnzCA@mail.gmail.com>
In-Reply-To: <CACVs6=9ZcuzZqf_4-DHk5Bp5AQwFaFUm9tWR=O9v50oYjuXtYg@mail.gmail.com>
References:  <CAD44qMVKyL-Fdrp-Tf3o9HXMH_UudCSfEOKnHz3nK%2BaqMwW6Pw@mail.gmail.com> <20120310151128.647d4a18.ray@ddteam.net> <CACVs6=-=EW6-7rqxH3yLKLSGZDrXFqbkbhSVLQ7eaA5vd5J_kg@mail.gmail.com> <20120311002908.58ea1513.ray@ddteam.net> <CACVs6=9ZcuzZqf_4-DHk5Bp5AQwFaFUm9tWR=O9v50oYjuXtYg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Mar 10, 2012 at 14:50, Juli Mallett <jmallett@freebsd.org> wrote:
> On Sat, Mar 10, 2012 at 14:29, Aleksandr Rybalko <ray@ddteam.net> wrote:
>> On Sat, 10 Mar 2012 14:24:09 -0800
>> Juli Mallett <jmallett@FreeBSD.org> 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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACVs6=-tkvt4y=7L5-w%2By7x8yFbemB87cC3d5F6K7Fao3WnzCA>