aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/odp/ipsec/esp_decrypt.c
diff options
context:
space:
mode:
authorSzymon Sliwa <szs@semihalf.com>2018-02-14 15:57:48 +0100
committerSzymon Sliwa <szs@semihalf.com>2018-02-19 17:47:48 +0100
commit808c3e6e7b1c764bd77b12d4bc5ffc68707971a9 (patch)
treebfff91d9efaa39b0ddc4b5c3d165aef26160edd9 /src/plugins/odp/ipsec/esp_decrypt.c
parent34c3e2b4a949cba8ebe54af9cacb32419a3717da (diff)
plugins: odp: ipsec: Fix multiple issues
1) added casts on assignment to post_crypto.next_index as the type of the field changed 2) removed checking result when crypto operation is asynchronous as it make no sense 3) fixed bug which could cause issues when some of the operations are done synchronously and some asynchronously Change-Id: I123d70402c0210b11dfc2d0fff2c72aa100ce838 Signed-off-by: Szymon Sliwa <szs@semihalf.com>
Diffstat (limited to 'src/plugins/odp/ipsec/esp_decrypt.c')
-rw-r--r--src/plugins/odp/ipsec/esp_decrypt.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/plugins/odp/ipsec/esp_decrypt.c b/src/plugins/odp/ipsec/esp_decrypt.c
index 814c52bd..20b3b306 100644
--- a/src/plugins/odp/ipsec/esp_decrypt.c
+++ b/src/plugins/odp/ipsec/esp_decrypt.c
@@ -128,7 +128,6 @@ esp_decrypt_node_fn (vlib_main_t * vm,
while (n_left_from > 0)
{
u32 n_left_to_next;
- u32 buffers_passed = 0;
vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
@@ -317,7 +316,7 @@ esp_decrypt_node_fn (vlib_main_t * vm,
goto trace;
}
- if (PREDICT_FALSE (!result.ok))
+ if (PREDICT_FALSE (!posted && !result.ok))
{
vlib_node_increment_counter (vm, odp_crypto_esp_decrypt_node.index,
ESP_DECRYPT_ERROR_INTEG_ERROR,
@@ -405,7 +404,7 @@ esp_decrypt_node_fn (vlib_main_t * vm,
vnet_buffer (b0)->sw_if_index[VLIB_TX] = (u32) ~ 0;
- vnet_buffer (b0)->post_crypto.next_index = next0;
+ vnet_buffer (b0)->post_crypto.next_index = (u8) next0;
}
trace:
@@ -421,11 +420,14 @@ esp_decrypt_node_fn (vlib_main_t * vm,
{
vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
n_left_to_next, bi0, next0);
- buffers_passed += 1;
+ }
+ else
+ {
+ to_next -= 1;
+ n_left_to_next += 1;
}
}
- if (buffers_passed > 0)
- vlib_put_next_frame (vm, node, next_index, n_left_to_next);
+ vlib_put_next_frame (vm, node, next_index, n_left_to_next);
}
vlib_node_increment_counter (vm, odp_crypto_esp_decrypt_node.index,
ESP_DECRYPT_ERROR_RX_PKTS,