summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device
diff options
context:
space:
mode:
authorXiaoming Jiang <jiangxiaoming@outlook.com>2022-12-12 02:56:43 +0000
committerDamjan Marion <dmarion@0xa5.net>2023-03-06 16:48:30 +0000
commitc36f9b567d6c95a1b099226d322cfc7ffad9b3cc (patch)
tree79f82c60a905f3639a91f9fcbbc58949214631ba /src/plugins/dpdk/device
parent60a107c8fd8874694ec72fb526d4d393bf36d1ee (diff)
dpdk: plugin init should be protect by thread barrier
Witout thread barrier, when dpdk_process_node initiating dpdk lib, workers thread may also be initiating. Main and workers threads may both setting error_main info, that will cause memory ASAN issue. Type: fix Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com> Change-Id: I87b73b310730719035d4985a2cff2e3308120ec2
Diffstat (limited to 'src/plugins/dpdk/device')
-rw-r--r--src/plugins/dpdk/device/init.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index d6115009cc0..74181ead11d 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -1450,6 +1450,7 @@ dpdk_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f)
dpdk_device_t *xd;
vlib_thread_main_t *tm = vlib_get_thread_main ();
+ vlib_worker_thread_barrier_sync (vm);
error = dpdk_lib_init (dm);
if (error)
@@ -1466,6 +1467,7 @@ dpdk_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f)
}
}
+ vlib_worker_thread_barrier_release (vm);
tm->worker_thread_release = 1;
f64 now = vlib_time_now (vm);