[ovs-dev] [PATCH 04/18] connmgr: Paramatise ofservice_create() over allowed OpenFlow versions

Simon Horman horms at verge.net.au
Fri Oct 26 02:35:52 UTC 2012


This is in preparation for allowing configuration of the
allowed OpenFlow versions.

Signed-off-by: Simon Horman <horms at verge.net.au>
---
 ofproto/connmgr.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c
index f1e6487..b3c94db 100644
--- a/ofproto/connmgr.c
+++ b/ofproto/connmgr.c
@@ -137,7 +137,8 @@ struct ofservice {
 
 static void ofservice_reconfigure(struct ofservice *,
                                   const struct ofproto_controller *);
-static int ofservice_create(struct connmgr *, const char *target, uint8_t dscp);
+static int ofservice_create(struct connmgr *mgr, const char *target,
+                            uint32_t allowed_versions, uint8_t dscp);
 static void ofservice_destroy(struct connmgr *, struct ofservice *);
 static struct ofservice *ofservice_lookup(struct connmgr *,
                                           const char *target);
@@ -513,7 +514,9 @@ connmgr_set_controllers(struct connmgr *mgr,
             if (!ofservice_lookup(mgr, c->target)) {
                 VLOG_INFO("%s: added service controller \"%s\"",
                           mgr->name, c->target);
-                ofservice_create(mgr, c->target, c->dscp);
+                ofservice_create(mgr, c->target,
+                                 ofputil_get_allowed_versions_default(),
+                                 c->dscp);
             }
         } else {
             VLOG_WARN_RL(&rl, "%s: unsupported controller \"%s\"",
@@ -1619,14 +1622,14 @@ connmgr_flushed(struct connmgr *mgr)
  * ofservice_reconfigure() must be called to fully configure the new
  * ofservice. */
 static int
-ofservice_create(struct connmgr *mgr, const char *target, uint8_t dscp)
+ofservice_create(struct connmgr *mgr, const char *target,
+                 uint32_t allowed_versions, uint8_t dscp)
 {
     struct ofservice *ofservice;
     struct pvconn *pvconn;
     int error;
 
-    error = pvconn_open(target, ofputil_get_allowed_versions_default(),
-                        &pvconn, dscp);
+    error = pvconn_open(target, allowed_versions, &pvconn, dscp);
     if (error) {
         return error;
     }
-- 
1.7.10.4




More information about the dev mailing list