[ovs-dev] [wdp error reporting 5/5] ofproto: Improve OFPT_FLOW_MOD error reporting.

Ben Pfaff blp at nicira.com
Fri Aug 20 17:32:55 UTC 2010


On Mon, Aug 16, 2010 at 06:49:25PM -0700, Justin Pettit wrote:
> On Jul 26, 2010, at 3:44 PM, Ben Pfaff wrote:
> 
> > static inline int
> > -ofp_make_vendor_error(uint8_t vendor, uint16_t type, uint16_t code)
> > +ofp_mkerr_vendor(uint8_t vendor, uint16_t type, uint16_t code)
> > {
> >     return (1 << 30) | (vendor << 26) | (type << 16) | code;
> > }
> > 
> > +/* Returns the OpenFlow vendor error with Nicira as vendor, with the specific
> > + * 'type' and 'code', as an integer. */
> > +static inline int
> > +make_nxerr(uint16_t type, uint16_t code)
> > +{
> > +    return ofp_mkerr_vendor(OFPUTIL_VENDOR_NICIRA, type, code);
> > +}
> 
> This is super minor, but in the first function, you changed "make" to
> "mk", but then introduced a new similar function that uses "make".
> It's a bit inconsistent, but it is only a static function.

Hmm, it's also really weird that I introduced ofp_make_vendor_error() in
one commit and then renamed it in the next.

I folded these ofp-util.h changes into the previous patch, using the
names ofp_mkerr_vendor() and ofp_mkerr_nicira().

> > +     *   - OpenFlow lacks appropriate error types and codes for many
> > +     *     situations.  Feel free to add a new error vendor extension to
> > +     *     nicira-ext.h to handle these situations, either under
> > +     *     OFPUTIL_VENDOR_NICIRA if it seems reasonably generic or with your
> > +     *     own vendor ID otherwise.
> 
> I don't know that we should encourage users to add them under Nicira's
> vendor id, since there could be conflicts with ones that we define.

I changed this to:

     *   - OpenFlow lacks appropriate error types and codes for many
     *     situations.  Feel free to add a new error vendor extension to
     *     nicira-ext.h to handle these situations with your own vendor ID.  If
     *     it is a reasonably generic error and you want to use the Nicira
     *     vendor ID instead of your own, please coordinate with
     *     dev at openvswitch.org.

Thanks,

Ben.




More information about the dev mailing list