[ovs-dev] [PATCH 1/5] datapath: Use strip_vlan() for modify_vlan_tci().
Ben Pfaff
blp at nicira.com
Thu Jun 16 19:37:08 UTC 2011
On Wed, Jun 15, 2011 at 11:00:05AM -0700, Jesse Gross wrote:
> The sematics for setting a vlan tag are to modify the existing tag
> if one exists. This can be expressed as removing the existing tag
> first and then adding a new one. This simplifies the code by not
> requiring two copies of the logic that manipulates non-accelerated
> vlans and should not make a performance difference because the vlan
> tag is contained in a single cache line.
>
> Signed-off-by: Jesse Gross <jesse at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>
But the test for VLAN_ETH_HLEN isn't needed, I think, because
strip_vlan() does the same test.
strip_vlan() checks vlan_eth_hdr(skb)->h_vlan_proto for 802.1Q
whereas modify_vlan_tci() checks skb->protocol. I don't know if
consistency is important.
More information about the dev
mailing list