diff mbox series

[ovs-dev,v2] pinctrl: fix restart of controller when bfd min_tx set to 1

Message ID 20230420092327.115565-1-wangchuanlei@inspur.com
State Changes Requested
Headers show
Series [ovs-dev,v2] pinctrl: fix restart of controller when bfd min_tx set to 1 | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

wangchuanlei April 20, 2023, 9:23 a.m. UTC
Signed-off-by: wangchuanlei <wangchuanlei@inspur.com>
---
 controller/pinctrl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ales Musil April 20, 2023, 12:04 p.m. UTC | #1
On Thu, Apr 20, 2023 at 11:23 AM wangchuanlei <wangchuanlei@inspur.com>
wrote:

> Signed-off-by: wangchuanlei <wangchuanlei@inspur.com>
> ---
>  controller/pinctrl.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/controller/pinctrl.c b/controller/pinctrl.c
> index 795847729..97a5e392f 100644
> --- a/controller/pinctrl.c
> +++ b/controller/pinctrl.c
> @@ -7190,7 +7190,9 @@ bfd_monitor_send_msg(struct rconn *swconn, long long
> int *bfd_time)
>          pinctrl_send_bfd_tx_msg(swconn, entry, false);
>
>          tx_timeout = MAX(entry->local_min_tx, entry->remote_min_rx);
> -        tx_timeout -= random_range((tx_timeout * 25) / 100);
> +        if (tx_timeout >= 4) {
> +            tx_timeout -= random_range(tx_timeout / 4);
> +        }
>          entry->next_tx = cur_time + tx_timeout;
>  next:
>          if (*bfd_time > entry->next_tx) {
> --
> 2.27.0
>
>
Looks good to me, thanks.

Acked-by: Ales Musil <amusil@redhat.com>
Simon Horman April 24, 2023, 10:39 a.m. UTC | #2
On Thu, Apr 20, 2023 at 05:23:27AM -0400, wangchuanlei wrote:

Hi,

It might be useful to have some explanation of why this change is
being made.

> Signed-off-by: wangchuanlei <wangchuanlei@inspur.com>

...
diff mbox series

Patch

diff --git a/controller/pinctrl.c b/controller/pinctrl.c
index 795847729..97a5e392f 100644
--- a/controller/pinctrl.c
+++ b/controller/pinctrl.c
@@ -7190,7 +7190,9 @@  bfd_monitor_send_msg(struct rconn *swconn, long long int *bfd_time)
         pinctrl_send_bfd_tx_msg(swconn, entry, false);
 
         tx_timeout = MAX(entry->local_min_tx, entry->remote_min_rx);
-        tx_timeout -= random_range((tx_timeout * 25) / 100);
+        if (tx_timeout >= 4) {
+            tx_timeout -= random_range(tx_timeout / 4);
+        }
         entry->next_tx = cur_time + tx_timeout;
 next:
         if (*bfd_time > entry->next_tx) {