# speed problem with via rhine

## andyknownasabu

Hello out there,

I have a problem with my onboard via rhine II ethernet card:

Under FreeBSD 5.1 everything is working fine, but under

Gentoo scp'ing a file can't be done with more than 40KB/s.

(in a 100MBit network)

First the card sends with nearly 130KB/s (also not the

expected maximum) but then pretty fast the transmission

falls down to 40KB/s.

I didn't recognize this for a long time, because downloading

a file is not affected.

Does anyone experience the same problems or is it rather

a kernel bug? Whom should I contact?

This is the output of lspci:

```

00:00.0 Host bridge: VIA Technologies, Inc. VT8366/A/7 [Apollo KT266/A/333]

   Subsystem: Unknown device 1849:3099

   Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-

   Status: Cap+ 66Mhz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort+ >SERR- <PERR-

   Latency: 0

   Region 0: Memory at e0000000 (32-bit, prefetchable) [size=128M]

   Capabilities: [a0] AGP version 2.0

      Status: RQ=32 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW+ AGP3- Rate=x1,x2,x4

      Command: RQ=1 ArqSz=0 Cal=0 SBA- AGP- GART64- 64bit- FW- Rate=<none>

   Capabilities: [c0] Power Management version 2

      Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)

      Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:01.0 PCI bridge: VIA Technologies, Inc. VT8366/A/7 [Apollo KT266/A/333 AGP] (prog-if 00 [Normal decode])

   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-

   Status: Cap+ 66Mhz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort+ >SERR- <PERR-

   Latency: 0

   Bus: primary=00, secondary=01, subordinate=01, sec-latency=0

   I/O behind bridge: 0000b000-0000bfff

   Memory behind bridge: dfe00000-dfefffff

   Prefetchable memory behind bridge: bfd00000-dfcfffff

   BridgeCtl: Parity- SERR- NoISA+ VGA+ MAbort- >Reset- FastB2B-

   Capabilities: [80] Power Management version 2

      Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)

      Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:09.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

   Subsystem: Realtek Semiconductor Co., Ltd. RT8139

   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-

   Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-

   Latency: 32 (8000ns min, 16000ns max)

   Interrupt: pin A routed to IRQ 10

   Region 0: I/O ports at ec00 [size=256]

   Region 1: Memory at dfffff00 (32-bit, non-prefetchable) [size=256]

   Expansion ROM at ffff0000 [disabled] [size=64K]

00:0a.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

   Subsystem: Realtek Semiconductor Co., Ltd. RT8139

   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-

   Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-

   Latency: 32 (8000ns min, 16000ns max)

   Interrupt: pin A routed to IRQ 5

   Region 0: I/O ports at e800 [size=256]

   Region 1: Memory at dffffe00 (32-bit, non-prefetchable) [size=256]

   Expansion ROM at ffff0000 [disabled] [size=64K]

00:0b.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)

   Subsystem: Hauppauge computer works Inc. WinTV Series

   Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-

   Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-

   Latency: 32 (4000ns min, 10000ns max)

   Interrupt: pin A routed to IRQ 3

   Region 0: Memory at dfdfe000 (32-bit, prefetchable) [size=4K]

   Capabilities: [44] Vital Product Data

   Capabilities: [4c] Power Management version 2

      Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)

      Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:0b.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)

   Subsystem: Hauppauge computer works Inc. WinTV Series

   Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-

   Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-

   Latency: 32 (1000ns min, 63750ns max)

   Interrupt: pin A routed to IRQ 3

   Region 0: Memory at dfdff000 (32-bit, prefetchable) [size=4K]

   Capabilities: [44] Vital Product Data

   Capabilities: [4c] Power Management version 2

      Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)

      Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:0c.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8029(AS)

   Subsystem: Realtek Semiconductor Co., Ltd. RTL-8029(AS)

   Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-

   Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-

   Interrupt: pin A routed to IRQ 11

   Region 0: I/O ports at e400 [size=32]

   Expansion ROM at ffff8000 [disabled] [size=32K]

00:0d.0 Multimedia audio controller: Ensoniq 5880 AudioPCI (rev 02)

   Subsystem: Ensoniq Creative Sound Blaster AudioPCI128

   Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-

   Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR-

   Latency: 32 (3000ns min, 32000ns max)

   Interrupt: pin A routed to IRQ 10

   Region 0: I/O ports at e000 [size=64]

   Capabilities: [dc] Power Management version 1

      Flags: PMEClk- DSI+ D1- D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)

      Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:10.0 USB Controller: VIA Technologies, Inc. USB (rev 80) (prog-if 00 [UHCI])

   Subsystem: VIA Technologies, Inc. USB

   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B-

   Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-

   Latency: 32, cache line size 08

   Interrupt: pin A routed to IRQ 11

   Region 4: I/O ports at d400 [size=32]

   Capabilities: [80] Power Management version 2

      Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)

      Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:10.1 USB Controller: VIA Technologies, Inc. USB (rev 80) (prog-if 00 [UHCI])

   Subsystem: VIA Technologies, Inc. USB

   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B-

   Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-

   Latency: 32, cache line size 08

   Interrupt: pin B routed to IRQ 10

   Region 4: I/O ports at d800 [size=32]

   Capabilities: [80] Power Management version 2

      Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)

      Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:10.2 USB Controller: VIA Technologies, Inc. USB (rev 80) (prog-if 00 [UHCI])

   Subsystem: VIA Technologies, Inc. USB

   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B-

   Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-

   Latency: 32, cache line size 08

   Interrupt: pin C routed to IRQ 5

   Region 4: I/O ports at dc00 [size=32]

   Capabilities: [80] Power Management version 2

      Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)

      Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:10.3 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 82) (prog-if 20 [EHCI])

   Subsystem: VIA Technologies, Inc. USB 2.0

   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B-

   Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-

   Latency: 32, cache line size 10

   Interrupt: pin D routed to IRQ 3

   Region 0: Memory at dffffd00 (32-bit, non-prefetchable) [size=256]

   Capabilities: [80] Power Management version 2

      Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)

      Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:11.0 ISA bridge: VIA Technologies, Inc. VT8235 ISA Bridge

   Subsystem: Unknown device 1849:3177

   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping+ SERR- FastB2B-

   Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-

   Latency: 0

   Capabilities: [c0] Power Management version 2

      Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)

      Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE (rev 06) (prog-if 8a [Master SecP PriP])

   Subsystem: Unknown device 1849:0571

   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-

   Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-

   Latency: 32

   Interrupt: pin A routed to IRQ 14

   Region 4: I/O ports at fc00 [size=16]

   Capabilities: [c0] Power Management version 2

      Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)

      Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 74)

   Subsystem: Unknown device 1849:3065

   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B-

   Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-

   Latency: 32 (750ns min, 2000ns max), cache line size 08

   Interrupt: pin A routed to IRQ 11

   Region 0: I/O ports at d000 [size=256]

   Region 1: Memory at dffffc00 (32-bit, non-prefetchable) [size=256]

   Capabilities: [40] Power Management version 2

      Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)

      Status: D0 PME-Enable- DSel=0 DScale=0 PME-

01:00.0 VGA compatible controller: ATI Technologies Inc Radeon RV200 QW [Radeon 7500] (prog-if 00 [VGA])

   Subsystem: ATI Technologies Inc Radeon RV200 QW [Radeon 7500]

   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping+ SERR- FastB2B-

   Status: Cap+ 66Mhz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-

   Latency: 32 (2000ns min), cache line size 08

   Interrupt: pin A routed to IRQ 11

   Region 0: Memory at c0000000 (32-bit, prefetchable) [size=256M]

   Region 1: I/O ports at b800 [size=256]

   Region 2: Memory at dfef0000 (32-bit, non-prefetchable) [size=64K]

   Expansion ROM at dfec0000 [disabled] [size=128K]

   Capabilities: [58] AGP version 2.0

      Status: RQ=48 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW- AGP3- Rate=x1,x2,x4

      Command: RQ=1 ArqSz=0 Cal=0 SBA+ AGP- GART64- 64bit- FW- Rate=<none>

   Capabilities: [50] Power Management version 2

      Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)

      Status: D0 PME-Enable- DSel=0 DScale=0 PME-
```

----------

## Nermal

do a

```
cat /proc/interrupts
```

and check that the net card isn't sharing an irq, or, if it is, that IRQ routing is ok on your machine...

You might need to enable APIC if its a newer machine, it sounds like an IRQ conflict could be causing it..

----------

## Janne Pikkarainen

Is network card configured to be 100 Mbit Full Duplex? Even letting it be in autosense could lead to strange performance problems.

----------

## andyknownasabu

 *Nermal wrote:*   

> do a
> 
> ```
> cat /proc/interrupts
> ```
> ...

 

Thanks for your help...

And how can I check that IRQ routing is ok?

----------

## andyknownasabu

 *Janne Pikkarainen wrote:*   

> Is network card configured to be 100 Mbit Full Duplex? Even letting it be in autosense could lead to strange performance problems.

 

Also thanks for your answer!

That means it should be in Half-Duplex?

How can I disable autosense?

----------

## Janne Pikkarainen

No, it probably should be 100 Mbit Full Duplex. The value itself is quite easily changable, there are at least two popular programs for modifying network card properties: mii-tool (in package mii-diag, "emerge mii-diag") and ethtool ("emerge ethtool").

If your network card supports ethtool, the command you should try is

```
ethtool -s eth0 speed 100 duplex full autoneg off
```

And if your network card doesn't support ethtool but supports mii-tool instead, then the command is

```
mii-tool -F 100baseTx-FD eth0
```

----------

## andyknownasabu

 *Janne Pikkarainen wrote:*   

> No, it probably should be 100 Mbit Full Duplex. The value itself is quite easily changable, there are at least two popular programs for modifying network card properties: mii-tool (in package mii-diag, "emerge mii-diag") and ethtool ("emerge ethtool").
> 
> If your network card supports ethtool, the command you should try is
> 
> ```
> ...

 

Thanks, I tried that, but the speed remained at only 33KB/s. :(

Do you have an idea how I could check if IRQ routing is OK?

cat /proc/interrupts showed me that the card is sharing an IRQ

with the USB Controller...

UPDATE:

I found a clue in a forum to add "noapic" and/or "acpi=off" as 

kernel parameter. I tried that but it didn't work either :((

----------

## TenPin

From the look of lspci you have 4 ?? ethernet cards in your machine. Try removing some of them and testing it again, it smells like an IRQ issue.

----------

## andyknownasabu

 *TenPin wrote:*   

> From the look of lspci you have 4 ?? ethernet cards in your machine. Try removing some of them and testing it again, it smells like an IRQ issue.

 

Yes 4 cards... When I noticed that the via rhine made problems I plugged in another rtl8139 card to have full speed and disabled

the onboard via rhine.

Unfortunately I don't know if an IRQ conflict existed already at that time - at least I didn't notice it. But it could be, I will try to remove

some of them. Thanks!

----------

## sschlueter

I have the very same problem.  :Sad: 

Does anybody know a solution?

----------

## Merlin-TC

I am having the same problem.

I can't give a soltution but I did intensive testing.

What I found out is that there is a diffrence in what protocol is used, TCP or UDP and also in what direction the data is being sent.

I tried many kernel versions but there was no change.

I still think it's some kind of driver issue.

----------

## cyrillic

I'm not sure if this info will help anybody, but I have an onboard VIA Rhine-II on my KT400 motherboard working fine.  I used scp to transfer a KNOPPIX iso (700MB) to and from this machine at ~11MB/s.

```
# lspci

00:00.0 Host bridge: VIA Technologies, Inc. VT8377 [KT400 AGP] Host Bridge

00:01.0 PCI bridge: VIA Technologies, Inc. VT8235 PCI Bridge

00:0d.0 FireWire (IEEE 1394): Texas Instruments TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)

00:0e.0 USB Controller: VIA Technologies, Inc. USB (rev 50)

00:0e.1 USB Controller: VIA Technologies, Inc. USB (rev 50)

00:0e.2 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 51)

00:10.0 USB Controller: VIA Technologies, Inc. USB (rev 80)

00:10.1 USB Controller: VIA Technologies, Inc. USB (rev 80)

00:10.2 USB Controller: VIA Technologies, Inc. USB (rev 80)

00:10.3 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 82)

00:11.0 ISA bridge: VIA Technologies, Inc. VT8235 ISA Bridge

00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE (rev 06)

00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235 AC97 Audio Controller (rev 50)

00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 74)

00:13.0 RAID bus controller: Triones Technologies, Inc. HPT374 (rev 07)

00:13.1 RAID bus controller: Triones Technologies, Inc. HPT374 (rev 07)

01:00.0 VGA compatible controller: ATI Technologies Inc Radeon RV100 QY [Radeon 7000/VE] 
```

```
# cat /proc/interrupts

           CPU0

  0:   13721089    IO-APIC-edge  timer

  1:        219    IO-APIC-edge  i8042

  2:          0          XT-PIC  cascade

  8:          2    IO-APIC-edge  rtc

  9:          0    IO-APIC-edge  acpi

 12:      81761    IO-APIC-edge  i8042

 14:        130    IO-APIC-edge  ide0

 16:     843471   IO-APIC-level  ohci1394, radeon@PCI:1:0:0

 17:          0   IO-APIC-level  uhci_hcd

 18:      78696   IO-APIC-level  ide2, ide3, ehci_hcd

 19:          0   IO-APIC-level  uhci_hcd

 21:          0   IO-APIC-level  ehci_hcd, uhci_hcd, uhci_hcd, uhci_hcd

 22:          0   IO-APIC-level  VIA8233

 23:    2073244   IO-APIC-level  eth0

NMI:          0

LOC:   13720917

ERR:          0

MIS:         20 
```

I have APIC and IO-APIC compiled in the kernel.  I think this allows eth0 to have IRQ 23 all to itself.

----------

## Merlin-TC

I am using the 2.6 kernel for a long time now and I think it's the drivers included with them.

I really did extensive testing and I think the drivers included in the kernel can't recognize all the different versions and revisions of the chip so it does work but not always like you would expect it.

But right now Via didn't release any drivers for the new kernel and so I cannot test it.

But I had the same experience with a driver for my realtek gigabit lan card.

The ones shipped with the kernel worked but it was damn slow.

So for testing I switched back to a 2.4 version and used a driver from the realtek site and it worked like a charm.

And so I guess it's the same with the via drivers.

----------

