Re: Re[2]: em0, VLAN and bpf(?) trouble w/RELENG_5

From: Robert Watson <rwatson_at_freebsd.org>
Date: Thu, 11 Nov 2004 00:11:08 +0000 (GMT)
On Wed, 10 Nov 2004 astesin_at_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_at_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
_at__at_ -1497,14 +1497,14 _at__at_
 	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;
Received on Wed Nov 10 2004 - 23:12:20 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:21 UTC