aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/crypto
diff options
context:
space:
mode:
authorDastin Wilski <dastin.wilski@gmail.com>2022-01-12 09:28:45 +0100
committerDastin Wilski <dastin.wilski@gmail.com>2022-01-12 09:28:45 +0100
commit440bf5f8c82c51b003077b209853800d5b5f8517 (patch)
tree09f6da40056d9411471083247c30b5662380d83e /src/vnet/crypto
parent406669e7cdb0d94400089439576f38731ee97f13 (diff)
crypto: omit loop iteration
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
Diffstat (limited to 'src/vnet/crypto')
-rw-r--r--src/vnet/crypto/node.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/vnet/crypto/node.c b/src/vnet/crypto/node.c
index 4757f538855..216b924f96e 100644
--- a/src/vnet/crypto/node.c
+++ b/src/vnet/crypto/node.c
@@ -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,