Skip to content

Commit

Permalink
controller-vtep: add support to configure inactivity probe interval
Browse files Browse the repository at this point in the history
This patch adds new configuration option for ovn-controller-vtep service
to supply OVSDB (only OVN_Southbound DB) probe interval value.

It can be configured through Hardware_Vtep database, Global table, column
other_config:ovn-remote-probe-interval.

Signed-off-by: Vladislav Odintsov <odivlad@gmail.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
odivlad authored and numansiddique committed Mar 23, 2023
1 parent 3d53fb2 commit 79640dc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
14 changes: 14 additions & 0 deletions controller-vtep/ovn-controller-vtep.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,20 @@
connected <code>hardware_vtep</code> database changes.
The default value is considered false if this option is not defined.
</dd>

<dt><code>other_config:ovn-remote-probe-interval</code></dt>
<dd>
<p>
The inactivity probe interval of the connection to the OVN Southbound
database, in milliseconds. If the value is zero, it disables the
connection keepalive feature.
</p>

<p>
If the value is nonzero, then it will be forced to a value of at
least 1000 ms.
</p>
</dd>
</dl>
</p>
</manpage>
17 changes: 17 additions & 0 deletions controller-vtep/ovn-controller-vtep.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "openvswitch/poll-loop.h"
#include "simap.h"
#include "ovsdb-idl.h"
#include "smap.h"
#include "stream.h"
#include "stream-ssl.h"
#include "unixctl.h"
Expand Down Expand Up @@ -88,6 +89,20 @@ check_northd_version(struct ovsdb_idl *vtep_idl, struct ovsdb_idl *ovnsb_idl,
return true;
}

/* Set probe interval, based on user configuration and the remote. */
static void
update_idl_probe_interval(struct ovsdb_idl *ovn_sb_idl,
struct ovsdb_idl *vtep_idl)
{
const struct vteprec_global *cfg = vteprec_global_first(vtep_idl);
int interval = -1;
if (cfg) {
interval = smap_get_int(&cfg->other_config,
"ovn-remote-probe-interval", interval);
}
set_idl_probe_interval(ovn_sb_idl, ovnsb_remote, interval);
}

int
main(int argc, char *argv[])
{
Expand Down Expand Up @@ -179,6 +194,8 @@ main(int argc, char *argv[])
simap_destroy(&usage);
}

update_idl_probe_interval(ovnsb_idl_loop.idl, vtep_idl_loop.idl);

if (ovsdb_idl_has_ever_connected(ovnsb_idl_loop.idl) &&
ovsdb_idl_has_ever_connected(vtep_idl_loop.idl) &&
check_northd_version(vtep_idl_loop.idl, ovnsb_idl_loop.idl,
Expand Down

0 comments on commit 79640dc

Please sign in to comment.