From owner-freebsd-net@FreeBSD.ORG Thu Jan 20 14:39:52 2005 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 500DE16A4CE; Thu, 20 Jan 2005 14:39:52 +0000 (GMT) Received: from mp2.macomnet.net (mp2.macomnet.net [195.128.64.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1BE6A43D3F; Thu, 20 Jan 2005 14:39:51 +0000 (GMT) (envelope-from maxim@macomnet.ru) Received-SPF: pass (mp2.macomnet.net: domain of maxim@macomnet.ru designates 127.0.0.1 as permitted sender) receiver=mp2.macomnet.net; client_ip=127.0.0.1; envelope-from=maxim@macomnet.ru; Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.12.11/8.12.11) with ESMTP id j0KEdm2r062733; Thu, 20 Jan 2005 17:39:48 +0300 (MSK) (envelope-from maxim@macomnet.ru) Date: Thu, 20 Jan 2005 17:39:48 +0300 (MSK) From: Maxim Konovalov To: Robert Watson In-Reply-To: Message-ID: <20050120173819.Q62580@mp2.macomnet.net> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SpamTest-Info: Profile: Formal (197/050118) X-SpamTest-Info: Profile: Detect Hard (4/030526) X-SpamTest-Info: Profile: SysLog X-SpamTest-Info: Profile: Marking - Keywords (2/030321) X-SpamTest-Status: Not detected X-SpamTest-Version: SMTP-Filter Version 2.0.0 [0124], SpamtestISP/Release cc: "freebsd-net@freebsd.org" cc: alx@sm.ukrtel.net cc: Charlie Schluting Subject: Re: vlans changed? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2005 14:39:52 -0000 On Thu, 20 Jan 2005, 10:33-0000, Robert Watson wrote: > > On Wed, 19 Jan 2005, Charlie Schluting wrote: > > > Now, in 5.3, the only thing I can get working is to configure the em0 > > int with the IP, and set the trunk to have the native vlan corresponding > > to that IP. Weird. > > > > Also, is there a way to stop em(4) from stripping dot1q tags in > > hardware? I'd like to see them with tcpdump. What kind of a performance > > hit does this involve? > > Try "ifconfig em0 -vlanhwtag" and see if that helps. If not, take a look Yep, it works for Alex (CC'ed), thanks for the tip. > in if_em.c:em_setup_interface(), and you'll see two lines like this: > > #if __FreeBSD_version >= 500000 > ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; > ifp->if_capenable |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; > #endif > > Delete the contents "|FCAP_VLAN_HWTAGGING |" from each line, and that > should disable support for hardware vlan tagging and stripping in the > driver. There are several bugs relating to the handling of hardware vlan > tagging and promiscuous mode in both if_re and if_em. I had hoped to have > a chance to resolve them over the past couple of months but have not as > yet been able to do so. I measured a small performance hit last time I > tried disabling the hardware tagging, perhaps a couple of percent, but > mileage may vary -- for in-bound packets, there's a small amount > additional work, but for outgoing packets you may see an extra memory > allocation for each encapsulated packet (it depends a bit on what you > send). If this appears to work properly for you, we should probably > commit the change so that what's in the tree works properly, even if it's > slightly slower. IMO this is a good idea. -- Maxim Konovalov