[ovs-dev] [PATCH 24/24] Local Hack: Allow Open Flow 1.2 session to be negotiated
Simon Horman
horms at verge.net.au
Mon Jul 23 06:16:53 UTC 2012
* request OFP12_VERSION
* Reset ofconn to OF1.2
* Allow OF1.2 to be used as a dump protocol
Conflicts:
lib/vconn.c
---
lib/ofp-util.c | 1 +
lib/vconn.c | 12 ++++++------
ofproto/connmgr.c | 2 +-
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index a4b2f94..5d67ff8 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -620,6 +620,7 @@ static const struct proto_abbrev proto_abbrevs[] = {
#define N_PROTO_ABBREVS ARRAY_SIZE(proto_abbrevs)
enum ofputil_protocol ofputil_flow_dump_protocols[] = {
+ OFPUTIL_P_OF12,
OFPUTIL_P_NXM,
OFPUTIL_P_OF10,
};
diff --git a/lib/vconn.c b/lib/vconn.c
index 2dd4710..3161086 100644
--- a/lib/vconn.c
+++ b/lib/vconn.c
@@ -215,7 +215,7 @@ vconn_verify_name(const char *name)
*
* The vconn will automatically negotiate an OpenFlow protocol version
* acceptable to both peers on the connection. The version negotiated will be
- * no lower than 'min_version' and no higher than OFP10_VERSION.
+ * no lower than 'min_version' and no higher than OFP12_VERSION.
*
* Returns 0 if successful, otherwise a positive errno value. If successful,
* stores a pointer to the new connection in '*vconnp', otherwise a null
@@ -386,7 +386,7 @@ vcs_send_hello(struct vconn *vconn)
struct ofpbuf *b;
int retval;
- b = ofpraw_alloc(OFPRAW_OFPT_HELLO, OFP10_VERSION, 0);
+ b = ofpraw_alloc(OFPRAW_OFPT_HELLO, OFP12_VERSION, 0);
retval = do_send(vconn, b);
if (!retval) {
vconn->state = VCS_RECV_HELLO;
@@ -421,13 +421,13 @@ vcs_recv_hello(struct vconn *vconn)
ds_destroy(&msg);
}
- vconn->version = MIN(OFP10_VERSION, oh->version);
+ vconn->version = MIN(OFP12_VERSION, oh->version);
if (vconn->version < vconn->min_version) {
VLOG_WARN_RL(&bad_ofmsg_rl,
"%s: version negotiation failed: we support "
"versions 0x%02x to 0x%02x inclusive but peer "
"supports no later than version 0x%02"PRIx8,
- vconn->name, vconn->min_version, OFP10_VERSION,
+ vconn->name, vconn->min_version, OFP12_VERSION,
oh->version);
vconn->state = VCS_SEND_ERROR;
} else {
@@ -435,7 +435,7 @@ vcs_recv_hello(struct vconn *vconn)
"(we support versions 0x%02x to 0x%02x inclusive, "
"peer no later than version 0x%02"PRIx8")",
vconn->name, vconn->version, vconn->min_version,
- OFP10_VERSION, oh->version);
+ OFP12_VERSION, oh->version);
vconn->state = VCS_CONNECTED;
}
ofpbuf_delete(b);
@@ -957,7 +957,7 @@ pvconn_close(struct pvconn *pvconn)
*
* The new vconn will automatically negotiate an OpenFlow protocol version
* acceptable to both peers on the connection. The version negotiated will be
- * no lower than 'min_version' and no higher than OFP10_VERSION.
+ * no lower than 'min_version' and no higher than OFP12_VERSION.
*
* pvconn_accept() will not block waiting for a connection. If no connection
* is ready to be accepted, it returns EAGAIN immediately. */
diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c
index 1f0b6b0..99999bf 100644
--- a/ofproto/connmgr.c
+++ b/ofproto/connmgr.c
@@ -1030,7 +1030,7 @@ ofconn_flush(struct ofconn *ofconn)
int i;
ofconn->role = NX_ROLE_OTHER;
- ofconn->protocol = OFPUTIL_P_OF10;
+ ofconn->protocol = OFPUTIL_P_OF12;
ofconn->packet_in_format = NXPIF_OPENFLOW10;
/* Disassociate 'ofconn' from all of the ofopgroups that it initiated that
--
1.7.10.2.484.gcd07cc5
More information about the dev
mailing list