tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NetBSD 5.1 TCP performance issue (lots of ACK)



On Fri, Oct 28, 2011 at 06:55:30PM +0100, David Laight wrote:
> On Fri, Oct 28, 2011 at 04:10:36PM +0200, Manuel Bouyer wrote:
> > Here is an updated patch. The key point to avoid the receive errors is
> > to do another BUS_DMASYNC after reading wrx_status, before reading the
> > other values to avoid reading e.g. len before status gets updated.
> > The errors were because of 0-len receive descriptors.
> 
> I'm not entirely clear where the mis-ordering happens. I presume the
> fields a volatile so gcc won't re-order them. Which seems to imply
> that the only problem can be the adapter writing the fields in the
> wrong order (unless the data is cached and spans cache lines).
> In that case the BUS_DMASYNC is also acting as a delay.

AFAIK the CPU is allowed to reorder reads. linux has a rmb() here,
which is an equivalent of our x86_lfence() I guess.
But for platforms where BUS_DMASYNC is not a simple barrier,
2 BUS_DMASYNC calls are needed.


-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index