From owner-freebsd-current@FreeBSD.ORG Tue Oct 12 14:02:18 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 DE5D216A4CF; Tue, 12 Oct 2004 14:02:18 +0000 (GMT) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 28E3443D1D; Tue, 12 Oct 2004 14:02:18 +0000 (GMT) (envelope-from glebius@freebsd.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.12.11/8.12.8) with ESMTP id i9CE2GYD030304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 12 Oct 2004 18:02:17 +0400 (MSD) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.sick.ru (8.12.11/8.12.11/Submit) id i9CE26W4030303; Tue, 12 Oct 2004 18:02:06 +0400 (MSD) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@freebsd.org using -f Date: Tue, 12 Oct 2004 18:02:05 +0400 From: Gleb Smirnoff To: "Roub?cek Zdenek (T-Systems PragoNet)" Message-ID: <20041012140205.GD29433@cell.sick.ru> References: <9256D57F598E6C41B288AA7DB94F29C902DFB963@pgnmail1.pgnaplikace.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <9256D57F598E6C41B288AA7DB94F29C902DFB963@pgnmail1.pgnaplikace.cz> User-Agent: Mutt/1.5.6i 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 14:02:19 -0000 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. 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; } -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE