summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorMaxime Peim <mpeim@cisco.com>2021-04-15 13:52:12 +0200
committerFlorin Coras <florin.coras@gmail.com>2021-05-05 14:17:54 +0000
commitdde163d96f5051582e2e5b88b9c78169a827370c (patch)
tree71535de1758331ade1378ba50e378330c5d3caf9 /src/vlib
parent9d91e0271f416819f8a6d712d5475593ea37d794 (diff)
vlib: fix adaptive mode flag unset on nodes reforking
The adaptive mode flag is being unset on nodes reforking. The flag is copied in order to avoid this issue. Old flags are copied for all nodes. Type: fix Signed-off-by: Maxime Peim <mpeim@cisco.com> Change-Id: Ic29b20fc0e4454ce4b3765c478f55bf650b4572a
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/threads.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vlib/threads.c b/src/vlib/threads.c
index c65460e3234..7c796f5d0ea 100644
--- a/src/vlib/threads.c
+++ b/src/vlib/threads.c
@@ -1101,6 +1101,7 @@ vlib_worker_thread_node_refork (void)
/* keep previous node state */
new_n_clone->state = old_n_clone->state;
+ new_n_clone->flags = old_n_clone->flags;
}
vec_add1 (nm_clone->nodes, new_n_clone);
new_n_clone++;
@@ -1132,6 +1133,7 @@ vlib_worker_thread_node_refork (void)
{
rt = vlib_node_get_runtime (vm_clone, old_rt[j].node_index);
rt->state = old_rt[j].state;
+ rt->flags = old_rt[j].flags;
clib_memcpy_fast (rt->runtime_data, old_rt[j].runtime_data,
VLIB_NODE_RUNTIME_DATA_SIZE);
}
@@ -1162,6 +1164,7 @@ vlib_worker_thread_node_refork (void)
{
rt = vlib_node_get_runtime (vm_clone, old_rt[j].node_index);
rt->state = old_rt[j].state;
+ rt->flags = old_rt[j].flags;
clib_memcpy_fast (rt->runtime_data, old_rt[j].runtime_data,
VLIB_NODE_RUNTIME_DATA_SIZE);
}
@@ -1189,6 +1192,7 @@ vlib_worker_thread_node_refork (void)
{
rt = vlib_node_get_runtime (vm_clone, old_rt[j].node_index);
rt->state = old_rt[j].state;
+ rt->flags = old_rt[j].flags;
clib_memcpy_fast (rt->runtime_data, old_rt[j].runtime_data,
VLIB_NODE_RUNTIME_DATA_SIZE);
}