[ovs-dev] [PATCH ovn] ovn-northd: Add the option to configure probe interval

Han Zhou hzhou at ovn.org
Wed Mar 4 20:06:59 UTC 2020


On Wed, Mar 4, 2020 at 12:36 AM <numans at ovn.org> wrote:
>
> From: Numan Siddique <numans at ovn.org>
>
> This patch adds the option 'NB_Global.options:probe_interval' to
> configure the probe interval for the North and South db connections
> from ovn-northd.
>

Just a minor comment here. There are so many probe intervals in the whole
system, e.g. from NB/SB/IC-NB/IC-SB to clients (northd/ovn-controller/ic,
and external CMS clients), from clients to NB/SB/IC-NB/IC-SB. Here this
implementation only configures the probe from northd client to NB/SB. Is it
better to rename it to northd_probe_interval to avoid confusion?

Otherwise:
Acked-by: Han Zhou <hzhou at ovn.org>

> Requested-by: Girish Moodalbail <gmoodalbail at nvidia.com>
> Signed-off-by: Numan Siddique <numans at ovn.org>
> ---
>  northd/ovn-northd.c | 16 ++++++++++++++++
>  ovn-nb.xml          | 13 +++++++++++++
>  2 files changed, 29 insertions(+)
>
> diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
> index 0d43322cf..a3746f7ea 100644
> --- a/northd/ovn-northd.c
> +++ b/northd/ovn-northd.c
> @@ -92,6 +92,10 @@ static bool controller_event_en;
>   * all locally handled, having just one mac is good enough. */
>  static char svc_monitor_mac[ETH_ADDR_STRLEN + 1];
>
> +/* Default probe interval for NB and SB DB connections. */
> +#define DEFAULT_PROBE_INTERVAL_MSEC 5000
> +static int probe_interval = DEFAULT_PROBE_INTERVAL_MSEC;
> +
>  #define MAX_OVN_TAGS 4096
>
>  /* Pipeline stages. */
> @@ -10858,6 +10862,14 @@ ovnnb_db_run(struct northd_context *ctx,
>          smap_destroy(&options);
>      }
>
> +    /* Update the probe interval. */
> +    probe_interval = smap_get_int(&nb->options, "probe_interval",
> +                                  DEFAULT_PROBE_INTERVAL_MSEC);
> +
> +    if (probe_interval > 0 && probe_interval < 1000) {
> +        probe_interval = 1000;
> +    }
> +
>      controller_event_en = smap_get_bool(&nb->options,
>                                          "controller_event", false);
>
> @@ -11818,6 +11830,10 @@ main(int argc, char *argv[])
>              poll_immediate_wake();
>          }
>
> +
> +        ovsdb_idl_set_probe_interval(ovnnb_idl_loop.idl, probe_interval);
> +        ovsdb_idl_set_probe_interval(ovnsb_idl_loop.idl, probe_interval);
> +
>          poll_block();
>          if (should_service_stop()) {
>              exiting = true;
> diff --git a/ovn-nb.xml b/ovn-nb.xml
> index f30cc9ee9..f9b028aa0 100644
> --- a/ovn-nb.xml
> +++ b/ovn-nb.xml
> @@ -134,6 +134,19 @@
>
>        </column>
>
> +      <column name="options" key="probe_interval">
> +        <p>
> +          The inactivity probe interval of the connection to the OVN
Northbound
> +          and Southbound databases, 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>
> +      </column>
> +
>        <group title="Options for configuring interconnection route
advertisement">
>          <p>
>            These options control how routes are advertised between OVN
> --
> 2.24.1
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev


More information about the dev mailing list