diff options
author | Damjan Marion <damarion@cisco.com> | 2020-11-12 15:48:15 +0100 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2020-11-12 16:39:38 +0000 |
commit | ccbb0665ae7e388e08390c8318a48a9f32659ecd (patch) | |
tree | 5fee91c05b1b2ffdf70715b192335f662ee04e1e /src | |
parent | fb9d37402020c5d341e0a5a9e9a937ce06fe6171 (diff) |
avf: don't switch process if already running process node
Type: fix
Change-Id: I82b11339402b5848b27c600f6484aaeee66cc888
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/avf/device.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c index b6cf32f0866..1cedc35db9b 100644 --- a/src/plugins/avf/device.c +++ b/src/plugins/avf/device.c @@ -1165,23 +1165,6 @@ error: vlib_log_err (avf_log.class, "%U", format_clib_error, ad->error); } -static clib_error_t * -avf_process_request (vlib_main_t * vm, avf_process_req_t * req) -{ - uword *event_data = 0; - req->calling_process_index = vlib_get_current_process_node_index (vm); - vlib_process_signal_event_pointer (vm, avf_process_node.index, - AVF_PROCESS_EVENT_REQ, req); - - vlib_process_wait_for_event_or_clock (vm, 5.0); - - if (vlib_process_get_events (vm, &event_data) != 0) - clib_panic ("avf process node failed to reply in 5 seconds"); - vec_free (event_data); - - return req->error; -} - static void avf_process_handle_request (vlib_main_t * vm, avf_process_req_t * req) { @@ -1195,7 +1178,31 @@ avf_process_handle_request (vlib_main_t * vm, avf_process_req_t * req) else clib_panic ("BUG: unknown avf proceess request type"); - vlib_process_signal_event (vm, req->calling_process_index, 0, 0); + if (req->calling_process_index != avf_process_node.index) + vlib_process_signal_event (vm, req->calling_process_index, 0, 0); +} + +static clib_error_t * +avf_process_request (vlib_main_t * vm, avf_process_req_t * req) +{ + uword *event_data = 0; + req->calling_process_index = vlib_get_current_process_node_index (vm); + + if (req->calling_process_index != avf_process_node.index) + { + vlib_process_signal_event_pointer (vm, avf_process_node.index, + AVF_PROCESS_EVENT_REQ, req); + + vlib_process_wait_for_event_or_clock (vm, 5.0); + + if (vlib_process_get_events (vm, &event_data) != 0) + clib_panic ("avf process node failed to reply in 5 seconds"); + vec_free (event_data); + } + else + avf_process_handle_request (vm, req); + + return req->error; } static u32 |