QinQ

Bruce M. Simpson bms at FreeBSD.org
Fri Oct 26 04:40:10 PDT 2007


Jon,

Thanks for the patch.

Jon Otterholm wrote:
> I was wondering about the possibility of adding support for QinQ
> ("Double tagged frames" / "Nested vlans"). Attached is a patch against
> -STABLE to add this support. I have not tested this but was told it
> should work.
>
> Would it be possible to get this into CURRENT?
>   

In the 7.x train, I made some changes to always decode the VLAN tags and 
embed the information in the mbuf header. I did this to support 802.1p 
quality-of-service in the stack - VLAN 0 frames mean 'the whole subnet, 
not its vlan', and previously the stack just ignored these.

I can't remember off the top of my head if I merged this to 6.x - it 
means the patch herein may not even be needed, unless you need to do 
demux of vlan tags to arbitrary depth, something I think is best left to 
netgraph.

What I can tell you is that if you look at the comments in 
if_ethersubr.c, I left q-in-q as a possible todo item. I don't use it 
myself - however - the same approach might be considered for cards which 
have q-in-q support in their hardware tag/queue processing.

Kip Macy may be able to advise further - I understand the newer 10gbps 
cards are quite programmable in this respect.

However I believe it means we may not need to apply vlan(4)'s notion of 
having to call if_promisc() if the card already knows to supply the 
stack with frames for VLAN 'foo', i.e. if VLAN 'bar' is nested in 'foo'. 
Promiscuous mode is best avoided particularly with high rates of 
packets-per-second.

regards,
BMS


More information about the freebsd-net mailing list