summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKingwel Xie <kingwel.xie@ericsson.com>2018-12-25 21:31:28 -0500
committerKingwel Xie <kingwel.xie@ericsson.com>2019-01-21 03:40:39 +0000
commit955ee280280e09b73621119f5753a38ce5173989 (patch)
treefdf98a8647341919736661ff20bfe423104f8641
parenta5c308e68d5578e5d75327619e30d73a95abb1a5 (diff)
crypto-input: fix crash bug
as this node is refactored in new style with vlib_buffer_enqueue_to_next, we have to check if the 'count' is greater than 0. otherise, the next_index would be invalid then lead to a crash Change-Id: If7c323b59c02b5c16bd9d77b65c946512cc972c1 Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com>
-rw-r--r--src/plugins/dpdk/ipsec/crypto_node.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/plugins/dpdk/ipsec/crypto_node.c b/src/plugins/dpdk/ipsec/crypto_node.c
index 84782b17ad4..39459733402 100644
--- a/src/plugins/dpdk/ipsec/crypto_node.c
+++ b/src/plugins/dpdk/ipsec/crypto_node.c
@@ -167,6 +167,10 @@ dpdk_crypto_dequeue (vlib_main_t * vm, vlib_node_runtime_t * node,
res->qp_id + outbound,
ops, VLIB_FRAME_SIZE);
+ /* no op dequeued, do not proceed */
+ if (n_deq == 0)
+ return 0;
+
res->inflights[outbound] -= n_ops;
dpdk_crypto_input_trace (vm, node, ops, n_deq);
@@ -184,14 +188,14 @@ dpdk_crypto_dequeue (vlib_main_t * vm, vlib_node_runtime_t * node,
CLIB_PREFETCH (ops[6], CLIB_CACHE_LINE_BYTES, LOAD);
CLIB_PREFETCH (ops[7], CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (crypto_op_get_priv (ops[4]), CLIB_CACHE_LINE_BYTES,
- LOAD);
- CLIB_PREFETCH (crypto_op_get_priv (ops[5]), CLIB_CACHE_LINE_BYTES,
- LOAD);
- CLIB_PREFETCH (crypto_op_get_priv (ops[6]), CLIB_CACHE_LINE_BYTES,
- LOAD);
- CLIB_PREFETCH (crypto_op_get_priv (ops[7]), CLIB_CACHE_LINE_BYTES,
- LOAD);
+ CLIB_PREFETCH (crypto_op_get_priv (ops[4]),
+ CLIB_CACHE_LINE_BYTES, LOAD);
+ CLIB_PREFETCH (crypto_op_get_priv (ops[5]),
+ CLIB_CACHE_LINE_BYTES, LOAD);
+ CLIB_PREFETCH (crypto_op_get_priv (ops[6]),
+ CLIB_CACHE_LINE_BYTES, LOAD);
+ CLIB_PREFETCH (crypto_op_get_priv (ops[7]),
+ CLIB_CACHE_LINE_BYTES, LOAD);
}
op0 = ops[0];