Message ID | 20201202153111.19937.15995.stgit@dceara.remote.csb |
---|---|
State | Accepted |
Headers | show |
Series | ovn-controller: Fix nb_cfg update with changes in flight. | expand |
On Wed, Dec 2, 2020 at 7:31 AM Dumitru Ceara <dceara@redhat.com> wrote: > > Fixes: ca278d98a4f5 ("ovn-controller: Initial use of incremental > Signed-off-by: Dumitru Ceara <dceara@redhat.com> > --- > controller/ofctrl.c | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > > diff --git a/controller/ofctrl.c b/controller/ofctrl.c > index c1bbc58..a1ac695 100644 > --- a/controller/ofctrl.c > +++ b/controller/ofctrl.c > @@ -2032,19 +2032,23 @@ ofctrl_put(struct ovn_desired_flow_table *flow_table, > bool need_put = false; > if (flow_changed || skipped_last_time || need_reinstall_flows) { > need_put = true; > + old_nb_cfg = nb_cfg; > } else if (nb_cfg != old_nb_cfg) { > /* nb_cfg changed since last ofctrl_put() call */ > if (cur_cfg == old_nb_cfg) { > - /* we were up-to-date already, so just update with the > - * new nb_cfg */ > - cur_cfg = nb_cfg; > + /* If there are no updates pending, we were up-to-date already, > + * update with the new nb_cfg. > + */ > + if (ovs_list_is_empty(&flow_updates)) { > + cur_cfg = nb_cfg; > + old_nb_cfg = nb_cfg; > + } > } else { > need_put = true; > + old_nb_cfg = nb_cfg; > } > } > > - old_nb_cfg = nb_cfg; > - > if (!need_put) { > VLOG_DBG("ofctrl_put not needed"); > return; > Thanks! I applied this to master.
diff --git a/controller/ofctrl.c b/controller/ofctrl.c index c1bbc58..a1ac695 100644 --- a/controller/ofctrl.c +++ b/controller/ofctrl.c @@ -2032,19 +2032,23 @@ ofctrl_put(struct ovn_desired_flow_table *flow_table, bool need_put = false; if (flow_changed || skipped_last_time || need_reinstall_flows) { need_put = true; + old_nb_cfg = nb_cfg; } else if (nb_cfg != old_nb_cfg) { /* nb_cfg changed since last ofctrl_put() call */ if (cur_cfg == old_nb_cfg) { - /* we were up-to-date already, so just update with the - * new nb_cfg */ - cur_cfg = nb_cfg; + /* If there are no updates pending, we were up-to-date already, + * update with the new nb_cfg. + */ + if (ovs_list_is_empty(&flow_updates)) { + cur_cfg = nb_cfg; + old_nb_cfg = nb_cfg; + } } else { need_put = true; + old_nb_cfg = nb_cfg; } } - old_nb_cfg = nb_cfg; - if (!need_put) { VLOG_DBG("ofctrl_put not needed"); return;
Fixes: ca278d98a4f5 ("ovn-controller: Initial use of incremental Signed-off-by: Dumitru Ceara <dceara@redhat.com> --- controller/ofctrl.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)