[ovs-dev] [PATCH 32/38] ofproto: Use OFPERR_OFPFMFC_TABLE_FULL for OpenFlow 1.1+

Simon Horman horms at verge.net.au
Thu Aug 9 08:49:53 UTC 2012


Use OFPERR_OFPFMFC_ALL_TABLES_FULL in place of
OFPERR_OFPFMFC_TABLE_FULL for OpenFlow 1.1+.

OFPERR_OFPFMFC_ALL_TABLES_FULL only exists in OpenFlow 1.0.
OFPERR_OFPFMFC_TABLE_FULL was added in OpenFlow 1.1.

Signed-off-by: Simon Horman <horms at verge.net.au>

---

v11
* Initial post
---
 ofproto/ofproto.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index ed1617e..faf7e0d 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -3150,7 +3150,17 @@ add_flow(struct ofproto *ofproto, struct ofconn *ofconn,
             rule->evictable = was_evictable;
 
             if (!evict) {
-                error = OFPERR_OFPFMFC_ALL_TABLES_FULL;
+                switch ((enum ofp_version)request->version) {
+                case OFP10_VERSION:
+                    error = OFPERR_OFPFMFC_ALL_TABLES_FULL;
+                    break;
+                case OFP11_VERSION:
+                case OFP12_VERSION:
+                    error =  OFPERR_OFPFMFC_TABLE_FULL;
+                    break;
+                default:
+                    NOT_REACHED();
+                }
                 goto exit;
             } else if (evict->pending) {
                 error = OFPROTO_POSTPONE;
-- 
1.7.10.2.484.gcd07cc5




More information about the dev mailing list