From owner-freebsd-net@FreeBSD.ORG Fri Oct 26 11:40:10 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 581F416A419 for ; Fri, 26 Oct 2007 11:40:10 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 28B9913C4B2 for ; Fri, 26 Oct 2007 11:40:09 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 2755F3C604; Fri, 26 Oct 2007 07:40:09 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 26 Oct 2007 07:40:09 -0400 X-Sasl-enc: JxOGvLsvYln7OeRGqZPUqmZyqK7oNn/jHkXglKDEenjM 1193398808 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTP id 734CC24D7E; Fri, 26 Oct 2007 07:40:08 -0400 (EDT) Message-ID: <4721D217.2010003@FreeBSD.org> Date: Fri, 26 Oct 2007 12:40:07 +0100 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.6 (X11/20070928) MIME-Version: 1.0 To: Jon Otterholm References: <47210D92.1050403@ide.resurscentrum.se> In-Reply-To: <47210D92.1050403@ide.resurscentrum.se> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, Andrew Thompson Subject: Re: QinQ X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2007 11:40:10 -0000 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