vcl: add api to retrieve num bytes for tx
[vpp.git] / src / vnet / fib / fib_urpf_list.c
index 4f751a6..67be669 100644 (file)
@@ -55,8 +55,18 @@ index_t
 fib_urpf_list_alloc_and_lock (void)
 {
     fib_urpf_list_t *urpf;
+    u8 need_barrier_sync = pool_get_will_expand (fib_urpf_list_pool);
+    vlib_main_t *vm = vlib_get_main();
+    ASSERT (vm->thread_index == 0);
+
+    if (need_barrier_sync)
+        vlib_worker_thread_barrier_sync (vm);
 
     pool_get(fib_urpf_list_pool, urpf);
+
+    if (need_barrier_sync)
+        vlib_worker_thread_barrier_release (vm);
+
     clib_memset(urpf, 0, sizeof(*urpf));
 
     urpf->furpf_locks++;
@@ -163,7 +173,7 @@ fib_urpf_list_bake (index_t ui)
           if (urpf->furpf_itfs[i] != urpf->furpf_itfs[j])
             urpf->furpf_itfs[++i] = urpf->furpf_itfs[j];
         /* set the length of the vector to the number of unique itfs */
-        _vec_len(urpf->furpf_itfs) = i+1;
+        vec_set_len (urpf->furpf_itfs, i+1);
       }
 
     urpf->furpf_flags |= FIB_URPF_LIST_BAKED;
@@ -218,7 +228,6 @@ show_fib_urpf_list_command (vlib_main_t * vm,
     return (NULL);
 }
 
-/* *INDENT-OFF* */
 /*?
  * The '<em>sh fib uRPF [index] </em>' command displays the uRPF lists
  *
@@ -236,4 +245,3 @@ VLIB_CLI_COMMAND (show_fib_urpf_list, static) = {
   .function = show_fib_urpf_list_command,
   .short_help = "show fib uRPF",
 };
-/* *INDENT-OFF* */