From owner-freebsd-mips@FreeBSD.ORG Sat Mar 10 23:08:42 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 3F048106566C for ; Sat, 10 Mar 2012 23:08:42 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id B40B68FC15 for ; Sat, 10 Mar 2012 23:08:41 +0000 (UTC) Received: by wern13 with SMTP id n13so338962wer.13 for ; Sat, 10 Mar 2012 15:08:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=+x/nAw4py4u3iTHNdU6Lrd6PMbp7biQlNNkNfwNn7GI=; b=DeqCXtFMd4F6ZYYFgGMkzp8u508csnk6nnjTN7Wxo87d4afe52+6USuklf1A2ANMgg r89/bRHccI0Sx1kRF7h0MGq6AtPzfBjcHHNjMcjJvmDnCVfcqsRjMUKlfp6FpOAnKf7H WT0fr62N3Wa8SUzZvfZYk7hKwR5IlYnqWyAHZqtmq0PBu+yKgTOy34qPQ20rGITf7pb7 EcJ8FiA3O7H2mSUYUexijn4fLcDf9QTVtKlDkNIx6iMyGhHpaIGXztDR4ToaPeSmmx8E Ghl+VP94tnDdcmokiQCsq0Mh3MY2OcKEzQPwPUIpwhpfBj1lX28dLjJIJ5Q/bssQJrT9 1hXQ== Received: by 10.216.136.131 with SMTP id w3mr4306073wei.15.1331420920759; Sat, 10 Mar 2012 15:08:40 -0800 (PST) Received: from rnote.ddteam.net (9-52-133-95.pool.ukrtel.net. [95.133.52.9]) by mx.google.com with ESMTPS id j3sm33111742wiw.1.2012.03.10.15.08.39 (version=SSLv3 cipher=OTHER); Sat, 10 Mar 2012 15:08:40 -0800 (PST) Date: Sun, 11 Mar 2012 01:07:55 +0200 From: Aleksandr Rybalko To: Juli Mallett Message-Id: <20120311010755.ca51d8d0.ray@ddteam.net> In-Reply-To: References: <20120310151128.647d4a18.ray@ddteam.net> <20120311002908.58ea1513.ray@ddteam.net> X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.5; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Gm-Message-State: ALoCoQnViOcQKFHIHvGg3qAdVUk3zAlrpIVICa7N/KIjlDw5CtTGuy3fydwlxMEvm6kDaAM5bC1V 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 23:08:42 -0000 On Sat, 10 Mar 2012 14:54:39 -0800 Juli Mallett wrote: > 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.  I > >>> would 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.  It > > looks like this relates to moving the ring initialization out to > > attach-time — why not just make the stop function do the right > > thing and free allocated resources, instead of doing the latter in > > detach?  Is 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?  It 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) != 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 = 0; > > - /* Init tx descriptors. */ > - arge_tx_ring_init(sc); > + sc->arge_cdata.arge_tx_prod = 0; > + sc->arge_cdata.arge_tx_cons = 0; > + sc->arge_cdata.arge_tx_cnt = 0; > > arge_reset_dma(sc); > > - > if (sc->arge_miibus) { > mii = device_get_softc(sc->arge_miibus); > mii_mediachg(mii); Cool! I still not look into that so deeper :) Thank you Juli! Will test it with other zrouter guys, and then commit if you don't do that faster :) WBW -- Aleksandr Rybalko