Message ID | 20230427062558.1812487-1-wangchuanlei@inspur.com |
---|---|
State | Accepted |
Headers | show |
Series | [ovs-dev,v3] pinctrl: fix restart of controller when bfd min_tx set to 1 | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | success | apply and check: success |
ovsrobot/github-robot-_Build_and_Test | fail | github build: failed |
ovsrobot/github-robot-_ovn-kubernetes | fail | github build: failed |
Thanks! I added Ales's ack from v2 and pushed this change to main and all branches back to 22.03. I changed the subject line to: "fix restart of controller when bfd min_tx is too low." I changed it since the problem happens when min_tx is <= 4, not just 1. On 4/27/23 02:25, wangchuanlei wrote: > Avoid the number zero to be divisor > > Signed-off-by: wangchuanlei <wangchuanlei@inspur.com> > --- > > v3: > add explanation for this commit > > v2: > modify code > > 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) {
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) {
Avoid the number zero to be divisor Signed-off-by: wangchuanlei <wangchuanlei@inspur.com> --- v3: add explanation for this commit v2: modify code controller/pinctrl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)