vr speed issues
pyunyh at gmail.com
Wed Nov 29 16:30:39 PST 2006
On Tue, Nov 28, 2006 at 10:50:17PM -0500, Charles Sprickman wrote:
> Hi all,
> I spent some time trying to track down slow tcp performance on a small
> office switched 100 LAN. We just put in a number of whitebox PCs running
> FreeBSD 6.1-p2/PC-BSD 1.2 that all have onboard Via Rhine 10/100 ethernet
> controllers. Performace with scp was around 200KB/s, ftp wavered between
> 300-500KB/s. This did not appear to be a duplex mismatch - unmanaged
> switch showed them all at 100/Full, put some other hosts on the same
> ports/cabling and got near wire speed. I took the cabling out of the
> equation, the switch, no improvement. The only thing that got me decent
> performance was putting two hosts back to back with an xover cable.
> I eventually realized that the only hosts with any speed issues in the
> office were these boxes with the Via ethernet. Putting an equally cheap
> DLink (RealTek/rl) in one of them gave me much better performance.
> At another site, I was dealing with a new intranet server running FreeBSD
> 6.2-PRE (11/16) on a decent Asus board. This also has an onboard Via
> Rhine ethernet controller. While pulling some files over from the box it
> was replacing, I noticed that I was getting only a few hundred KB/s on
> this box. Before putting it into production, I grabbed a cheap Intel
> 10/100 card and put that in. Problem solved.
> So it seems to me like perhaps there's an issue with the vr driver. I
> noticed it does have some quirks mentioned in the manpage, and I don't see
> too many changes to the driver in the last year or so.
> Is there any information I can supply to help debug this? I've got a
> bunch of these machines around. I can get a tcpdump from both ends during
> an ftp transfer, and the boxes are mine to toy with after hours.
> I've posted a dmesg from both boxes (PC-BSD and 6.2-PRE):
VIA Rhine has severe hardware limitations and you can't expect good
performance from the NIC. On Tx side the NIC need 4 bytes aligned mbuf
so the driver defragments the mbuf chains with m_defrag(9).
On Rx side it strips off CRC with m_devget(9) as the NIC has no way
to remove the CRC from the received frame. These m_defrag(9)/
m_devget(9) results in bcopy operation and they nullyfies the
advantage of DMA which in trun waste significant CPU cycles.
If you are in bad need of getting full 100Mbps speed you could buy
a cheap PCI gigabit NIC that is supported by re(4)/sk(4)/stge(4)
More information about the freebsd-stable