avf: don't switch process if already running process node
Type: fix
@@ -1165,11 +1165,31 @@ error:
vlib_log_err (avf_log.class, "%U", format_clib_error, ad->error);
}
+static void
+avf_process_handle_request (vlib_main_t * vm, avf_process_req_t * req)
+{
+ avf_device_t *ad = avf_get_device (req->dev_instance);
+
+ if (req->type == AVF_PROCESS_REQ_ADD_DEL_ETH_ADDR)
+ req->error = avf_op_add_del_eth_addr (vm, ad, 1, req->eth_addr,
+ req->is_add);
+ else if (req->type == AVF_PROCESS_REQ_CONFIG_PROMISC_MDDE)
+ req->error = avf_op_config_promisc_mode (vm, ad, req->is_enable);
+ else
+ clib_panic ("BUG: unknown avf proceess request type");
+
+ 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);
@@ -1178,24 +1198,11 @@ avf_process_request (vlib_main_t * vm, avf_process_req_t * req)
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)
-{
- avf_device_t *ad = avf_get_device (req->dev_instance);
-
- if (req->type == AVF_PROCESS_REQ_ADD_DEL_ETH_ADDR)
- req->error = avf_op_add_del_eth_addr (vm, ad, 1, req->eth_addr,
- req->is_add);
- else if (req->type == AVF_PROCESS_REQ_CONFIG_PROMISC_MDDE)
- req->error = avf_op_config_promisc_mode (vm, ad, req->is_enable);
else
- clib_panic ("BUG: unknown avf proceess request type");
+ avf_process_handle_request (vm, req);
- vlib_process_signal_event (vm, req->calling_process_index, 0, 0);
+ return req->error;
}
static u32
