From nobody@FreeBSD.org  Mon Feb 28 22:42:02 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DF4C11065672
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 28 Feb 2011 22:42:01 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id CD7958FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 28 Feb 2011 22:42:01 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p1SMg0lW080550
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 28 Feb 2011 22:42:00 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p1SMg0aO080549;
	Mon, 28 Feb 2011 22:42:00 GMT
	(envelope-from nobody)
Message-Id: <201102282242.p1SMg0aO080549@red.freebsd.org>
Date: Mon, 28 Feb 2011 22:42:00 GMT
From: Andrei <andrei@ivorde.ro>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Vlan hwtagging on fxp under 7.4-PRERELEASE doesn't work
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         155134
>Category:       kern
>Synopsis:       [vlan] vlan hwtagging on fxp under 7.4-PRERELEASE doesn't work
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    yongari
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 28 22:50:02 UTC 2011
>Closed-Date:    Mon May 30 00:02:52 UTC 2011
>Last-Modified:  Mon May 30 00:02:52 UTC 2011
>Originator:     Andrei
>Release:        7.4-PRERELEASE
>Organization:
Ivorde
>Environment:
FreeBSD thor.amsel.nl 7.4-PRERELEASE FreeBSD 7.4-PRERELEASE #0: Tue Feb  1 16:45:33 UTC 2011     root@thor.amsel.nl:/usr/obj/usr/src/sys/Thor  i386

>Description:
Hello,

FreeBSD 7.4 Prerelease (built Feb 1st) fxp driver does not take advantage of vlanhwtag capability. When this is enabled on the parent interface, vlan traffic does not get .1q encapsulated:

[root@thor ~]# grep fe-0/0 /etc/rc.conf
ifconfig_fxp0_name="fe-0/0"

1) vlanhwtag on fxp driver disabled. .1q encapsulation done by kernel.
[root@thor ~]# ifconfig fe-0/0
fe-0/0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=210b<RXCSUM,TXCSUM,VLAN_MTU,TSO4,WOL_MAGIC>
	ether 00:02:b3:9f:ef:86
	inet 192.168.1.16 netmask 0xffffff00 broadcast 192.168.1.255
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active
[root@thor ~]# ifconfig vlan10
vlan10: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 00:02:b3:9f:ef:86
	inet 192.168.3.2 netmask 0xffffff00 broadcast 192.168.3.255
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active
	vlan: 10 parent interface: fe-0/0


[root@thor ~]# ping -i 0.1 192.168.2.21       
PING 192.168.2.21 (192.168.2.21): 56 data bytes
...................................
--- 192.168.3.1 ping statistics ---
72 packets transmitted, 66 packets received, 8.3% packet loss
round-trip min/avg/max/stddev = 0.225/0.336/1.221/0.194 ms

[root@thor ~]# tcpdump -nni fe-0/0 -s0 -ve
tcpdump: listening on fe-0/0, link-type EN10MB (Ethernet), capture size 65535 bytes


23:24:10.147776 00:02:b3:9f:ef:86 > 00:02:a5:8f:56:69, ethertype 802.1Q (0x8100), length 102: vlan 10, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 10042, offset 0, flags [none], proto ICMP (1), length 84) 192.168.3.2 > 192.168.3.1: ICMP echo request, id 26407, seq 4, length 64

23:24:11.157751 00:02:b3:9f:ef:86 > 00:02:a5:8f:56:69, ethertype 802.1Q (0x8100), length 102: vlan 10, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 10052, offset 0, flags [none], proto ICMP (1), length 84) 192.168.3.2 > 192.168.3.1: ICMP echo request, id 26407, seq 5, length 64

(no reply for the first 6 packets it seems, but probably unrelated)

2) vlanhwtag on fxp ENABLED
[root@thor ~]# ifconfig fe-0/0 vlanhwtag
[root@thor ~]# ifconfig fe-0/0
fe-0/0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=211b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,WOL_MAGIC>
	ether 00:02:b3:9f:ef:86
	inet 192.168.1.16 netmask 0xffffff00 broadcast 192.168.1.255
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active


[root@thor ~]# ping -c 3 192.168.3.1
PING 192.168.3.1 (192.168.3.1): 56 data bytes
64 bytes from 192.168.3.1: icmp_seq=0 ttl=64 time=0.986 ms
64 bytes from 192.168.3.1: icmp_seq=1 ttl=64 time=0.314 ms
64 bytes from 192.168.3.1: icmp_seq=2 ttl=64 time=0.308 ms

--- 192.168.3.1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.308/0.536/0.986/0.318 ms


[root@thor ~]# tcpdump -nni fe-0/0 -s0 -ve
tcpdump: listening on fe-0/0, link-type EN10MB (Ethernet), capture size 65535 bytes
23:31:25.941013 00:02:b3:9f:ef:86 > 00:02:a5:8f:56:69, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 10941, offset 0, flags [none], proto ICMP (1), length 84) 192.168.3.2 > 192.168.3.1: ICMP echo request, id 63272, seq 0, length 64
23:31:25.941899 00:02:a5:8f:56:69 > 00:02:b3:9f:ef:86, ethertype 802.1Q (0x8100), length 102: vlan 10, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 36494, offset 0, flags [none], proto ICMP (1), length 84) 192.168.3.1 > 192.168.3.2: ICMP echo reply, id 63272, seq 0, length 64
23:31:26.944466 00:02:b3:9f:ef:86 > 00:02:a5:8f:56:69, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 10945, offset 0, flags [none], proto ICMP (1), length 84) 192.168.3.2 > 192.168.3.1: ICMP echo request, id 63272, seq 1, length 64
23:31:26.944683 00:02:a5:8f:56:69 > 00:02:b3:9f:ef:86, ethertype 802.1Q (0x8100), length 102: vlan 10, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 19971, offset 0, flags [none], proto ICMP (1), length 84) 192.168.3.1 > 192.168.3.2: ICMP echo reply, id 63272, seq 1, length 64
23:31:27.954488 00:02:b3:9f:ef:86 > 00:02:a5:8f:56:69, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 10948, offset 0, flags [none], proto ICMP (1), length 84) 192.168.3.2 > 192.168.3.1: ICMP echo request, id 63272, seq 2, length 64
23:31:27.954698 00:02:a5:8f:56:69 > 00:02:b3:9f:ef:86, ethertype 802.1Q (0x8100), length 102: vlan 10, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 46950, offset 0, flags [none], proto ICMP (1), length 84) 192.168.3.1 > 192.168.3.2: ICMP echo reply, id 63272, seq 2, length 64


So when vlanhwtag is enabled, the frames are not being encapsulated with vlan header. The frame header contains ipv4 proto.

I've searched existing PRs for this and found nothing.
>How-To-Repeat:
Using vlans over fxp interfaces with vlanhwtag option enabled.
>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: yongari 
State-Changed-When: Tue Mar 1 18:16:26 UTC 2011 
State-Changed-Why:  
I'm pretty sure TSO and VLAN hardware tagging worked without 
problems when I firstly implemented that hardware features. AFAIK 
FreeBSD is the only OS that takes advantage of these features and 
Intel's public data sheet does not (intentionally) mention VLAN 
hardware tag insertion/strip feature of controller. The TSO and 
VLAN hardware tagging is supported on i82550 and i82551 
controllers. 

From your description of the issue and tcpdump output I don't see 
any problems. For instance, I see ping for 192.168.3.1 worked and I 
also see VLAN encapsulation(ether type 0x8100) header in the 
tcpdump. If VLAN hardware tagging does not work, you wouldn't get 
any response from 192.168.30.1. So what is your problem? 


Responsible-Changed-From-To: freebsd-bugs->yongari 
Responsible-Changed-By: yongari 
Responsible-Changed-When: Tue Mar 1 18:16:26 UTC 2011 
Responsible-Changed-Why:  
Grab. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=155134 

From: Mark Linimon <linimon@lonesome.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: misc/155134: Vlan hwtagging on fxp under 7.4-PRERELEASE
 doesn't work
Date: Tue, 1 Mar 2011 20:19:47 -0600

 ----- Forwarded message from YongHyeon PYUN <pyunyh@gmail.com> -----
 
 Date: Tue, 1 Mar 2011 17:37:07 -0800
 From: YongHyeon PYUN <pyunyh@gmail.com>
 To: Andrei Manescu - Ivorde <andrei.manescu@ivorde.ro>
 Cc: freebsd-bugs@freebsd.org, andrei@ivorde.ro, yongari@freebsd.org
 Subject: Re: misc/155134: Vlan hwtagging on fxp under 7.4-PRERELEASE doesn't
 	work
 
 Your controller is i82550 Pro/100 Ethernet and it is known to
 support TSO/VLAN hardware tagging as well as IPSec acceleration.
 
 > Am I really off topic ?
 > 
 
 No, but looks strange to me. Could you capture both boxes(one for
 sender(fxp0) and receiver to see whether the packets really have no
 VLAN header.)?
 
 > P.S.: I also attached a capture with one echo request and an echo reply. 
 > The req leaving the FreeBSD box in question is not encapsulated, but the 
 > reply is coming in (with the vlan tag).
 
 I think the capture is incomplete since it only has sender side. I
 need capture both sender and receiver.
 
 > P.S.S.: At the other end, there is a pFsense 2.0-RC1 (FreeBSD 8.1) 
 > firewall with vlans configured on an fxp0 interface also.
 > 
 
 Don't know about pfSense but you can disable VLAN hardware tagging
 on pfSense side to rule out possible VLAN hardware related issues
 before capturing VLAN traffic. Make sure to capture parent
 interface traffic instead of vlan interface.
 
 > 
 > Thanks,
 > Andrei.
 > 
 _______________________________________________
 freebsd-bugs@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
 To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org"
 
 
 ----- End forwarded message -----
State-Changed-From-To: feedback->closed 
State-Changed-By: yongari 
State-Changed-When: Mon May 30 00:02:24 UTC 2011 
State-Changed-Why:  
Close(Feedback timeout). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=155134 
>Unformatted:
