diff options
Diffstat (limited to 'src/plugins/dpdk/ipsec/ipsec.c')
-rw-r--r-- | src/plugins/dpdk/ipsec/ipsec.c | 44 |
1 files changed, 7 insertions, 37 deletions
diff --git a/src/plugins/dpdk/ipsec/ipsec.c b/src/plugins/dpdk/ipsec/ipsec.c index bcc4b62ad76..e665db4a0f4 100644 --- a/src/plugins/dpdk/ipsec/ipsec.c +++ b/src/plugins/dpdk/ipsec/ipsec.c @@ -1045,45 +1045,15 @@ dpdk_ipsec_process (vlib_main_t * vm, vlib_node_runtime_t * rt, return 0; } - /* Add new next node and set it as default */ - vlib_node_t *node, *next_node; - next_node = vlib_get_node_by_name (vm, (u8 *) "dpdk-esp4-encrypt"); - ASSERT (next_node); - node = vlib_get_node_by_name (vm, (u8 *) "ipsec4-output"); - ASSERT (node); - im->esp4_encrypt_node_index = next_node->index; - im->esp4_encrypt_next_index = - vlib_node_add_next (vm, node->index, next_node->index); - - next_node = vlib_get_node_by_name (vm, (u8 *) "dpdk-esp4-decrypt"); - ASSERT (next_node); - node = vlib_get_node_by_name (vm, (u8 *) "ipsec4-input"); - ASSERT (node); - im->esp4_decrypt_node_index = next_node->index; - im->esp4_decrypt_next_index = - vlib_node_add_next (vm, node->index, next_node->index); - - next_node = vlib_get_node_by_name (vm, (u8 *) "dpdk-esp6-encrypt"); - ASSERT (next_node); - node = vlib_get_node_by_name (vm, (u8 *) "ipsec6-output"); - ASSERT (node); - im->esp6_encrypt_node_index = next_node->index; - im->esp6_encrypt_next_index = - vlib_node_add_next (vm, node->index, next_node->index); - - next_node = vlib_get_node_by_name (vm, (u8 *) "dpdk-esp6-decrypt"); - ASSERT (next_node); - node = vlib_get_node_by_name (vm, (u8 *) "ipsec6-input"); - ASSERT (node); - im->esp6_decrypt_node_index = next_node->index; - im->esp6_decrypt_next_index = - vlib_node_add_next (vm, node->index, next_node->index); - - im->cb.check_support_cb = dpdk_ipsec_check_support; - im->cb.add_del_sa_sess_cb = add_del_sa_session; + ipsec_register_esp_backend (vm, im, "dpdk backend", + "dpdk-esp4-encrypt", + "dpdk-esp4-decrypt", + "dpdk-esp6-encrypt", + "dpdk-esp6-decrypt", + dpdk_ipsec_check_support, add_del_sa_session); - node = vlib_get_node_by_name (vm, (u8 *) "dpdk-crypto-input"); + vlib_node_t *node = vlib_get_node_by_name (vm, (u8 *) "dpdk-crypto-input"); ASSERT (node); for (i = skip_master; i < n_mains; i++) vlib_node_set_state (vlib_mains[i], node->index, VLIB_NODE_STATE_POLLING); |