Subject: Re: kern/32643: re(4) has problems with HW VLAN tagging
To: None <yamt@mwd.biglobe.ne.jp>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: netbsd-bugs
Date: 11/20/2006 22:18:03
yamt@mwd.biglobe.ne.jp wrote:

> >  His patch cleared only vlanctl in the first DMA desc on TX,
> >  but I guess all descs should be cleared both on TX and RX.
> >  (though I'm not sure what will happen when only trailing descs
> >   have vlanctl values on TX with multiple descs)
> 
> i was not able to reproduce his problem (scp) even with my patch.
> ie. there is no way to confirm it working without letting him try.

It seems reproducible with your patch even by ping(8).

--- commands on re(4) hosts ---
# ifconfig re0 192.168.20.4 ip4csum udp4csum tcp4csum
# ifconfig vlan0 create
# ifconfig vlan0 vlan 4 vlanif re0
# ifconfig vlan0 192.168.200.2
# ping -fn -c 256 192.168.20.28 >& /dev/null
# ping -fn -c 256 192.168.200.4 >& /dev/null
# ping -fn -c 8 192.168.20.28 >& /dev/null
# ping -fn -c 8 -s 1473 192.168.20.28 >& /dev/null
--- end of commands ---

--- tcpdump -evn output on 192.168.20.28 aka 192.168.200.4 ---
21:56:13.219800 00:0d:0b:4b:af:1b > 00:10:e0:00:5e:95, ethertype IPv4 (0x0800), length 98: IP (tos 0x0, ttl 255, id 60103, offset 0, flags [none], length: 84) 192.168.20.4 > 192.168.20.28: icmp 64: echo request seq 0
21:56:13.220052 00:10:e0:00:5e:95 > 00:0d:0b:4b:af:1b, ethertype IPv4 (0x0800), length 98: IP (tos 0x0, ttl 255, id 338, offset 0, flags [none], length: 84) 192.168.20.28 > 192.168.20.4: icmp 64: echo reply seq 0

 :

21:56:37.540102 00:0d:0b:4b:af:1b > 00:10:e0:00:5e:95, ethertype 802.1Q (0x8100), length 102: vlan 4, p 0, ethertype IPv4, IP (tos 0x0, ttl 255, id 60360, offset 0, flags [none], length: 84) 192.168.200.2 > 192.168.200.4: icmp 64: echo request seq 0
21:56:37.540270 00:10:e0:00:5e:95 > 00:0d:0b:4b:af:1b, ethertype 802.1Q (0x8100), length 102: vlan 4, p 0, ethertype IPv4, IP (tos 0x0, ttl 255, id 601, offset 0, flags [none], length: 84) 192.168.200.4 > 192.168.200.2: icmp 64: echo reply seq 0

 :

21:57:04.950385 00:0d:0b:4b:af:1b > 00:10:e0:00:5e:95, ethertype IPv4 (0x0800), length 98: IP (tos 0x0, ttl 255, id 60618, offset 0, flags [none], length: 84) 192.168.20.4 > 192.168.20.28: icmp 64: echo request seq 0
21:57:04.950638 00:10:e0:00:5e:95 > 00:0d:0b:4b:af:1b, ethertype IPv4 (0x0800), length 98: IP (tos 0x0, ttl 255, id 861, offset 0, flags [none], length: 84) 192.168.20.28 > 192.168.20.4: icmp 64: echo reply seq 0

 :

21:57:22.539100 00:0d:0b:4b:af:1b > 00:10:e0:00:5e:95, ethertype 802.1Q (0x8100), length 1518: vlan 4, p 0, ethertype IPv4, IP (tos 0x0, ttl 255, id 60626, offset 0, flags [+], length: 1500) 192.168.20.4 > 192.168.20.28: icmp 1480: echo request seq 0
21:57:22.539174 00:0d:0b:4b:af:1b > 00:10:e0:00:5e:95, ethertype 802.1Q (0x8100), length 64: vlan 4, p 0, ethertype IPv4, IP (tos 0x0, ttl 255, id 60626, offset 1480, flags [none], length: 21) 192.168.20.4 > 192.168.20.28: icmp
21:57:22.539615 00:10:e0:00:5e:95 > 00:0d:0b:4b:af:1b, ethertype IPv4 (0x0800), length 1514: IP (tos 0x0, ttl 255, id 870, offset 0, flags [+], length: 1500) 192.168.20.28 > 192.168.20.4: icmp 1480: echo reply seq 0
21:57:22.539649 00:10:e0:00:5e:95 > 00:0d:0b:4b:af:1b, ethertype IPv4 (0x0800), length 35: IP (tos 0x0, ttl 255, id 870, offset 1480, flags [none], length: 21) 192.168.20.28 > 192.168.20.4: icmp

 :
--- end of tcpdump ---

i.e. it looks we have to clear re_vlanctl in all fragmented descs
since my patch still works fine in this test.
---
Izumi Tsutsui