vlib: remove timer when sched node is dispatched by interrupt 74/43474/4
authorDamjan Marion <[email protected]>
Wed, 23 Jul 2025 12:41:16 +0000 (12:41 +0000)
committerAndrew Yourtchenko <[email protected]>
Mon, 28 Jul 2025 09:30:34 +0000 (09:30 +0000)
Type: fix
Change-Id: I48a0da4a3af50101e2d2c1ed3cd8734b7e907f77
Signed-off-by: Damjan Marion <[email protected]>
src/vlib/main.c

index ffa4a69..121d70b 100644 (file)
@@ -1597,6 +1597,8 @@ vlib_main_or_worker_loop (vlib_main_t * vm, int is_main)
                {
                  vlib_node_runtime_t *n;
                  n = vec_elt_at_index (nm->nodes_by_type[nt], int_num);
+                 if (n->stop_timer_handle_plus_1)
+                 vlib_node_unschedule (vm, n->node_index);
                  cpu_time_now = dispatch_node (
                    vm, n, nt,
                    /* frame */ 0, VLIB_NODE_DISPATCH_REASON_INTERRUPT,
@@ -1615,11 +1617,14 @@ vlib_main_or_worker_loop (vlib_main_t * vm, int is_main)
                {
                  vlib_node_runtime_t *nr =
                    vlib_node_get_runtime (vm, n->index);
-                 nr->stop_timer_handle_plus_1 = 0;
-                 cpu_time_now = dispatch_node (
-                   vm, nr, VLIB_NODE_TYPE_SCHED,
-                   /* frame */ 0, VLIB_NODE_DISPATCH_REASON_SCHED,
-                   cpu_time_now);
+                 if (nr->stop_timer_handle_plus_1)
+                 {
+                   nr->stop_timer_handle_plus_1 = 0;
+                   cpu_time_now = dispatch_node (
+                     vm, nr, VLIB_NODE_TYPE_SCHED,
+                     /* frame */ 0, VLIB_NODE_DISPATCH_REASON_SCHED,
+                     cpu_time_now);
+                 }
                }
            }
          vec_reset_length (nm->sched_node_pending);