vcl: fix crash problem for invalidation of vls_table_lock 82/28782/6
authorwanghanlin <wanghanlin@corp.netease.com>
Fri, 11 Sep 2020 09:19:32 +0000 (17:19 +0800)
committerFlorin Coras <florin.coras@gmail.com>
Fri, 11 Dec 2020 02:10:55 +0000 (02:10 +0000)
Type: fix

Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
Change-Id: I0649f4d5adb5fa5b407431ea23982f2ad87fb657

src/vcl/vcl_locked.c

index 35061e7..d56a209 100644 (file)
@@ -219,7 +219,10 @@ vls_mt_add (void)
    * vcl worker with vpp. Otherwise, all threads use the same vcl worker, so
    * update the vcl worker's thread local worker index variable */
   if (vls_mt_wrk_supported ())
-    vls_register_vcl_worker ();
+    {
+      if (vppcom_worker_register () != VPPCOM_OK)
+       VERR ("failed to register worker");
+    }
   else
     vcl_set_worker_index (vlsl->vls_wrk_index);
 }
@@ -1712,11 +1715,7 @@ vls_use_real_epoll (void)
 void
 vls_register_vcl_worker (void)
 {
-  if (vppcom_worker_register () != VPPCOM_OK)
-    {
-      VERR ("failed to register worker");
-      return;
-    }
+  vls_mt_add ();
 }
 
 /*