aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/ipsec/ipsec.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2018-11-08 13:00:02 +0100
committerDamjan Marion <dmarion@me.com>2018-11-15 12:57:18 +0000
commitb4d3053445499a115f0f4debde6a8c7b29a8c071 (patch)
treea1af7ee05a56199285ee9c6e39bbfe73d4d12c8c /src/plugins/dpdk/ipsec/ipsec.c
parent2b209e3ee05ec719f566f1d071a82f4e3c6a9417 (diff)
ipsec: infra for selecting backends
Change-Id: Ifa6d8391b1b2413a88b7720fc434e0bc849a149a Signed-off-by: Klement Sekera <ksekera@cisco.com> Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Diffstat (limited to 'src/plugins/dpdk/ipsec/ipsec.c')
-rw-r--r--src/plugins/dpdk/ipsec/ipsec.c44
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);