lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 05 Nov 2007 19:00:19 +0100
From:	Patrick McHardy <kaber@...sh.net>
To:	Dave Johnson <djohnson+linux-kernel@...starentnetworks.com>
CC:	David Miller <davem@...emloft.net>, jes@...ined-monkey.org,
	mchan@...adcom.com, ram.vepa@...erion.com,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	bguo@...starentnetworks.com
Subject: Re: [PATCH 1/2] NET: Re-add VLAN tag for devices incapable of keeping
 it

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 netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists