On 2/1/24 04:42, Huangzhidong via discuss wrote:
> Hi
> 
> When I use bond/show to get next balance time, it sometimes get a negative 
> value.
> 
> It can easily reproduce by run shell scripts:
> 
> while true; do
> ovs-appctl bond/show | grep next
> done
> 
> and it can be easily fixed by:
> 
> ofproto/bond.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/ofproto/bond.c b/ofproto/bond.c
> index cfdf44f85..384ffdb08 100644
> --- a/ofproto/bond.c
> +++ b/ofproto/bond.c
> @@ -1539,7 +1539,7 @@ bond_print_details(struct ds *ds, const struct bond 
> *bond)
>      if (bond_is_balanced(bond)) {
>          ds_put_format(ds, "next rebalance: %lld ms\n",
> -                      bond->next_rebalance - time_msec());
> +                    (bond->next_rebalance + bond->rebalance_interval - 
> time_msec()) % bond->rebalance_interval);
>      }
>      ds_put_format(ds, "lacp_status: %s\n",

Hi,

My understanding is that we print out negative value because rebalancing
is already overdue, i.e. we should have been rebalanced X ms ago.  And
that indicates that rebalancing will be performed as soon as possible.
Your suggested change will make the value positive, but it will no longer
be correct in this case.  We could print out a zero, I guess, instead of
a negative value, but, I think, the negative value is somewhat useful,
because we can tell how far behind OVS is on the rebalancing.

Does that make sense?

Best regards, Ilya Maximets.
_______________________________________________
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Reply via email to