On Thu, Aug 07, 2014 at 04:11:23PM -0700, Jarno Rajahalme wrote:
> Acked-by: Jarno Rajahalme <jrajaha...@nicira.com>

Thanks!

> > --- a/lib/ofp-actions.c
> > +++ b/lib/ofp-actions.c
> > @@ -1646,6 +1646,72 @@ OVS_INSTRUCTIONS
> >     }
> > }
> > 
> > +struct ovsinst_xlate {
> > +    enum ovs_instruction_type ovsinst;
> > +    int ofpit;
> > +};
> 
> It would be nice to have comment on the latter ref. OpenFlow
> specs. I?m not so bothered about ?xlate? this time :-)

I decided to s/xlate/map/ here too for consistency.

I added comments:

/* Two-way translation between OVS's internal "OVSINST_*" representation of
 * instructions and the "OFPIT_*" representation used in OpenFlow. */
struct ovsinst_map {
    enum ovs_instruction_type ovsinst; /* Internal name for instruction. */
    int ofpit;                         /* OFPIT_* number from OpenFlow spec. */
};

> > +/* Converts 'ofpit_bitmap', a bitmap of instructions from an OpenFlow 
> > message
> > + * with the given 'version' (OFP11_VERSION or later) into a bitmap whose 
> > bits
> > + * correspond to OVSINST_* values, and returns the result. */
> > +uint32_t
> > +ovsinst_bitmap_from_openflow(ovs_be32 ofpit_bitmap, enum ofp_version 
> > version)
> > +{
> > +    uint32_t ovsinst_bitmap = 0;
> > +    const struct ovsinst_xlate *x;
> > +
> > +    for (x = get_ovsinst_xlate(version); x->ofpit >= 0; x++) {
> > +        if (ofpit_bitmap & htonl(1u << x->ofpit)) {
> 
> Maybe ntohl(ofpit_bitmap) once before the loop?

OK, done.

> > +            ovsinst_bitmap |= 1u << x->ovsinst;
> > +        }
> > +    }
> > +    return ovsinst_bitmap;
> > +}
> > +
> > static inline struct ofp11_instruction *
> > instruction_next(const struct ofp11_instruction *inst)
> > {

I'll rerun the tests and then apply to master.  Thanks again!
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to