crypto: omit loop iteration 85/34885/1
authorDastin Wilski <dastin.wilski@gmail.com>
Wed, 12 Jan 2022 08:28:45 +0000 (09:28 +0100)
committerDastin Wilski <dastin.wilski@gmail.com>
Wed, 12 Jan 2022 08:28:45 +0000 (09:28 +0100)
This fix adds check that will omit loop iteration
in case dequeue handler is zero.

Type: fix

Signed-off-by: Dastin Wilski <dastin.wilski@gmail.com>
Change-Id: I7526e3fe7d8c8da9662b4e9204efd5e2d8be1908

src/vnet/crypto/node.c

index 4757f53..216b924 100644 (file)
@@ -160,10 +160,12 @@ VLIB_NODE_FN (crypto_dispatch_node) (vlib_main_t * vm,
   vnet_crypto_thread_t *ct = cm->threads + vm->thread_index;
   u32 n_dispatched = 0, n_cache = 0, index;
   vec_foreach_index (index, cm->dequeue_handlers)
-
-    n_cache = crypto_dequeue_frame (vm, node, ct, cm->dequeue_handlers[index],
-                                   n_cache, &n_dispatched);
-
+    {
+      if (PREDICT_FALSE (cm->dequeue_handlers[index] == 0))
+       continue;
+      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_vec (vm, node, &ct->buffer_indices, &ct->nexts,