> 
> 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.
--- 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);
 
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
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to