On Mon, Aug 28, 2017 at 12:47:52PM +0000, Jan Scheurich wrote:
> > -----Original Message-----
> > From: Yi Yang [mailto:yi.y.y...@intel.com]
> > 
> > +static bool
> > +compose_dec_nsh_ttl_action(struct xlate_ctx *ctx) {
> > +    struct flow *flow = &ctx->xin->flow;
> > +
> > +    if ((flow->packet_type == htonl(PT_NSH)) ||
> > +        (flow->dl_type == htons(ETH_TYPE_NSH))) {
> > +        ctx->wc->masks.nsh.ttl = 0xff;
> > +        if (flow->nsh.ttl > 1) {
> > +            flow->nsh.ttl--;
> > +            return false;
> > +        } else {
> > +            execute_controller_action(ctx, UINT16_MAX, OFPR_INVALID_TTL,
> > 0,
> > +                                      NULL, 0);
> > +        }
> > +    }
> > +
> > +    /* Stop processing for current table. */
> > +    xlate_report(ctx, OFT_WARN, "NSH decrement TTL exception");
> > +    return true;
> 
> I see you followed the dec_mpls_ttl implementation here in that you terminate
> translation and drop the packet when trying to decrement TTL of a non-NSH
> packet. This is different from the dec_nw_ttl action, which does nothing when
> executed on a non-IP packet. 
> 
> @Ben: What is the reason for different approaches in OVS?
> 
> @Yi: Why have you opted for the MPLS approach?

I don't recall why these are different.

I don't think the difference is that significant in practice because,
outside of OpenFlow 1.0, OVS only allows an IP TTL decrement action in a
flow matches only IP packets, and similarly for MPLS TTL decrement.

I wouldn't object to making the behavior uniform.
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to