Date: Fri, 5 Nov 2010 19:40:47 -0700 From: Pyun YongHyeon <pyunyh@gmail.com> To: Rick Macklem <rmacklem@uoguelph.ca> Cc: freebsd-current@freebsd.org Subject: Re: re(4) driver dropping packets when reading NFS files Message-ID: <20101106024047.GD22715@michelle.cdnetworks.com> In-Reply-To: <20101106023345.GC22715@michelle.cdnetworks.com> References: <20101105023153.GA20301@michelle.cdnetworks.com> <77175273.185228.1289000696906.JavaMail.root@erie.cs.uoguelph.ca> <20101106023345.GC22715@michelle.cdnetworks.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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.
[-- Attachment #2 --]
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101106024047.GD22715>
