[ovs-dev] [PATCH 4/4] openflow: Support matching and modifying MPLS TTL field.

Ben Pfaff blp at ovn.org
Tue Mar 8 04:47:11 UTC 2016


On Mon, Mar 07, 2016 at 05:38:59PM -0800, Justin Pettit wrote:
> 
> > On Mar 7, 2016, at 11:18 AM, Ben Pfaff <blp at ovn.org> wrote:
> > 
> > +/* Modifies 'match' so that the MPLS TTL is wildcarded. */
> > +void
> > +match_set_any_mpls_ttl(struct match *match, int idx)
> > +{
> > +    match->wc.masks.mpls_lse[idx] &= ~htonl(MPLS_TTL_MASK);
> > +    flow_set_mpls_ttl(&match->flow, idx, 0);
> > +}
> > +
> > +/* Modifies 'match' so that it matches only packets with an MPLS header whose
> > + * TTL equals 'mpls_ttl' */
> > +void
> > +match_set_mpls_ttl(struct match *match, int idx, uint8_t mpls_ttl)
> > +{
> > +    match->wc.masks.mpls_lse[idx] |= htonl(MPLS_TTL_MASK);
> > +    flow_set_mpls_ttl(&match->flow, idx, mpls_ttl);
> > +}
> 
> Do you think it's worth documenting the "idx" arguments for these two functions?

Fixed, thanks.

> > +    /* "mpls_ttl".
> > +     *
> > +     * The outermost MPLS label's time-to-level (TTL) field, or 0 if no MPLS
> 
> Shouldn't that be "time-to-live"?  Or is that how MPLS indicates that it wants to have a serious talk.

Fixed, thanks.

> Acked-by: Justin Pettit <jpettit at ovn.org>

Thanks, I'll rerun the tests and apply this to master in a minute.



More information about the dev mailing list