The current way of calculating "next_rebalance" when there is a change
in the bond rebalance period applies the current rebalance interval
(again) and substracts the new one.

This yields an unexpected new value for "next_rebalance": say the
current interval is 60s and we reduce it to 10s (and rebalancing has
just occurred), the current logic will set the next rebalancing in 110s
which is probably not what the user expects.

Swap current and new rebalance intervals in the offset calculation
logic.

Fixes: 9a2169a3f7bb ("bond: Do not flag a revalidation when adjusting time.")
Reported-by: Minxi Hou <[email protected]>
Signed-off-by: Adrian Moreno <[email protected]>
---
 ofproto/bond.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ofproto/bond.c b/ofproto/bond.c
index 584c38f07..ef481a360 100644
--- a/ofproto/bond.c
+++ b/ofproto/bond.c
@@ -468,9 +468,9 @@ bond_reconfigure(struct bond *bond, const struct 
bond_settings *s)
              * we can skip triggering the rest of the port reconfiguration. */
             if (bond->next_rebalance) {
                 long long int old_start_time =
-                    bond->next_rebalance - s->rebalance_interval;
+                    bond->next_rebalance - bond->rebalance_interval;
                 bond->next_rebalance =
-                    old_start_time + bond->rebalance_interval;
+                    old_start_time + s->rebalance_interval;
             }
         } else {
             /* When the bond is doing a disable/enable of the rebalance
-- 
2.52.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to