Date: Thu, 4 Nov 2010 21:31:30 -0400 (EDT) From: Rick Macklem <rmacklem@uoguelph.ca> To: pyunyh@gmail.com Cc: freebsd-current@freebsd.org Subject: Re: re(4) driver dropping packets when reading NFS files Message-ID: <430617549.130565.1288920690389.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20101104003906.GC14740@michelle.cdnetworks.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
>
> If the counter was not wrapped, it seem you lost more than 10% out of
> total RX frames. This is a lot loss and there should be a way to
> mitigate it.
>
I've attached a patch (to the if_re.c in head, not your patched variant)
that works a lot better (about 5Mbytes/sec read rate). To get that, I
had to disable msi and not clear the RL_IMR register in re_intr(). I
suspect that a packet would be received between when the bits in RL_IMR
were cleared and when they were set at the end of re_int_task() and those
were getting lost.
This patch doesn't completely fix the problem. (I added your stats collecting
stuff to the if_re.c in head and attached the result, which still shows some lost packets. One
thought is clearing the bits in RL_ISR in re_intr() instead of re_int_task(),
but then I can't see a good way to pass the old value of the status reg.
through to re_int_task()?
The patch doesn't help when msi is enabled and when I played with your
patched variant, I got it to hang when RL_IMR wasn't cleared.
I've attached the patch and stats.
I might play around with it some more tomorrow, rick
ps: If you have hardware to test re with, you want to do an NFS mount
and then read a large file when nothing else is happening on the
machine, to see if you can reproduce the problem.
pss: All tests done with a kernel that does not have option DEVICE_POLLING.
[-- Attachment #2 --]
--- if_re.c.orig 2010-11-03 18:49:29.000000000 -0400
+++ if_re.c 2010-11-04 21:04:34.000000000 -0400
@@ -156,7 +156,7 @@
#include "miibus_if.h"
/* Tunables. */
-static int msi_disable = 0;
+static int msi_disable = 1;
TUNABLE_INT("hw.re.msi_disable", &msi_disable);
static int prefer_iomap = 0;
TUNABLE_INT("hw.re.prefer_iomap", &prefer_iomap);
@@ -2179,7 +2179,6 @@
status = CSR_READ_2(sc, RL_ISR);
if (status == 0xFFFF || (status & RL_INTRS_CPLUS) == 0)
return (FILTER_STRAY);
- CSR_WRITE_2(sc, RL_IMR, 0);
taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_inttask);
[-- Attachment #3 --]
re0 statistics:
Transmit good frames : 83320
Receive good frames : 136158
Tx errors : 0
Rx errors : 0
Rx missed frames : 2666
Rx frame alignment errs : 0
Tx single collisions : 0
Tx multiple collisions : 0
Rx unicast frames : 136157
Rx broadcast frames : 0
Rx multicast frames : 1
Tx aborts : 0
Tx underruns : 0
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?430617549.130565.1288920690389.JavaMail.root>
