Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Oct 2004 10:35:59 -0400
From:      Jung-uk Kim <jkim@niksun.com>
To:        freebsd-current@freebsd.org
Cc:        Gleb Smirnoff <glebius@freebsd.org>
Subject:   Re: Broadcom bge and 802.1Q vlan tags
Message-ID:  <200410121035.59905.jkim@niksun.com>
In-Reply-To: <20041012140205.GD29433@cell.sick.ru>
References:  <9256D57F598E6C41B288AA7DB94F29C902DFB963@pgnmail1.pgnaplikace.cz> <20041012140205.GD29433@cell.sick.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 12 October 2004 10:02 am, Gleb Smirnoff wrote:
> On Tue, Oct 12, 2004 at 10:36:27AM +0200, Roub?cek Zdenek
> (T-Systems PragoNet) wrote: R>  I have run into a problem with my
> Broadcom NIC (Dell LATITUDE D600). I am not able to detect 802.1Q
> tags on incoming interface with ethereal or tcpdump. All incoming
> packets seems like they are not coming through trunk but as native
> ETH frames, ie. the vlan tag is missing, probably removed before
> being passed to tcpdump? R>
> R> No I have not tested NIC's behaviour on 4.X, but I is working
> with linux (2.6.something kernel probably?) R>
> R> Any ideas what to modify or set so I can detect vlan_tag would
> be very apreciated.
>
> As Ruslan already mentioned, it is impossible to turn off hardware
> VLAN stripping in bge driver.

It's not true.  You can:

	BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_RX_KEEP_VLAN_DIAG));

to turn off VLAN tag stripping.

My 2 cents...

Jung-uk Kim

> A patch to stop tagged frames to come on trunk interface is like
> this:
>
> @@ -701,13 +657,16 @@
>          * see if the device performed the decapsulation and
>          * provided us with the tag.
>          */
> -       if (ifp->if_nvlans &&
> -           m_tag_locate(m, MTAG_VLAN, MTAG_VLAN_TAG, NULL) !=
> NULL) { +       if (m_tag_locate(m, MTAG_VLAN, MTAG_VLAN_TAG, NULL)
> != NULL) { /*
>                  * vlan_input() will either recursively call
> ether_input() * or drop the packet.
>                  */
> -               KASSERT(vlan_input_p != NULL,("ether_input: VLAN
> not loaded!")); +               if (vlan_input_p == NULL) {
> +                       /* vlan(4) is not loaded, discard frame */
> +                       m_freem(m);
> +                       return;
> +               }
>                 (*vlan_input_p)(ifp, m);
>                 return;
>         }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200410121035.59905.jkim>