[ovs-dev] [PATCH 03/17] ofp-util: Allow use of OF12 flow format

Simon Horman horms at verge.net.au
Thu Oct 4 02:41:18 UTC 2012


This enables the use of the OF12 format, the prerequisites of which were
added by "Add OFPUTIL_P_OF12 and NXFF_OPENFLOW12" and patches to fill out
other functions that use OFPUTIL_P_OF12 directly.

Signed-off-by: Simon Horman <horms at verge.net.au>
---
 lib/ofp-util.c |    2 +-
 lib/ofp-util.h |    4 ++--
 tests/learn.at |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 8d9d441..a4ec370 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -724,7 +724,7 @@ ofputil_protocol_to_string(enum ofputil_protocol protocol)
         return "OpenFlow10+table_id";
 
     case OFPUTIL_P_OF12:
-        return NULL;
+        return "OpenFlow12";
     }
 
     /* Check abbreviations. */
diff --git a/lib/ofp-util.h b/lib/ofp-util.h
index c5812c6..9703bff 100644
--- a/lib/ofp-util.h
+++ b/lib/ofp-util.h
@@ -72,10 +72,10 @@ enum ofputil_protocol {
     OFPUTIL_P_OF12      = 1 << 4, /* OpenFlow 1.2 flow format. */
 
     /* All protocols. */
-#define OFPUTIL_P_ANY (OFPUTIL_P_OF10_ANY | OFPUTIL_P_NXM_ANY)
+#define OFPUTIL_P_ANY (OFPUTIL_P_OF10_ANY | OFPUTIL_P_NXM_ANY | OFPUTIL_P_OF12)
 
     /* Protocols in which a specific table may be specified in flow_mods. */
-#define OFPUTIL_P_TID (OFPUTIL_P_OF10_TID | OFPUTIL_P_NXM_TID)
+#define OFPUTIL_P_TID (OFPUTIL_P_OF10_TID | OFPUTIL_P_NXM_TID | OFPUTIL_P_OF12)
 };
 
 /* Protocols to use for flow dumps, from most to least preferred. */
diff --git a/tests/learn.at b/tests/learn.at
index da82f51..b527276 100644
--- a/tests/learn.at
+++ b/tests/learn.at
@@ -24,7 +24,7 @@ table=0 actions=learn(table=1,hard_timeout=10, NXM_OF_VLAN_TCI[0..11],output:NXM
 table=1 priority=0 actions=flood
 ]])
 AT_CHECK([ovs-ofctl parse-flows flows.txt], [0],
-[[usable protocols: OpenFlow10+table_id,NXM+table_id
+[[usable protocols: OpenFlow10+table_id,NXM+table_id,OpenFlow12
 chosen protocol: OpenFlow10+table_id
 OFPT_FLOW_MOD (xid=0x1): ADD table:255 actions=learn(table=1,in_port=99,NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],load:NXM_OF_IN_PORT[]->NXM_NX_REG1[16..31])
 OFPT_FLOW_MOD (xid=0x2): ADD table:255 actions=learn(table=1,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],output:NXM_OF_IN_PORT[])
-- 
1.7.10.4




More information about the dev mailing list