[ovs-discuss] [ovn] non-maskable OVS meta-flow fields not correctly handled
blp at ovn.org
Thu Nov 5 16:00:43 UTC 2020
On Thu, Nov 05, 2020 at 12:39:38PM +0000, ythomas1.ext at orange.com wrote:
> I’m currently working on OVN to add MPLS logical fields (such as
> 'mpls_label', 'mpls_bos') to support BGP/MPLS technology.
> As indicated in 'mf_field' struct in meta-flow.h, most OVS meta-flow
> fields have n_bytes * 8 == n_bits size but there are few exceptions
> such as 'mpls_label', 'mpls_bos', etc…
> In OVN case, when calling 'mf_mask_subfield' method from meta-flow.c,
> for example for 'mpls_label' OVS meta-flow field which has 20 useful
> bits over 32 bits, the 'mask' value parsed in OVN is set to 0xffff00ff
> (which seems correct).
OVN doesn't use that function much. I see one use in constrain_match().
I don't understand where 0xffff00ff comes from. The mask should not be
discontiguous like that.
> The problem is that in 'mf_set' method, 'mpls_label' OVS meta-flow
> field is supposed to only have a NULL, all-1-bits or all-0-bits 'mask'
> value to be set, as shown below:
> However, as mentioned in 'mf_set' method comment, “The caller is
> responsible for ensuring that 'match' meets 'mf''s prerequisites”.
> So, since the 'mpls_label' OVS meta-flow field is indicated as not
> maskable in meta-flow.h, shouldn't OVN ensure that 'mask' is set to
> NULL when calling 'mf_mask_subfield' ?
The mask isn't a prerequisite. The prerequisite for mpls_label is that
the flow is an MPLS flow, that is, it has an MPLS ethertype. See
More information about the discuss