summaryrefslogtreecommitdiff
path: root/ofproto/ofproto.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2018-10-26 15:53:55 -0700
committerBen Pfaff <blp@ovn.org>2019-02-05 13:44:07 -0800
commitc66be90bd9a04bc98e8ef32f684a3d7283379f66 (patch)
tree6bbc24147a6a55c55ce5cf6a8aceeaa9123ed743 /ofproto/ofproto.c
parent29718ad49d61e1ab32d23d27225ec7368f1824bb (diff)
downloadopenvswitch-c66be90bd9a04bc98e8ef32f684a3d7283379f66.tar.gz
vswitchd: Allow user to configure controllers as "primary" or "service".
Normally it makes sense for an active connection to be primary and a passive connection to be a service connection, but I've run into a corner case where it is better for a passive connection to be a primary connection. This specific case is for use with OFtest, which expects to be a primary controller. However, it also wants to reconnect frequently, which is slow for active connections because of the backoff; by configuring a passive, primary controller, OFtest can reconnect as frequently and as quickly as it wants, making the overall test much faster. Acked-by: Justin Pettit <jpettit@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto/ofproto.c')
-rw-r--r--ofproto/ofproto.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index c0bc46a35..a248e149f 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -1894,6 +1894,12 @@ ofproto_free_ofproto_controller_info(struct shash *info)
connmgr_free_controller_info(info);
}
+const char *
+ofconn_type_to_string(enum ofconn_type type)
+{
+ return type == OFCONN_PRIMARY ? "primary" : "service";
+}
+
/* Makes a deep copy of 'old' into 'port'. */
void
ofproto_port_clone(struct ofproto_port *port, const struct ofproto_port *old)