When Service_Monitor state was updated by pinctrl, there was
no immediate check whether the status could be updated, and no wakeup.
The status (e.g. if n_success_count = 1 or f_failure_count = 1)
was only updated next time pinctrl thread woke up, for any other reason.

Signed-off-by: Xavier Simonart <[email protected]>
---
 controller/pinctrl.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/controller/pinctrl.c b/controller/pinctrl.c
index 3353bdfdf..84a1375b2 100644
--- a/controller/pinctrl.c
+++ b/controller/pinctrl.c
@@ -8126,21 +8126,24 @@ svc_monitors_run(struct rconn *swconn,
 
         case SVC_MON_S_WAITING:
             if (current_time >= svc_mon->wait_time) {
+                svc_mon->next_send_time = current_time + svc_mon->interval;
+                next_run_time = svc_mon->next_send_time;
                 if (svc_mon->protocol ==  SVC_MON_PROTO_UDP) {
                     svc_mon->n_success++;
                     svc_mon->state = SVC_MON_S_ONLINE;
+                    goto online;
                 } else {
                     svc_mon->n_failures++;
                     svc_mon->state = SVC_MON_S_OFFLINE;
+                    goto offline;
                 }
-                svc_mon->next_send_time = current_time + svc_mon->interval;
-                next_run_time = svc_mon->next_send_time;
             } else {
                 next_run_time = svc_mon->wait_time;
             }
             break;
 
         case SVC_MON_S_ONLINE:
+            online:
             if (svc_mon->n_success >= svc_mon->success_count) {
                 svc_mon->status = SVC_MON_ST_ONLINE;
                 svc_mon->n_success = 0;
@@ -8156,6 +8159,7 @@ svc_monitors_run(struct rconn *swconn,
             break;
 
         case SVC_MON_S_OFFLINE:
+            offline:
             if (svc_mon->n_failures >= svc_mon->failure_count) {
                 svc_mon->status = SVC_MON_ST_OFFLINE;
                 svc_mon->n_success = 0;
-- 
2.47.1

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

Reply via email to