I can reproduce the same issue Ronald report on master ovs.

This patch will break the following tests on master:

testsuite: 329 340 350 385 389 390 391 failed

My understanding is that since we require the exact match for VLAN_CFI in
kernel.  We should also enforce it in userspace so that no OpenFlow flows
that can generate this wrong match are installed.

But from the failed unit tests like:

dnl [6]
AT_CHECK([ovs-ofctl check-vlan 0000 0fff], [0], [dnl
vlan_tci=0x0000/0x0fff -> 0000/0fff
NXM: NXM_OF_VLAN_TCI_W(0000/0fff) -> 0000/0fff
OXM: OXM_OF_VLAN_VID_W(0000/0fff) -> 0000/0fff,--
OF1.0: 0000/0,00/1 -> 1000/1fff
OF1.1: 0000/0,00/1 -> 1000/1fff
])

It seems that we really want to allow the wildcard of VLAN_CFI.  Is that
true?
Is there any story behind this?

Thanks,
Alex Wang,

On Wed, Jun 3, 2015 at 11:21 PM, Alex Wang <al...@nicira.com> wrote:

> OVS datapath has check which prevents the installation of flow
> that matches VLAN TCI but does not have exact match for VLAN_CFI
> bit.  However, the ovs userspace does not enforce it, so OpenFlow
> flow like "vlan_tci=0x000a/0x0fff,action=output:local" can be added
> to ovs.  Subsequently, the generated megaflow will have match
> field for vlan like "vlan(vid=5/0xfff,pcp=0/0x0,cfi=1/0)".
>
> With the OVS datapath check, the installation of such megaflow
> will be rejected with:
> "|WARN|system@ovs-system: failed to put[create][modify] (Invalid
> argument)"
>
> This commit adds a check in userspace that mark the vlan mask
> invalid if it does not exact match for VLAN_CFI.  So users will
> be asked to provide correct mask.
>
> Reported-by: Ronald Lee <ronald...@vmware.com>
> Signed-off-by: Alex Wang <al...@nicira.com>
> ---
>  lib/meta-flow.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/lib/meta-flow.c b/lib/meta-flow.c
> index 3bdca62..dfebc6c 100644
> --- a/lib/meta-flow.c
> +++ b/lib/meta-flow.c
> @@ -252,7 +252,11 @@ mf_is_mask_valid(const struct mf_field *mf, const
> union mf_value *mask)
>                  is_all_ones(mask, mf->n_bytes));
>
>      case MFM_FULLY:
> -        return true;
> +        if (mf->id == MFF_VLAN_TCI) {
> +            return mask->be16 & htons(VLAN_CFI);
> +        } else {
> +            return true;
> +        }
>      }
>
>      OVS_NOT_REACHED();
> --
> 1.7.9.5
>
>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to