Add OFPET_FLOW_MONITOR_FAILED which is added in OpenFLow1.4. Map the OFPERR_NXBRC_FM_* errors to the corresponding new OpenFlow errors.
This is a step towards supporting OpenFlow1.4 flow monitors. Signed-off-by: Simon Horman <ho...@verge.net.au> --- v2 * No change --- lib/ofp-errors.h | 47 ++++++++++++++++++++++++++++++++--------------- lib/ofp-util.c | 2 +- ofproto/connmgr.c | 2 +- ofproto/ofproto.c | 2 +- 4 files changed, 35 insertions(+), 18 deletions(-) diff --git a/lib/ofp-errors.h b/lib/ofp-errors.h index 169112a..563c75a 100644 --- a/lib/ofp-errors.h +++ b/lib/ofp-errors.h @@ -156,21 +156,6 @@ enum ofperr { * is not valid. */ OFPERR_NXBRC_BAD_REASON, - /* NX1.0-1.1(1,517), NX1.2+(6). The 'id' in an NXST_FLOW_MONITOR request - * is the same as an existing monitor id (or two monitors in the same - * NXST_FLOW_MONITOR request have the same 'id'). */ - OFPERR_NXBRC_FM_DUPLICATE_ID, - - /* NX1.0-1.1(1,518), NX1.2+(7). The 'flags' in an NXST_FLOW_MONITOR - * request either does not specify at least one of the NXFMF_ADD, - * NXFMF_DELETE, or NXFMF_MODIFY flags, or specifies a flag bit that is not - * defined. */ - OFPERR_NXBRC_FM_BAD_FLAGS, - - /* NX1.0-1.1(1,519), NX1.2+(8). The 'id' in an NXT_FLOW_MONITOR_CANCEL - * request is not the id of any existing monitor. */ - OFPERR_NXBRC_FM_BAD_ID, - /* NX1.0-1.1(1,520), NX1.2+(9). The 'event' in an NXST_FLOW_MONITOR reply * does not specify one of the NXFME_ABBREV, NXFME_ADD, NXFME_DELETE, or * NXFME_MODIFY. */ @@ -637,6 +622,38 @@ enum ofperr { /* OF1.4+(17,15). Bundle is locking the resource. */ OFPERR_OFPBFC_BUNDLE_IN_PROGRESS, +/* ## ------------------------- ## */ +/* ## OFPET_FLOW_MONITOR_FAILED ## */ +/* ## ------------------------- ## */ + + /* OF1.4+(16,0). Unspecified error. */ + OFPERR_OFPMOFC_UNKNOWN, + + /* NX1.0-1.1(1,517), NX1.2-1.3(6), OF1.4+(16,1). Monitor not added + * because a Monitor ADD attempted to replace an existing Monitor. */ + OFPERR_OFPMOFC_MONITOR_EXISTS, + + /* OF1.4+(16,2). Monitor not added because + * Monitor specified is invalid. */ + OFPERR_OFPMOFC_INVALID_MONITOR, + + /* NX1.0-1.1(1,519), NX1.2-1.3(8), OF1.4+(16,3). Monitor not modified + * because a Monitor MODIFY attempted to modify a non-existent Monitor. */ + OFPERR_OFPMOFC_UNKNOWN_MONITOR, + + /* OF1.4+(16,4). Unsupported or unknown command. */ + OFPERR_OFPMOFC_BAD_COMMAND, + + /* NX1.0-1.1(1,518), NX1.2-1.3(7), OF1.4+(16,5). Flag configuration + * unsupported. */ + OFPERR_OFPMOFC_BAD_FLAGS, + + /* OF1.4+(16,6). Specified table does not exist. */ + OFPERR_OFPMOFC_BAD_TABLE_ID, + + /* OF1.4+(16,7). Error in output port/group. */ + OFPERR_OFPMOFC_BAD_OUT, + /* ## ------------------ ## */ /* ## OFPET_EXPERIMENTER ## */ /* ## ------------------ ## */ diff --git a/lib/ofp-util.c b/lib/ofp-util.c index bcefc9a..181a464 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -5262,7 +5262,7 @@ ofputil_decode_flow_monitor_request(struct ofputil_flow_monitor_request *rq, | NXFMF_MODIFY | NXFMF_ACTIONS | NXFMF_OWN)) { VLOG_WARN_RL(&bad_ofmsg_rl, "NXST_FLOW_MONITOR has bad flags %#"PRIx16, flags); - return OFPERR_NXBRC_FM_BAD_FLAGS; + return OFPERR_OFPMOFC_BAD_FLAGS; } if (!is_all_zeros(nfmr->zeros, sizeof nfmr->zeros)) { diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c index 9561c45..317e3f4 100644 --- a/ofproto/connmgr.c +++ b/ofproto/connmgr.c @@ -2101,7 +2101,7 @@ ofmonitor_create(const struct ofputil_flow_monitor_request *request, m = ofmonitor_lookup(ofconn, request->id); if (m) { - return OFPERR_NXBRC_FM_DUPLICATE_ID; + return OFPERR_OFPMOFC_MONITOR_EXISTS; } m = xmalloc(sizeof *m); diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 648d2dc..8d37980 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -4984,7 +4984,7 @@ handle_flow_monitor_cancel(struct ofconn *ofconn, const struct ofp_header *oh) ofmonitor_destroy(m); error = 0; } else { - error = OFPERR_NXBRC_FM_BAD_ID; + error = OFPERR_OFPMOFC_UNKNOWN_MONITOR; } ovs_mutex_unlock(&ofproto_mutex); -- 2.0.0.rc2 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev