From owner-freebsd-current@FreeBSD.ORG Tue Oct 12 18:51:53 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 E2D4016A4CE; Tue, 12 Oct 2004 18:51:52 +0000 (GMT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id D0C3B43D2F; Tue, 12 Oct 2004 18:51:51 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id i9CIpfTW046352; Tue, 12 Oct 2004 21:51:41 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua ([82.193.96.10]) by localhost (rocky.ipnet [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 15294-10; Tue, 12 Oct 2004 21:51:40 +0300 (EEST) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id i9CIpemu046349; Tue, 12 Oct 2004 21:51:40 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.1/8.13.1) id i9CIpTSw087086; Tue, 12 Oct 2004 21:51:29 +0300 (EEST) (envelope-from ru) Date: Tue, 12 Oct 2004 21:51:29 +0300 From: Ruslan Ermilov To: Sam Leffler Message-ID: <20041012185129.GA86935@ip.net.ua> References: <9256D57F598E6C41B288AA7DB94F29C902DFB963@pgnmail1.pgnaplikace.cz> <20041012140205.GD29433@cell.sick.ru> <416BFE30.2090308@errno.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rwEMma7ioTxnRzrJ" Content-Disposition: inline In-Reply-To: <416BFE30.2090308@errno.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at ip.net.ua cc: Gleb Smirnoff cc: freebsd-current@freebsd.org Subject: Re: Broadcom bge and 802.1Q vlan tags 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: Tue, 12 Oct 2004 18:51:53 -0000 --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 12, 2004 at 08:54:24AM -0700, Sam Leffler wrote: > Gleb Smirnoff wrote: > >On Tue, Oct 12, 2004 at 10:36:27AM +0200, Roub?cek Zdenek (T-Systems=20 > >PragoNet) wrote: > >R> I have run into a problem with my Broadcom NIC (Dell LATITUDE D600).= I=20 > >am not able to detect 802.1Q tags on incoming interface with ethereal or= =20 > >tcpdump. All incoming packets seems like they are not coming through tru= nk=20 > >but as native ETH frames, ie. the vlan tag is missing, probably removed= =20 > >before being passed to tcpdump? > >R>=20 > >R> No I have not tested NIC's behaviour on 4.X, but I is working with=20 > >linux (2.6.something kernel probably?) > >R>=20 > >R> Any ideas what to modify or set so I can detect vlan_tag would be ver= y=20 > >apreciated. > > > >As Ruslan already mentioned, it is impossible to turn off hardware VLAN > >stripping in bge driver. > > > >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) !=3D NULL) { > >+ if (m_tag_locate(m, MTAG_VLAN, MTAG_VLAN_TAG, NULL) !=3D NULL) { > > /* > > * vlan_input() will either recursively call ether_input= () > > * or drop the packet. > > */ > >- KASSERT(vlan_input_p !=3D NULL,("ether_input: VLAN not= =20 > >loaded!")); > >+ if (vlan_input_p =3D=3D NULL) { > >+ /* vlan(4) is not loaded, discard frame */ > >+ m_freem(m); > >+ return; > >+ } > > (*vlan_input_p)(ifp, m); > > return; > > } > > >=20 > This pessimizes normal traffic. >=20 m_tag_locate() doesn't look like a very expensive function. And with the "normal traffic", I don't expect to be more than one tag, no? Also, if if_nvlans > 0, this is already "pessimized". > We should look for a solution in the=20 > driver(s) to avoid sending packets up with tags when no vlans are=20 > configured. >=20 I'd be opposed to such a change in behavior. The VLAN consumer can be not only vlan(4), it can equally be the ng_vlan(4) node, etc. Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --rwEMma7ioTxnRzrJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBbCexqRfpzJluFF4RAkggAJ9M+znn21E8PKgeN7q4w7gl8uc7kwCgmcUN zP3zsWo7ZNDn8Y7qN28AvWA= =ZfDN -----END PGP SIGNATURE----- --rwEMma7ioTxnRzrJ--