[ovs-dev] [PATCH v3 01/41] ofproto: Use ofp14_flow_monitor_flags internally

Ben Pfaff blp at nicira.com
Mon Jun 23 22:11:57 UTC 2014


On Mon, Jun 16, 2014 at 11:29:21AM +0900, Simon Horman wrote:
> Use enum ofp14_flow_monitor_flags in place of enum nx_flow_monitor_flags in
> struct ofputil_flow_monitor_request and struct rule, translating between
> the two enumerations as necessary.
> 
> The motivation for this patch is to move towards
> supporting OpenFlow1.4 flow monitor requests.
> 
> Signed-off-by: Simon Horman <horms at verge.net.au>

GCC does not like this:
    nfmr->flags = htons(nx_from_ofp14_flow_monitor_flags(rq->flags));
giving me the following:
    cc1: warnings being treated as errors
    ../lib/ofp-util.c: In function 'ofputil_append_flow_monitor_request':
    ../lib/ofp-util.c:5299: error: cast from function call of type 'enum nx_flow_monitor_flags' to non-matching type 'short unsigned int'

There are a couple of obvious solutions, but what I suggest is to drop
the distinction between ofp14_flow_monitor_flags and
nx_flow_monitor_flags for now.  That is, let's just keep them
completely in sync by adding an NXFMF_ONLY_OWN so that we don't have
to do any conversions.  In the future, if they diverge, we can add
conversion functions.



More information about the dev mailing list