ofp-errors: Merge OF1.0 "all tables full" with OF1.1+ "table full".
authorBen Pfaff <blp@nicira.com>
Fri, 12 Oct 2012 17:15:11 +0000 (10:15 -0700)
committerBen Pfaff <blp@nicira.com>
Sun, 14 Oct 2012 01:34:55 +0000 (18:34 -0700)
These codes represent essentially the same condition and only one of them
exists in any given version of OpenFlow, so merge them together into a
single OFPERR_* code.

Reported-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
include/openflow/nicira-ext.h
lib/ofp-errors.h
ofproto/ofproto.c
tests/ofproto.at

index 7e49550..8e6af52 100644 (file)
@@ -129,10 +129,9 @@ enum nx_hash_fields {
  *      table.  If an identical flow already exists in that table only, then it
  *      is replaced.  If the flow cannot be placed in the specified table,
  *      either because the table is full or because the table cannot support
- *      flows of the given type, the switch replies with an
- *      OFPFMFC_ALL_TABLES_FULL error.  (A controller can distinguish these
- *      cases by comparing the current and maximum number of entries reported
- *      in ofp_table_stats.)
+ *      flows of the given type, the switch replies with an OFPFMFC_TABLE_FULL
+ *      error.  (A controller can distinguish these cases by comparing the
+ *      current and maximum number of entries reported in ofp_table_stats.)
  *
  *      If the table ID is wildcarded, the switch picks an appropriate table
  *      itself.  If an identical flow already exist in the selected flow table,
index a883e20..ffac8aa 100644 (file)
@@ -309,10 +309,7 @@ enum ofperr {
     /* OF1.1+(5,0).  Unspecified error. */
     OFPERR_OFPFMFC_UNKNOWN,
 
-    /* OF1.0(3,0).  Flow not added because of full tables. */
-    OFPERR_OFPFMFC_ALL_TABLES_FULL,
-
-    /* OF1.1+(5,1).  Flow not added because table was full. */
+    /* OF1.0(3,0), OF1.1+(5,1).  Flow not added because of full table(s). */
     OFPERR_OFPFMFC_TABLE_FULL,
 
     /* OF1.1+(5,2).  Table does not exist */
index 9003a2d..2fb2fc8 100644 (file)
@@ -2988,7 +2988,7 @@ add_flow(struct ofproto *ofproto, struct ofconn *ofconn,
             rule->evictable = was_evictable;
 
             if (!evict) {
-                error = OFPERR_OFPFMFC_ALL_TABLES_FULL;
+                error = OFPERR_OFPFMFC_TABLE_FULL;
                 goto exit;
             } else if (evict->pending) {
                 error = OFPROTO_POSTPONE;
@@ -3304,7 +3304,7 @@ handle_flow_mod(struct ofconn *ofconn, const struct ofp_header *oh)
          * is not required in OpenFlow 1.0.1 and removed from OpenFlow 1.1.
          * There is no good error code, so just state that the flow table
          * is full. */
-        error = OFPERR_OFPFMFC_ALL_TABLES_FULL;
+        error = OFPERR_OFPFMFC_TABLE_FULL;
     }
     if (!error) {
         error = ofpacts_check(fm.ofpacts, fm.ofpacts_len,
index 8a728e4..1e5664a 100644 (file)
@@ -456,12 +456,12 @@ NXST_FLOW reply:
 # Adding another flow will be refused.
 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
-  [OFPT_ERROR: OFPFMFC_ALL_TABLES_FULL
+  [OFPT_ERROR: OFPFMFC_TABLE_FULL
 ])
 # Also a mod-flow that would add a flow will be refused.
 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
-  [OFPT_ERROR: OFPFMFC_ALL_TABLES_FULL
+  [OFPT_ERROR: OFPFMFC_TABLE_FULL
 ])
 # Replacing or modifying an existing flow is allowed.
 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
@@ -522,7 +522,7 @@ NXST_FLOW reply:
 AT_CHECK([ovs-ofctl add-flow br0 in_port=7,actions=normal])
 AT_CHECK([ovs-ofctl add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
-  [OFPT_ERROR: OFPFMFC_ALL_TABLES_FULL
+  [OFPT_ERROR: OFPFMFC_TABLE_FULL
 ])
 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
  in_port=4 actions=NORMAL