ofp-errors: Add OFPET_FLOW_MONITOR_FAILED
authorSimon Horman <horms@verge.net.au>
Tue, 10 Jun 2014 10:27:07 +0000 (19:27 +0900)
committerBen Pfaff <blp@nicira.com>
Fri, 13 Jun 2014 17:57:28 +0000 (10:57 -0700)
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 <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/ofp-errors.h
lib/ofp-util.c
ofproto/connmgr.c
ofproto/ofproto.c

index 169112a..563c75a 100644 (file)
@@ -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 ## */
 /* ## ------------------ ## */
index 9c32c5a..9cd658e 100644 (file)
@@ -5232,7 +5232,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)) {
index 7d313c7..998aee8 100644 (file)
@@ -2022,7 +2022,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);
index b0d5cc8..a05a444 100644 (file)
@@ -4895,7 +4895,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);