diff options
author | Neale Ranns <nranns@cisco.com> | 2020-01-21 04:58:02 +0000 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2020-01-22 19:23:38 +0000 |
commit | 29acfa2ad58c36d183677d2d68c390854e3b8060 (patch) | |
tree | f2e1c66c27c935274c275543981c5e851a7c1a27 /src/plugins/dpdk/ipsec/esp_encrypt.c | |
parent | e3cabba9b865df12be04e240bdae0eb180aa7eb9 (diff) |
ipsec: re-enable DPDK IPSec for tunnel decap/encap (VPP-1823)v20.01-rc2
Type: fix
Change-Id: Iff9b1960b122f7d326efc37770b4ae3e81eb3122
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/ipsec/esp_encrypt.c')
-rw-r--r-- | src/plugins/dpdk/ipsec/esp_encrypt.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/plugins/dpdk/ipsec/esp_encrypt.c b/src/plugins/dpdk/ipsec/esp_encrypt.c index dd37f081a15..7da5cf8876f 100644 --- a/src/plugins/dpdk/ipsec/esp_encrypt.c +++ b/src/plugins/dpdk/ipsec/esp_encrypt.c @@ -66,6 +66,8 @@ static char *esp_encrypt_error_strings[] = { extern vlib_node_registration_t dpdk_esp4_encrypt_node; extern vlib_node_registration_t dpdk_esp6_encrypt_node; +extern vlib_node_registration_t dpdk_esp4_encrypt_tun_node; +extern vlib_node_registration_t dpdk_esp6_encrypt_tun_node; typedef struct { @@ -411,8 +413,16 @@ dpdk_esp_encrypt_inline (vlib_main_t * vm, } else /* transport mode */ { - priv->next = DPDK_CRYPTO_INPUT_NEXT_INTERFACE_OUTPUT; - rewrite_len = vnet_buffer (b0)->ip.save_rewrite_length; + if (is_tun) + { + rewrite_len = 0; + priv->next = DPDK_CRYPTO_INPUT_NEXT_MIDCHAIN; + } + else + { + priv->next = DPDK_CRYPTO_INPUT_NEXT_INTERFACE_OUTPUT; + rewrite_len = vnet_buffer (b0)->ip.save_rewrite_length; + } u16 adv = sizeof (esp_header_t) + iv_size + udp_encap_adv; vlib_buffer_advance (b0, -adv - rewrite_len); u8 *src = ((u8 *) ih0) - rewrite_len; @@ -576,7 +586,10 @@ dpdk_esp_encrypt_inline (vlib_main_t * vm, } if (is_ip6) { - vlib_node_increment_counter (vm, dpdk_esp6_encrypt_node.index, + vlib_node_increment_counter (vm, + (is_tun ? + dpdk_esp6_encrypt_tun_node.index : + dpdk_esp6_encrypt_node.index), ESP_ENCRYPT_ERROR_RX_PKTS, from_frame->n_vectors); @@ -585,7 +598,10 @@ dpdk_esp_encrypt_inline (vlib_main_t * vm, } else { - vlib_node_increment_counter (vm, dpdk_esp4_encrypt_node.index, + vlib_node_increment_counter (vm, + (is_tun ? + dpdk_esp4_encrypt_tun_node.index : + dpdk_esp4_encrypt_node.index), ESP_ENCRYPT_ERROR_RX_PKTS, from_frame->n_vectors); |