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
@@ -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);
}
