em0, VLAN and bpf(?) trouble w/RELENG_5

Mike Tancsa mike at sentex.net
Wed Nov 10 19:26:55 PST 2004


This does indeed fix it for me!

         ---Mike


At 07:11 PM 10/11/2004, Robert Watson wrote:

>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
>@@ -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;



More information about the freebsd-current mailing list