Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753322AbXKESAq (ORCPT ); Mon, 5 Nov 2007 13:00:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751168AbXKESAg (ORCPT ); Mon, 5 Nov 2007 13:00:36 -0500 Received: from stinky.trash.net ([213.144.137.162]:40372 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750950AbXKESAf (ORCPT ); Mon, 5 Nov 2007 13:00:35 -0500 Message-ID: <472F5A33.20906@trash.net> Date: Mon, 05 Nov 2007 19:00:19 +0100 From: Patrick McHardy User-Agent: Mozilla-Thunderbird 2.0.0.4 (X11/20070828) MIME-Version: 1.0 To: Dave Johnson CC: David Miller , jes@trained-monkey.org, mchan@broadcom.com, ram.vepa@neterion.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bguo@sw.starentnetworks.com Subject: Re: [PATCH 1/2] NET: Re-add VLAN tag for devices incapable of keeping it References: <472A49BD.6000802@hp.com> <20071101.145956.63020380.davem@davemloft.net> <472A4D5C.2070301@hp.com> <20071101.150723.30590053.davem@davemloft.net> <472A6089.7020104@hp.com> <18223.22291.622615.129374@zeus.sw.starentnetworks.com> In-Reply-To: <18223.22291.622615.129374@zeus.sw.starentnetworks.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1918 Lines: 44 Dave Johnson wrote: > +/* VLAN rx hw acceleration helper. This acts like netif_{rx,receive_skb}(). */ > +static inline int __vlan_hwaccel_rx(struct sk_buff *skb, > + struct vlan_group *grp, > + unsigned short vlan_tag, int polling) > +{ > ... > + /* Driver removed vlan tag from the packet, but we have no > + * vlan device for this VID. > + * > + * This can occur for 2 reasons: > + * 1) Have a vlan group, we want some VIDs, just not this VID. > + * 2) Have no vlan group, but hardware limitation requires it > + * to remove vlan tags anyway. > + * > + * Normally if no vlan group is configured, the underlying > + * driver will configure the hardware to NOT strip out the > + * vlan tag. It can then call netif_receive_skb/netif_rx > + * with the vlan tag still intact. However some devices > + * cannot be configured to keep the vlan tag and must not > + * call netif_receive_skb/netif_rx with the vlan tag > + * missing. This would allow the normal protocol handlers > + * to process this tagged packet as if it arived without a > + * vlan tag. > + * > + * We need to re-add the TAG and hand the packet off to the > + * base device with the TAG present so any protocol handlers > + * (PF_PACKET, etc...) will get a chance to see it. > + */ This looks like a rather expensive operation for the unlikely case that packets will be received by a packet socket. IMO it should only be reconstructed if actually needed, by af_packet itself. As we discussed some time back storing the VLAN tag in the CB on TX clashes with other users of the CB like qdiscs, so we need a new field in the skb for this anyway. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/