From owner-freebsd-net@FreeBSD.ORG Thu Jan 20 10:33:45 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 E6DD816A4CE for ; Thu, 20 Jan 2005 10:33:45 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D64043D3F for ; Thu, 20 Jan 2005 10:33:45 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.13.1/8.13.1) with ESMTP id j0KAXYTp084238; Thu, 20 Jan 2005 05:33:35 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)j0KAXYGS084235; Thu, 20 Jan 2005 10:33:34 GMT (envelope-from robert@fledge.watson.org) Date: Thu, 20 Jan 2005 10:33:33 +0000 (GMT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Charlie Schluting In-Reply-To: <41EECAC0.3000801@schluting.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: "freebsd-net@freebsd.org" 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 10:33:46 -0000 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 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. Robert N M Watson