From owner-freebsd-current@FreeBSD.ORG Fri Dec 26 01:56:32 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DF201065670 for ; Fri, 26 Dec 2008 01:56:32 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.235]) by mx1.freebsd.org (Postfix) with ESMTP id C47658FC12 for ; Fri, 26 Dec 2008 01:56:31 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so4855612rvf.43 for ; Thu, 25 Dec 2008 17:56:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; 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; bh=NnAyYlYgjSlUO13JN2FC/RwbrhOlfx6/c1vdQQKz/PM=; b=t8vIcr6H4ZRojMF9zWLAokop3X62AdhG8Ie581IY8sR8379epKrqfynoREovub44VU rhdcbITqP2maAHtlfyTDAVvptyflxEOZ1Fzm67bIYmC9hBijWeNCgfE0hJFn/GZyP8Lx 0+3KCXsKJO8S5Uj+EA7zApHdFp9A9/tmcPOfA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=YTdRmqqioLlOOHL7DqOs0I5FrxVNfmEp1mT4oM3yaMc+NFkJxul0iImBkc4VHDveuq 17LNf5EB9iUO1YjB/YnzxZXBZzdsmprlbkJSf4J2kUWzXjNORZQZ13qycFlj8hkclg2V pzKp4KVt0CiaSF/L9P2rvuVMrXdflbC/Uwpx8= Received: by 10.141.62.7 with SMTP id p7mr5041121rvk.113.1230256591565; Thu, 25 Dec 2008 17:56:31 -0800 (PST) Received: from michelle.cdnetworks.co.kr ([211.53.35.84]) by mx.google.com with ESMTPS id f21sm25247653rvb.7.2008.12.25.17.56.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 25 Dec 2008 17:56:30 -0800 (PST) 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 mBQ1uO1C003088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 26 Dec 2008 10:56:24 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id mBQ1uMV2003087; Fri, 26 Dec 2008 10:56:22 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Fri, 26 Dec 2008 10:56:22 +0900 From: Pyun YongHyeon To: Ian FREISLICH Message-ID: <20081226015622.GA2700@cdnetworks.co.kr> References: <20081224085143.GH95088@cdnetworks.co.kr> <11167f520812232229g5ee1d475kdd92fd6511c50c29@mail.gmail.com> <20081224021016.GF95088@cdnetworks.co.kr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="gBBFr7Ir9EOA20Yy" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: current@freebsd.org Subject: Re: msk(4) stops working. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Dec 2008 01:56:32 -0000 --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Dec 24, 2008 at 12:43:56PM +0200, Ian FREISLICH wrote: > Pyun YongHyeon wrote: > > > > On Wed, Dec 24, 2008 at 08:54:26AM +0200, Ian FREISLICH wrote: > > > "Sam Fourman Jr." wrote: > > > > >> About 2-3 months ago I committed workaround for Yukon silicon bug. > > > > >> Do you use latest CURRENT? > > > > > > > > > > Yes, this is on yesterday's sources. It was better for a month or > > > > > so, but over the last month it's been really bad. Now I can provoke > > > > > this condition in under 1 minute of uptime. > > > > > > > > > I have a few msk cards, and I could stand to install -CURRENT on a syste > m > > > > how do I reproduce your problem? > > > > > > I induce it by scp-ing a large (several GB) file from one host to > > > another. I only have one interface msk interface in my laptop, but > > > it's an SMP system. Maybe that has something to do with it. > > > > > > > Would you show me the output of "sysctl dev.msk.0.stats" before and > > after the watchdog timeouts after appling attached patch? > > Before: > dev.msk.0.stats.rx.ucast_frames: 0 > dev.msk.0.stats.rx.bcast_frames: 4 > dev.msk.0.stats.rx.pause_frames: 0 > dev.msk.0.stats.rx.mcast_frames: 0 [...] > dev.msk.0.stats.tx.single_colls: 0 > dev.msk.0.stats.tx.underflows: 0 > Thanks for testing and I don't see unusual things from the output. I still can't reproduce this but would you try attached patch? Also show me dmesg output to see controller revision. > > BTW, did you intentionally disable MSI? > > No, MSI is enabled. > Ok. -- Regards, Pyun YongHyeon --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="msk.watchdog.diff" Index: sys/dev/msk/if_msk.c =================================================================== --- sys/dev/msk/if_msk.c (revision 186497) +++ sys/dev/msk/if_msk.c (working copy) @@ -1355,27 +1355,25 @@ CSR_WRITE_4(sc, STAT_LIST_ADDR_HI, MSK_ADDR_HI(addr)); /* Set the status list last index. */ CSR_WRITE_2(sc, STAT_LAST_IDX, MSK_STAT_RING_CNT - 1); - if (sc->msk_hw_id == CHIP_ID_YUKON_EC && - sc->msk_hw_rev == CHIP_REV_YU_EC_A1) { - /* WA for dev. #4.3 */ - CSR_WRITE_2(sc, STAT_TX_IDX_TH, ST_TXTH_IDX_MASK); - /* WA for dev. #4.18 */ - CSR_WRITE_1(sc, STAT_FIFO_WM, 0x21); - CSR_WRITE_1(sc, STAT_FIFO_ISR_WM, 0x07); - } else { - CSR_WRITE_2(sc, STAT_TX_IDX_TH, 0x0a); - CSR_WRITE_1(sc, STAT_FIFO_WM, 0x10); - if (sc->msk_hw_id == CHIP_ID_YUKON_XL && - sc->msk_hw_rev == CHIP_REV_YU_XL_A0) - CSR_WRITE_1(sc, STAT_FIFO_ISR_WM, 0x04); - else - CSR_WRITE_1(sc, STAT_FIFO_ISR_WM, 0x10); - CSR_WRITE_4(sc, STAT_ISR_TIMER_INI, 0x0190); - } /* - * Use default value for STAT_ISR_TIMER_INI, STAT_LEV_TIMER_INI. + * Interrupt moderation and coalescing frames should be + * controllable with sysctl variables or loader tunables + * but the relationship between status updates and + * interrupt moderation are not clear. Some hardware + * revisions seem to very sensitive to these parameters + * and could be resulted in poor performance as well as + * non-working situation if improper values were chosen. */ + CSR_WRITE_2(sc, STAT_TX_IDX_TH, 0x0a); + CSR_WRITE_1(sc, STAT_FIFO_WM, 0x10); + if (sc->msk_hw_id == CHIP_ID_YUKON_XL && + sc->msk_hw_rev == CHIP_REV_YU_XL_A0) + CSR_WRITE_1(sc, STAT_FIFO_ISR_WM, 0x04); + else + CSR_WRITE_1(sc, STAT_FIFO_ISR_WM, 0x10); CSR_WRITE_4(sc, STAT_TX_TIMER_INI, MSK_USECS(sc, 1000)); + CSR_WRITE_4(sc, STAT_ISR_TIMER_INI, MSK_USECS(sc, 30)); + CSR_WRITE_4(sc, STAT_LEV_TIMER_INI, MSK_USECS(sc, 50)); /* Enable status unit. */ CSR_WRITE_4(sc, STAT_CTRL, SC_STAT_OP_ON); @@ -3586,6 +3584,10 @@ domore = msk_handle_events(sc); if ((status & Y2_IS_STAT_BMU) != 0) CSR_WRITE_4(sc, STAT_CTRL, SC_STAT_CLR_IRQ); + if (CSR_READ_1(sc, STAT_TX_TIMER_CTRL) == TIM_START) { + CSR_WRITE_1(sc, STAT_TX_TIMER_CTRL, TIM_STOP); + CSR_WRITE_1(sc, STAT_TX_TIMER_CTRL, TIM_START); + } if (ifp0 != NULL && (ifp0->if_drv_flags & IFF_DRV_RUNNING) != 0 && !IFQ_DRV_IS_EMPTY(&ifp0->if_snd)) --gBBFr7Ir9EOA20Yy--