From owner-freebsd-current@FreeBSD.ORG Sat Nov 6 02:40:56 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 710EA1065791 for ; Sat, 6 Nov 2010 02:40:56 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 20F5E8FC16 for ; Sat, 6 Nov 2010 02:40:55 +0000 (UTC) Received: by gya6 with SMTP id 6so2649053gya.13 for ; Fri, 05 Nov 2010 19:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=uTGlzXpfU4hfkncLVHLvvJX3Y6SDaKEbCxtcY11TH2c=; b=rL6x6EnrnpC2oSoT0mk1fr18VTjJFr/1kkL1A8WupPY/8MiYGbKeSzOu7Vdv7Cpj4m tZ6kFgWzhCjbxjp5bmXIyLNRrp9C0TXKmiexdZVCVh2S4XHMz2Y9BRXT6pTXlxwR3/l5 w2h9nEa6unfOhQaGO86NG6y3+fN2+flFngImc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=fsgXGl/DrmG+U/g0ZVXOiPx/NE3owspiZAzsqfYd59BIreew9NnZNP/iXHaYrzpET7 pVy7ttcmcKW+XEaQoWUodCrJlVi8yNXstwbXWoPgX34SB8x9eTRkCrL+B/3eRL0Ii+Pt ufjynAq0ZwpdNsC0/gUmjCrBxnGsKhFv2Lf0M= Received: by 10.151.48.12 with SMTP id a12mr4623277ybk.224.1289011255016; Fri, 05 Nov 2010 19:40:55 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id z16sm1513786ybm.4.2010.11.05.19.40.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 05 Nov 2010 19:40:53 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 5 Nov 2010 19:40:47 -0700 From: Pyun YongHyeon Date: Fri, 5 Nov 2010 19:40:47 -0700 To: Rick Macklem Message-ID: <20101106024047.GD22715@michelle.cdnetworks.com> References: <20101105023153.GA20301@michelle.cdnetworks.com> <77175273.185228.1289000696906.JavaMail.root@erie.cs.uoguelph.ca> <20101106023345.GC22715@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="rS8CxjVDS/+yyDmU" Content-Disposition: inline In-Reply-To: <20101106023345.GC22715@michelle.cdnetworks.com> User-Agent: Mutt/1.4.2.3i Cc: freebsd-current@freebsd.org Subject: Re: re(4) driver dropping packets when reading NFS files 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: Sat, 06 Nov 2010 02:40:56 -0000 --rS8CxjVDS/+yyDmU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Nov 05, 2010 at 07:33:45PM -0700, Pyun YongHyeon wrote: [...] > > If this theory is correct, the attached patch may mitigate the > issue. > Oops, I incorrectly used old code. Please use this one. --rS8CxjVDS/+yyDmU Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="re.intr.patch4" Index: sys/pci/if_rlreg.h =================================================================== --- sys/pci/if_rlreg.h (revision 214844) +++ sys/pci/if_rlreg.h (working copy) @@ -873,9 +873,7 @@ int rl_twist_row; int rl_twist_col; int suspended; /* 0 = normal 1 = suspended */ -#ifdef DEVICE_POLLING int rxcycles; -#endif struct task rl_txtask; struct task rl_inttask; Index: sys/dev/re/if_re.c =================================================================== --- sys/dev/re/if_re.c (revision 214844) +++ sys/dev/re/if_re.c (working copy) @@ -1860,7 +1860,7 @@ int i, total_len; struct rl_desc *cur_rx; u_int32_t rxstat, rxvlan; - int maxpkt = 16, rx_npkts = 0; + int rx_npkts = 0; RL_LOCK_ASSERT(sc); @@ -1872,7 +1872,7 @@ sc->rl_ldata.rl_rx_list_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - for (i = sc->rl_ldata.rl_rx_prodidx; maxpkt > 0; + for (i = sc->rl_ldata.rl_rx_prodidx; sc->rxcycles > 0; i = RL_RX_DESC_NXT(sc, i)) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; @@ -2036,7 +2036,7 @@ } } } - maxpkt--; + sc->rxcycles--; if (rxvlan & RL_RDESC_VLANCTL_TAG) { m->m_pkthdr.ether_vtag = bswap16((rxvlan & RL_RDESC_VLANCTL_DATA)); @@ -2058,10 +2058,10 @@ if (rx_npktsp != NULL) *rx_npktsp = rx_npkts; - if (maxpkt) - return (EAGAIN); + if (sc->rxcycles) + return (0); - return (0); + return (EAGAIN); } static void @@ -2258,8 +2258,11 @@ } #endif - if (status & (RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_FIFO_OFLOW)) + if (status & (RL_ISR_RX_OK | RL_ISR_RX_ERR | RL_ISR_FIFO_OFLOW | + RL_ISR_RX_OVERRUN)) { + sc->rxcycles = sc->rl_ldata.rl_rx_desc_cnt / 2; rval = re_rxeof(sc, NULL); + } /* * Some chips will ignore a second TX request issued --rS8CxjVDS/+yyDmU--