crypto: encrypt/decrypt queues sw_scheduler
[vpp.git] / src / vnet / crypto / node.c
index e1186f4..4757f53 100644 (file)
@@ -114,8 +114,8 @@ crypto_dequeue_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
          n_cache += cf->n_elts;
          if (n_cache >= VLIB_FRAME_SIZE)
            {
-             vlib_buffer_enqueue_to_next (vm, node, ct->buffer_indices,
-                                          ct->nexts, n_cache);
+             vlib_buffer_enqueue_to_next_vec (vm, node, &ct->buffer_indices,
+                                              &ct->nexts, n_cache);
              n_cache = 0;
            }
 
@@ -138,8 +138,9 @@ crypto_dequeue_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
       if (cm->dispatch_mode == VNET_CRYPTO_ASYNC_DISPATCH_INTERRUPT
          && n_elts > 0)
        {
-         vlib_node_set_interrupt_pending (vlib_mains[enqueue_thread_idx],
-                                          cm->crypto_node_index);
+         vlib_node_set_interrupt_pending (
+           vlib_get_main_by_index (enqueue_thread_idx),
+           cm->crypto_node_index);
        }
 
       n_elts = 0;
@@ -157,18 +158,16 @@ VLIB_NODE_FN (crypto_dispatch_node) (vlib_main_t * vm,
 {
   vnet_crypto_main_t *cm = &crypto_main;
   vnet_crypto_thread_t *ct = cm->threads + vm->thread_index;
-  u32 n_dispatched = 0, n_cache = 0;
-  u32 index;
+  u32 n_dispatched = 0, n_cache = 0, index;
+  vec_foreach_index (index, cm->dequeue_handlers)
 
-  /* *INDENT-OFF* */
-  clib_bitmap_foreach (index, cm->async_active_ids)  {
     n_cache = crypto_dequeue_frame (vm, node, ct, cm->dequeue_handlers[index],
                                    n_cache, &n_dispatched);
-  }
+
   /* *INDENT-ON* */
   if (n_cache)
-    vlib_buffer_enqueue_to_next (vm, node, ct->buffer_indices, ct->nexts,
-                                n_cache);
+    vlib_buffer_enqueue_to_next_vec (vm, node, &ct->buffer_indices, &ct->nexts,
+                                    n_cache);
 
   return n_dispatched;
 }