# FreeBSD 8.1 realtek vlan



## majls_files (Aug 19, 2010)

I am having a problem with FreeBSD 8.1 that has vlans on realtek network card. What happens is that I can connect to a machine via ssh but when I want to execute a command (e.g top) console freezes and after a while a connection time-out and I am disconnected. If I put an Intel card instead of realtek everything works fine.

I've had same configuration on FreeBSD 8.0 and I did not have such problems.

Are there any known issues with realtek drivers on FreeBSD 8.1 or a solution to this problem?


----------



## Orum (Aug 22, 2010)

I can't answer this directly, but a few quick questions.  Does lagg, sans vlans, work for you on 8.1?  Also, do vlans, sans lagg, work?  Are there any commands you can issue without having your connection time out, or do other protocols aside from ssh work without problems?


----------



## majls_files (Aug 23, 2010)

I didn't try it with lagg or sans vlans. Yes there are commands that execute normal (ls, ftp, ).


----------



## Orum (Aug 23, 2010)

Hrm, you may want to try w/o vlans or w/o lagg and see if it still works.  I also just saw this in the release notes:

```
The vlan(4) pseudo interface now supports TSO (TCP Segmentation Offloading).
The capability flag is named as IFCAP_VLAN_HWTSO and it is separated from
IFCAP_VLAN_HWTAGGING. The age(4), alc(4), ale(4), bce(4), bge(4), cxgb(4),
jme(4), re(4), and mxge(4) driver support this feature.
```
Sounds like this could be the culprit.  Not exactly sure how to disable it, but some googling or maybe even a man page might tell you.


----------



## aragon (Aug 23, 2010)

I don't see where the OP made any mention of using LAGG?

What driver is your Realtek card using, majls_files?

First things to try is disabling the hardware offloaded vlan features.  See ifconfig(8) for the vlanhwtag, vlanhwfilter, vlanhwtso interface options.

Also try disable tso, rxcsum and txcsum.


----------



## Orum (Aug 23, 2010)

aragon said:
			
		

> I don't see where the OP made any mention of using LAGG?


Ah, you're right, this is what happens when I read too many networking posts on the forum in close temporal proximity.


----------



## majls_files (Aug 24, 2010)

aragon said:
			
		

> I don't see where the OP made any mention of using LAGG?
> 
> What driver is your Realtek card using, majls_files?
> 
> ...



I tried with this command but still it didn't work:
`ifconfig rl0 -rxcsum -txcsum -tso -lro promisc polling -vlanhwtag up`
I have no idea how to check which Realtek driver is installed by default on FreeBSD 8.1.

Maybe this helps:

```
rl0@pci0:0:9:0: class=0x020000 card=0x813910ec chip=0x813910ec rev=0x10 hdr=0x00
    vendor     = 'Realtek Semiconductor'
    device     = 'Realtek RTL8139 Family PCI Fast Ethernet NIC (RTL-8139/8139C/8139D)'
    class      = network
    subclass   = ethernet
    bar   [10] = type I/O Port, range 32, base 0xec00, size 256, enabled
    bar   [14] = type Memory, range 32, base 0xd9000000, size 256, enabled
```


----------



## majls_files (Aug 24, 2010)

Today I installed FreeBSD 9.0 CURRENT and problem remains. For now only FreeBSD 8.0 works without a problem.

Can anyone tell me how to check which version of realtek driver is installed?


----------



## JimW (Aug 26, 2010)

majls_files said:
			
		

> Can anyone tell me how to check which version of realtek driver is installed?



From what you have stated, it looks like you are using the *rl* RealTek driver.

Have you tried maybe using the *re* driver?


----------



## majls_files (Aug 26, 2010)

OK, I will try with re drivers


----------



## majls_files (Aug 26, 2010)

According to documentation re driver doesn't have support for 8139 device only 8139C+. I guess I can't use re drivers or am I wrong?


```
pciconf -lv:
rl0@pci0:0:9:0: class=0x020000 card=0x813910ec chip=0x813910ec rev=0x10 hdr=0x00
    vendor     = 'Realtek Semiconductor'
    device     = 'Realtek RTL8139 Family PCI Fast Ethernet NIC (RTL-8139/8139C/8139D)'
    class      = network
    subclass   = ethernet
```

From documentation:

```
re -- RealTek 8139C+/8169/816xS/811xS/8101E PCI/PCIe Ethernet adapter driver
```


----------



## aragon (Aug 26, 2010)

You're stuck with the driver FreeBSD detects.

Are you seeing any kernel messages about interrupt storms?


----------



## majls_files (Aug 27, 2010)

Not even one message is displayed or written to a log.


----------



## yongari@ (Aug 28, 2010)

This is interesting. AFAIK there is no rl(4) source code change between 8.0-RELEASE and 8.1-RELEASE. Would you show me how you configured VLAN? rl(4) is dumb device that lacks any offloading capability such that all VLAN handling is done with software. So it's hard to believe basic VLAN processing has problems on 8.1-RELEASE.


----------



## majls_files (Aug 31, 2010)

From rc.conf:


```
cloned_interfaces="vlan192"
ifconfig_vlan192="inet 192.168.192.254 netmask 255.255.255.0 vlan 192 vlandev rl0"
```


----------

