[ovs-dev] [PATCH] ofp-util: For OF1.0, don't wildcard PCP field when 802.1Q header absent.

Ben Pfaff blp at nicira.com
Fri Aug 21 00:09:55 UTC 2015


On Thu, Aug 06, 2015 at 01:10:04PM -0700, Jarno Rajahalme wrote:
> > On Aug 5, 2015, at 9:59 PM, Ben Pfaff <blp at nicira.com> wrote:
> > 
> > OpenFlow 1.0.1 says:
> > 
> >    The dl_vlan_pcp field must be ignored when the OFPFW_DL_VLAN wildcard
> >    bit is set or when the dl_vlan value is set to OFP_VLAN_NONE.  Fields
> >    that are ignored don’t need to be wildcarded and should be set to 0.
> > 
> > Previously, OVS wildcarded the PCP field when dl_vlan was OFP_VLAN_NONE,
> > but this commit changes the behavior to that suggested above: the PCP
> > field should not be wildcarded (and should be set to 0, but the code
> > already did that).
>
> This feels highly counter-intuitive, but it works due to flow parser
> setting the PCP bits to zeroes when there is no vlan in the
> packet. However, this change will make matching a bit less efficient,
> as generally it is faster to wildcard bits than match them. Good to
> see that this was changed in OF 1.1.

I don't think this changes the behavior in this area.  It should only
affect the treatment on OFP_VLAN_NONE on translation to OpenFlow 1.0.
OFP_VLAN_NONE was already a special-case in translation from OpenFlow
1.0 to struct flow in ofputil_match_from_ofp10_match(), and I believe
that there should be no change there.

Do you see a change?

> It would be helpful if DESIGN.md reminded that OFPFW_* values here are
> flags that indicate if the given field should be wildcarded.
> 
> So, this comment could read:
> 
>   - OF1.0 and OF1.1: wwww/x,yy/z means dl_vlan wwww, OFPFW_DL_VLAN x,
>     dl_vlan_pcp yy, and OFPFW_DL_VLAN_PCP z.  If OFPFW_DL_VLAN or
>     OFPFW_DL_VLAN_PCP is 1, the corresponding field value is wildcarded,
>     otherwise it is matched.  ? means that the given
>     bits are ignored (their conventional values are 0000/x,00/0 in
>     OF1.0, 0000/x,00/1 in OF1.1; x is never ignored).  <none> means
>     that the given match is not supported.

Thanks, I folded that in.

Thanks,

Ben.



More information about the dev mailing list