From owner-freebsd-current@FreeBSD.ORG Thu Nov 11 00:12:20 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B96B16A4CE for ; Thu, 11 Nov 2004 00:12:20 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 27BF743D31 for ; Thu, 11 Nov 2004 00:12:20 +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 iAB0B8RW088656; Wed, 10 Nov 2004 19:11:08 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)iAB0B8FX088653; Thu, 11 Nov 2004 00:11:08 GMT (envelope-from robert@fledge.watson.org) Date: Thu, 11 Nov 2004 00:11:08 +0000 (GMT) From: Robert Watson X-Sender: robert@fledge.watson.org To: astesin@ukrtelecom.net In-Reply-To: <1152675CA9EDD71187130002B3CE5ADA1066120D@hoexc010.ukrtelecom.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: mib@wnet.ua cc: freebsd-current@freebsd.org cc: mike@sentex.net Subject: Re: Re[2]: em0, VLAN and bpf(?) trouble w/RELENG_5 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2004 00:12:20 -0000 On Wed, 10 Nov 2004 astesin@ukrtelecom.net wrote: > > So now I have RELENG_5 as of today > > > > 1. No problems with large frames. Bing -s 2000 -S 4000 -e > > 5000 works fine through vlan0. > > > > 2. trafshow -i vlan0 > > ... silence ... > > > > Vlan0 hangs. > > 3. trafshow -p -I vlan0 works fine Try the attached. It looks like the sender is actually sending out ISL-encapsulated packets rather than using the normal VLAN trunk encapsulation (?). The patch below reverts part of a change between the 4x and 5.x drivers that modifies the behavior of the if_em driver in the presence of promiscuous mode. The change was part of a more broad commit described as follows: revision 1.45 date: 2004/09/01 23:22:41; author: pdeuskar; state: Exp; lines: +60 -18 Added support for Intel PRO/1000 GT Desktop Adapter(Device ID 8086 107C) Removed support for Intel 82541ER Added fix for 82547 which corrects an issue with Jumbo frames larger than 10k. Added fix for vlan tagged frames not being properly bridged. Corrected TBI workaround. Corrected incorrect LED operation issues So it sounds like the "fix" here may be mostly right, but not 100% right; I'm unclear on why in this situation you get the ISL encapsulation on transmit instead of the 802.1Q encapsulation. I may just be misunderstanding the details of what is going on here, however, and someone with more familiarity with the hardware could fix this properly. This change, FWIW, is not present in 4.x. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Principal Research Scientist, McAfee Research Index: if_em.c =================================================================== RCS file: /home/ncvs/src/sys/dev/em/if_em.c,v retrieving revision 1.51 diff -u -r1.51 if_em.c --- if_em.c 3 Nov 2004 14:11:18 -0000 1.51 +++ if_em.c 11 Nov 2004 00:04:56 -0000 @@ -1497,14 +1497,14 @@ if (ifp->if_flags & IFF_PROMISC) { reg_rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE); E1000_WRITE_REG(&adapter->hw, RCTL, reg_rctl); - +#if 0 /* Disable VLAN stripping in promiscous mode * This enables bridging of vlan tagged frames to occur * and also allows vlan tags to be seen in tcpdump */ ctrl &= ~E1000_CTRL_VME; E1000_WRITE_REG(&adapter->hw, CTRL, ctrl); - +#endif } else if (ifp->if_flags & IFF_ALLMULTI) { reg_rctl |= E1000_RCTL_MPE; reg_rctl &= ~E1000_RCTL_UPE;