From owner-freebsd-net@FreeBSD.ORG Sat Mar 3 21:54:02 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8A6E116A407 for ; Sat, 3 Mar 2007 21:54:02 +0000 (UTC) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (comp.chem.msu.su [158.250.32.97]) by mx1.freebsd.org (Postfix) with ESMTP id 03C3313C442 for ; Sat, 3 Mar 2007 21:54:01 +0000 (UTC) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.13.4/8.13.4) with ESMTP id l23Ls0Im043452; Sun, 4 Mar 2007 00:54:00 +0300 (MSK) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.13.4/8.13.4/Submit) id l23Lrx9r043451; Sun, 4 Mar 2007 00:54:00 +0300 (MSK) (envelope-from yar) Date: Sun, 4 Mar 2007 00:53:59 +0300 From: Yar Tikhiy To: Bruce M Simpson Message-ID: <20070303215359.GB40430@comp.chem.msu.su> References: <45E8B964.2090200@incunabulum.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45E8B964.2090200@incunabulum.net> User-Agent: Mutt/1.5.9i Cc: freebsd-net@freebsd.org Subject: Re: [PATCH] Ethernet cleanup; 802.1p input and M_PROMISC X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2007 21:54:02 -0000 On Fri, Mar 02, 2007 at 11:55:16PM +0000, Bruce M Simpson wrote: > Hello all, > > I would like to announce an updated version of the 802.1p input patch, > available at: > http://people.freebsd.org/~bms/dump/latest-8021p.diff > > I have cut down the original scope of the patch. I previously ran into > problems when I tried to move VLAN tag input and output processing into > if_ethersubr.c. > > FreeBSD should now accept VLAN 0 traffic on input with this patch. In > addition to this, the M_PROMISC flag is now used, which considerably > simplifies the Ethernet input path in general. [...] Sorry, I don't have an opportunity to test your patch, but it looks good to me. It seems to remove some cruft from the code, which is a good sign! I've got only one question about this piece: @@ -504,6 +507,10 @@ struct ether_header *eh; u_short etype; + if ((ifp->if_flags & IFF_UP) == 0) { + m_freem(m); + return; + } In fact, there two independent flags indicating interface's readiness: IFF_UP and IFF_DRV_RUNNING. The former is controlled by the admin and the latter, by the driver. E.g., an interface can be UP but not really ready to operate due to h/w reasons, or vice versa. Perhaps we should check both flags to see if the interface is, so to say, up and running. if_vlan.c has an obvious macro for that, and it can go to if_var.h to avoid code duplication if we decide it's the right way to take. -- Yar