[ovs-dev] [PATCH 4/4] User-Space MPLS actions and matches

Simon Horman horms at verge.net.au
Wed Oct 10 10:28:49 UTC 2012


On Wed, Oct 10, 2012 at 12:16:15PM +0900, Isaku Yamahata wrote:
> On Tue, Oct 09, 2012 at 04:08:35PM +0900, Simon Horman wrote:
> > @@ -938,6 +990,15 @@ mf_is_value_valid(const struct mf_field *mf, const union mf_value *value)
> >      case MFF_IPV6_LABEL:
> >          return !(value->be32 & ~htonl(IPV6_LABEL_MASK));
> >  
> > +    case MFF_MPLS_LABEL:
> > +        return !(value->be32 & ~htonl(MPLS_LABEL_MASK >> MPLS_LABEL_SHIFT));
> > +
> > +    case MFF_MPLS_TC:
> > +        return !(value->u8 & ~7);
> > +
> > +    case MFF_MPLS_BOS:
> > +        return !(value->u8 & ~1);
> > +
> 
> Minor nitpick. MPLS_xxx_MASK >> MPLS_xxx_SHIFT.
> 
> > @@ -1794,6 +1906,18 @@ mf_random_value(const struct mf_field *mf, union mf_value *value)
> >          value->u8 &= 0x07;
> >          break;
> >  
> > +    case MFF_MPLS_LABEL:
> > +        value->be32 &= htonl(MPLS_LABEL_MASK >> MPLS_LABEL_SHIFT);
> > +        break;
> > +
> > +    case MFF_MPLS_TC:
> > +        value->u8 &= 0x07;
> > +        break;
> > +
> > +    case MFF_MPLS_BOS:
> > +        value->u8 &= 0x01;
> > +        break;
> > +
> 
> ditto.

Thanks, I will fix those.



More information about the dev mailing list