[ovs-dev] [PATCH 5/5] Use VLAN_VID_SHIFT, even though it is 0, for consistency.

Jesse Gross jesse at nicira.com
Fri Feb 12 21:15:11 PST 2010


On Fri, Feb 12, 2010 at 9:36 PM, Justin Pettit <jpettit at nicira.com> wrote:

> Yowza.  That is kind of ugly.  I'm not sure that the first two would even
> correct had the shift not been zero, though.  I think all the masks are
> bitwise-correct, so you normally don't shift them.
>
>
I'm pretty sure that this is correct.  In this case the masks are bitwise
correct but the values are not.  We're just comparing them, so it doesn't
really matter which one we shift.  We're doing exactly the same thing for
the PCP bits, which is probably easier to think about since the shift isn't
zero there.


> I was looking at the function dp_netdev_modify_vlan_tci() in dpif-netdev.c.
>  Doesn't it seem like we should be applying the mask to the passed in value,
> too?  So, this:
>

We could do that but we validate the actions when the flows are added so
they should already be in the correct range.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/dev/attachments/20100213/b38a21cb/attachment.htm>


More information about the dev mailing list