From: Ben Pfaff Date: Fri, 12 Oct 2012 17:15:11 +0000 (-0700) Subject: ofp-errors: Merge OF1.0 "all tables full" with OF1.1+ "table full". X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be2b69d14692718d1569b2b6fd03594be1a0f864;p=openvswitch ofp-errors: Merge OF1.0 "all tables full" with OF1.1+ "table full". 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 Signed-off-by: Ben Pfaff --- diff --git a/include/openflow/nicira-ext.h b/include/openflow/nicira-ext.h index 7e49550f..8e6af529 100644 --- a/include/openflow/nicira-ext.h +++ b/include/openflow/nicira-ext.h @@ -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, diff --git a/lib/ofp-errors.h b/lib/ofp-errors.h index a883e201..ffac8aa4 100644 --- a/lib/ofp-errors.h +++ b/lib/ofp-errors.h @@ -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 */ diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 9003a2d0..2fb2fc87 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -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, diff --git a/tests/ofproto.at b/tests/ofproto.at index 8a728e46..1e5664a1 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -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