Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
vlib: use index to free suspended frame
[vpp.git]
/
src
/
vlib
/
main.c
diff --git
a/src/vlib/main.c
b/src/vlib/main.c
index
14d8914
..
1b9eb39
100644
(file)
--- a/
src/vlib/main.c
+++ b/
src/vlib/main.c
@@
-1416,9
+1416,8
@@
dispatch_suspended_process (vlib_main_t * vm,
ASSERT (p->flags & (VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_CLOCK
| VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_EVENT));
ASSERT (p->flags & (VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_CLOCK
| VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_EVENT));
- pf =
- pool_elt_at_index (nm->suspended_process_frames,
- p->suspended_process_frame_index);
+ pf = pool_elt_at_index (nm->suspended_process_frames,
+ p->suspended_process_frame_index);
node_runtime = &p->node_runtime;
node = vlib_get_node (vm, node_runtime->node_index);
node_runtime = &p->node_runtime;
node = vlib_get_node (vm, node_runtime->node_index);
@@
-1454,8
+1453,9
@@
dispatch_suspended_process (vlib_main_t * vm,
else
{
p->flags &= ~VLIB_PROCESS_IS_RUNNING;
else
{
p->flags &= ~VLIB_PROCESS_IS_RUNNING;
+ pool_put_index (nm->suspended_process_frames,
+ p->suspended_process_frame_index);
p->suspended_process_frame_index = ~0;
p->suspended_process_frame_index = ~0;
- pool_put (nm->suspended_process_frames, pf);
}
t = clib_cpu_time_now ();
}
t = clib_cpu_time_now ();
@@
-1534,7
+1534,10
@@
vlib_main_or_worker_loop (vlib_main_t * vm, int is_main)
vlib_node_runtime_t *n;
if (PREDICT_FALSE (_vec_len (vm->pending_rpc_requests) > 0))
vlib_node_runtime_t *n;
if (PREDICT_FALSE (_vec_len (vm->pending_rpc_requests) > 0))
- vl_api_send_pending_rpc_requests (vm);
+ {
+ if (!is_main)
+ vl_api_send_pending_rpc_requests (vm);
+ }
if (!is_main)
{
if (!is_main)
{
@@
-1756,7
+1759,7
@@
vlib_main (vlib_main_t * volatile vm, unformat_input_t * input)
if (!vm->name)
vm->name = "VLIB";
if (!vm->name)
vm->name = "VLIB";
- if ((error =
unix
_physmem_init (vm)))
+ if ((error =
vlib
_physmem_init (vm)))
{
clib_error_report (error);
goto done;
{
clib_error_report (error);
goto done;
@@
-1842,6
+1845,8
@@
vlib_main (vlib_main_t * volatile vm, unformat_input_t * input)
vec_validate (vm->pending_rpc_requests, 0);
_vec_len (vm->pending_rpc_requests) = 0;
vec_validate (vm->pending_rpc_requests, 0);
_vec_len (vm->pending_rpc_requests) = 0;
+ vec_validate (vm->processing_rpc_requests, 0);
+ _vec_len (vm->processing_rpc_requests) = 0;
switch (clib_setjmp (&vm->main_loop_exit, VLIB_MAIN_LOOP_EXIT_NONE))
{
switch (clib_setjmp (&vm->main_loop_exit, VLIB_MAIN_LOOP_EXIT_NONE))
{