aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2018-10-29 13:38:19 +0100
committerDamjan Marion <dmarion@me.com>2018-10-29 15:03:34 +0000
commitb8f354470628e464452c062ca0802f59f8e572f3 (patch)
treeced1941d441492d1c24c208a62e93bf60a83d0c8
parentcd35e53c928f666e50342e27d69e6dd7d60e1283 (diff)
migrate ipsec to new multiarch infra
Change-Id: Ibef46e068cd72415af28920b0146adf48105bf68 Signed-off-by: Klement Sekera <ksekera@cisco.com>
-rw-r--r--src/plugins/dpdk/ipsec/esp_decrypt.c22
-rw-r--r--src/plugins/dpdk/ipsec/esp_encrypt.c19
-rw-r--r--src/vnet/CMakeLists.txt7
-rw-r--r--src/vnet/ipsec/ah_decrypt.c17
-rw-r--r--src/vnet/ipsec/ah_encrypt.c17
-rw-r--r--src/vnet/ipsec/esp_decrypt.c17
-rw-r--r--src/vnet/ipsec/esp_encrypt.c17
-rw-r--r--src/vnet/ipsec/ipsec_if_in.c8
-rw-r--r--src/vnet/ipsec/ipsec_input.c18
-rw-r--r--src/vnet/ipsec/ipsec_output.c21
10 files changed, 59 insertions, 104 deletions
diff --git a/src/plugins/dpdk/ipsec/esp_decrypt.c b/src/plugins/dpdk/ipsec/esp_decrypt.c
index 9cf9c762ada..9d88f072f9f 100644
--- a/src/plugins/dpdk/ipsec/esp_decrypt.c
+++ b/src/plugins/dpdk/ipsec/esp_decrypt.c
@@ -379,8 +379,7 @@ trace:
return from_frame->n_vectors;
}
-static uword
-dpdk_esp4_decrypt_node_fn (vlib_main_t * vm,
+VLIB_NODE_FN(dpdk_esp4_decrypt_node) (vlib_main_t * vm,
vlib_node_runtime_t * node,
vlib_frame_t * from_frame)
{
@@ -389,7 +388,6 @@ dpdk_esp4_decrypt_node_fn (vlib_main_t * vm,
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (dpdk_esp4_decrypt_node) = {
- .function = dpdk_esp4_decrypt_node_fn,
.name = "dpdk-esp4-decrypt",
.vector_size = sizeof (u32),
.format_trace = format_esp_decrypt_trace,
@@ -407,10 +405,7 @@ VLIB_REGISTER_NODE (dpdk_esp4_decrypt_node) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (dpdk_esp4_decrypt_node, dpdk_esp4_decrypt_node_fn);
-
-static uword
-dpdk_esp6_decrypt_node_fn (vlib_main_t * vm,
+VLIB_NODE_FN(dpdk_esp6_decrypt_node) (vlib_main_t * vm,
vlib_node_runtime_t * node,
vlib_frame_t * from_frame)
{
@@ -419,7 +414,6 @@ dpdk_esp6_decrypt_node_fn (vlib_main_t * vm,
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (dpdk_esp6_decrypt_node) = {
- .function = dpdk_esp6_decrypt_node_fn,
.name = "dpdk-esp6-decrypt",
.vector_size = sizeof (u32),
.format_trace = format_esp_decrypt_trace,
@@ -437,8 +431,6 @@ VLIB_REGISTER_NODE (dpdk_esp6_decrypt_node) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (dpdk_esp6_decrypt_node, dpdk_esp6_decrypt_node_fn);
-
/*
* Decrypt Post Node
*/
@@ -676,8 +668,7 @@ dpdk_esp_decrypt_post_inline (vlib_main_t * vm,
return from_frame->n_vectors;
}
-static uword
-dpdk_esp4_decrypt_post_node_fn (vlib_main_t * vm,
+VLIB_NODE_FN(dpdk_esp4_decrypt_post_node) (vlib_main_t * vm,
vlib_node_runtime_t * node,
vlib_frame_t * from_frame)
{return dpdk_esp_decrypt_post_inline(vm, node, from_frame, 0/*is_ip6*/);}
@@ -702,10 +693,7 @@ VLIB_REGISTER_NODE (dpdk_esp4_decrypt_post_node) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (dpdk_esp4_decrypt_post_node, dpdk_esp4_decrypt_post_node_fn);
-
-static uword
-dpdk_esp6_decrypt_post_node_fn (vlib_main_t * vm,
+VLIB_NODE_FN(dpdk_esp6_decrypt_post_node) (vlib_main_t * vm,
vlib_node_runtime_t * node,
vlib_frame_t * from_frame)
{return dpdk_esp_decrypt_post_inline(vm, node, from_frame, 0/*is_ip6*/);}
@@ -729,5 +717,3 @@ VLIB_REGISTER_NODE (dpdk_esp6_decrypt_post_node) = {
},
};
/* *INDENT-ON* */
-
-VLIB_NODE_FUNCTION_MULTIARCH (dpdk_esp6_decrypt_post_node, dpdk_esp6_decrypt_post_node_fn);
diff --git a/src/plugins/dpdk/ipsec/esp_encrypt.c b/src/plugins/dpdk/ipsec/esp_encrypt.c
index af8cc46b946..ded569f9d3d 100644
--- a/src/plugins/dpdk/ipsec/esp_encrypt.c
+++ b/src/plugins/dpdk/ipsec/esp_encrypt.c
@@ -567,10 +567,9 @@ dpdk_esp_encrypt_inline (vlib_main_t * vm,
return from_frame->n_vectors;
}
-static uword
-dpdk_esp4_encrypt_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node,
- vlib_frame_t * from_frame)
+VLIB_NODE_FN (dpdk_esp4_encrypt_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
return dpdk_esp_encrypt_inline (vm, node, from_frame, 0 /*is_ip6 */ );
}
@@ -592,13 +591,9 @@ VLIB_REGISTER_NODE (dpdk_esp4_encrypt_node) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (dpdk_esp4_encrypt_node,
- dpdk_esp4_encrypt_node_fn);
-
-static uword
-dpdk_esp6_encrypt_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node,
- vlib_frame_t * from_frame)
+VLIB_NODE_FN (dpdk_esp6_encrypt_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
return dpdk_esp_encrypt_inline (vm, node, from_frame, 1 /*is_ip6 */ );
}
@@ -620,8 +615,6 @@ VLIB_REGISTER_NODE (dpdk_esp6_encrypt_node) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (dpdk_esp6_encrypt_node,
- dpdk_esp6_encrypt_node_fn);
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vnet/CMakeLists.txt b/src/vnet/CMakeLists.txt
index 5bac7dbc196..a45f921fb08 100644
--- a/src/vnet/CMakeLists.txt
+++ b/src/vnet/CMakeLists.txt
@@ -491,6 +491,13 @@ list(APPEND VNET_SOURCES
ipsec/ipsec_api.c
)
+list(APPEND VNET_MULTIARCH_SOURCES
+ ipsec/esp_encrypt.c
+ ipsec/esp_decrypt.c
+ ipsec/ah_decrypt.c
+ ipsec/ah_encrypt.c
+)
+
list(APPEND VNET_API_FILES ipsec/ipsec.api)
list(APPEND VNET_SOURCES
diff --git a/src/vnet/ipsec/ah_decrypt.c b/src/vnet/ipsec/ah_decrypt.c
index a69c7d24f47..34ea000d623 100644
--- a/src/vnet/ipsec/ah_decrypt.c
+++ b/src/vnet/ipsec/ah_decrypt.c
@@ -336,16 +336,15 @@ ah_decrypt_inline (vlib_main_t * vm,
return from_frame->n_vectors;
}
-static uword
-ah4_decrypt_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+VLIB_NODE_FN (ah4_decrypt_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
return ah_decrypt_inline (vm, node, from_frame, 0 /* is_ip6 */ );
}
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (ah4_decrypt_node) = {
- .function = ah4_decrypt_node_fn,
.name = "ah4-decrypt",
.vector_size = sizeof (u32),
.format_trace = format_ah_decrypt_trace,
@@ -363,18 +362,15 @@ VLIB_REGISTER_NODE (ah4_decrypt_node) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (ah4_decrypt_node, ah4_decrypt_node_fn);
-
-static uword
-ah6_decrypt_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+VLIB_NODE_FN (ah6_decrypt_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
return ah_decrypt_inline (vm, node, from_frame, 1 /* is_ip6 */ );
}
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (ah6_decrypt_node) = {
- .function = ah6_decrypt_node_fn,
.name = "ah6-decrypt",
.vector_size = sizeof (u32),
.format_trace = format_ah_decrypt_trace,
@@ -392,7 +388,6 @@ VLIB_REGISTER_NODE (ah6_decrypt_node) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (ah6_decrypt_node, ah6_decrypt_node_fn);
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vnet/ipsec/ah_encrypt.c b/src/vnet/ipsec/ah_encrypt.c
index 47f3b3884c0..7a6703da2de 100644
--- a/src/vnet/ipsec/ah_encrypt.c
+++ b/src/vnet/ipsec/ah_encrypt.c
@@ -326,16 +326,15 @@ ah_encrypt_inline (vlib_main_t * vm,
return from_frame->n_vectors;
}
-static uword
-ah4_encrypt_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+VLIB_NODE_FN (ah4_encrypt_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
return ah_encrypt_inline (vm, node, from_frame, 0 /* is_ip6 */ );
}
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (ah4_encrypt_node) = {
- .function = ah4_encrypt_node_fn,
.name = "ah4-encrypt",
.vector_size = sizeof (u32),
.format_trace = format_ah_encrypt_trace,
@@ -353,18 +352,15 @@ VLIB_REGISTER_NODE (ah4_encrypt_node) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (ah4_encrypt_node, ah4_encrypt_node_fn);
-
-static uword
-ah6_encrypt_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+VLIB_NODE_FN (ah6_encrypt_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
return ah_encrypt_inline (vm, node, from_frame, 1 /* is_ip6 */ );
}
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (ah6_encrypt_node) = {
- .function = ah6_encrypt_node_fn,
.name = "ah6-encrypt",
.vector_size = sizeof (u32),
.format_trace = format_ah_encrypt_trace,
@@ -382,7 +378,6 @@ VLIB_REGISTER_NODE (ah6_encrypt_node) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (ah6_encrypt_node, ah6_encrypt_node_fn);
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vnet/ipsec/esp_decrypt.c b/src/vnet/ipsec/esp_decrypt.c
index fc45d7ee63d..1b3e0681ae1 100644
--- a/src/vnet/ipsec/esp_decrypt.c
+++ b/src/vnet/ipsec/esp_decrypt.c
@@ -429,16 +429,15 @@ free_buffers_and_exit:
return from_frame->n_vectors;
}
-static uword
-esp4_decrypt_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+VLIB_NODE_FN (esp4_decrypt_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
return esp_decrypt_inline (vm, node, from_frame, 0 /* is_ip6 */ );
}
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (esp4_decrypt_node) = {
- .function = esp4_decrypt_node_fn,
.name = "esp4-decrypt",
.vector_size = sizeof (u32),
.format_trace = format_esp_decrypt_trace,
@@ -456,18 +455,15 @@ VLIB_REGISTER_NODE (esp4_decrypt_node) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (esp4_decrypt_node, esp4_decrypt_node_fn);
-
-static uword
-esp6_decrypt_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+VLIB_NODE_FN (esp6_decrypt_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
return esp_decrypt_inline (vm, node, from_frame, 1 /* is_ip6 */ );
}
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (esp6_decrypt_node) = {
- .function = esp6_decrypt_node_fn,
.name = "esp6-decrypt",
.vector_size = sizeof (u32),
.format_trace = format_esp_decrypt_trace,
@@ -485,7 +481,6 @@ VLIB_REGISTER_NODE (esp6_decrypt_node) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (esp6_decrypt_node, esp6_decrypt_node_fn);
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vnet/ipsec/esp_encrypt.c b/src/vnet/ipsec/esp_encrypt.c
index 9c775ef1e47..7b7d2f3e532 100644
--- a/src/vnet/ipsec/esp_encrypt.c
+++ b/src/vnet/ipsec/esp_encrypt.c
@@ -444,16 +444,15 @@ free_buffers_and_exit:
return from_frame->n_vectors;
}
-static uword
-esp4_encrypt_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+VLIB_NODE_FN (esp4_encrypt_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
return esp_encrypt_inline (vm, node, from_frame, 0 /* is_ip6 */ );
}
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (esp4_encrypt_node) = {
- .function = esp4_encrypt_node_fn,
.name = "esp4-encrypt",
.vector_size = sizeof (u32),
.format_trace = format_esp_encrypt_trace,
@@ -471,18 +470,15 @@ VLIB_REGISTER_NODE (esp4_encrypt_node) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (esp4_encrypt_node, esp4_encrypt_node_fn);
-
-static uword
-esp6_encrypt_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+VLIB_NODE_FN (esp6_encrypt_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
return esp_encrypt_inline (vm, node, from_frame, 1 /* is_ip6 */ );
}
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (esp6_encrypt_node) = {
- .function = esp6_encrypt_node_fn,
.name = "esp6-encrypt",
.vector_size = sizeof (u32),
.format_trace = format_esp_encrypt_trace,
@@ -500,7 +496,6 @@ VLIB_REGISTER_NODE (esp6_encrypt_node) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (esp6_encrypt_node, esp6_encrypt_node_fn);
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vnet/ipsec/ipsec_if_in.c b/src/vnet/ipsec/ipsec_if_in.c
index a486bd98dbb..a9aab820b91 100644
--- a/src/vnet/ipsec/ipsec_if_in.c
+++ b/src/vnet/ipsec/ipsec_if_in.c
@@ -59,9 +59,9 @@ format_ipsec_if_input_trace (u8 * s, va_list * args)
return s;
}
-static uword
-ipsec_if_input_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
- vlib_frame_t * from_frame)
+VLIB_NODE_FN (ipsec_if_input_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
ipsec_main_t *im = &ipsec_main;
vnet_main_t *vnm = im->vnet_main;
@@ -222,7 +222,6 @@ ipsec_if_input_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (ipsec_if_input_node) = {
- .function = ipsec_if_input_node_fn,
.name = "ipsec-if-input",
.vector_size = sizeof (u32),
.format_trace = format_ipsec_if_input_trace,
@@ -235,7 +234,6 @@ VLIB_REGISTER_NODE (ipsec_if_input_node) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (ipsec_if_input_node, ipsec_if_input_node_fn)
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vnet/ipsec/ipsec_input.c b/src/vnet/ipsec/ipsec_input.c
index 6d5b2dcce69..19c3b5bcef1 100644
--- a/src/vnet/ipsec/ipsec_input.c
+++ b/src/vnet/ipsec/ipsec_input.c
@@ -170,9 +170,9 @@ ipsec6_input_protect_policy_match (ipsec_spd_t * spd,
static vlib_node_registration_t ipsec4_input_node;
-static uword
-ipsec4_input_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+VLIB_NODE_FN (ipsec4_input_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
u32 n_left_from, *from, next_index, *to_next;
ipsec_main_t *im = &ipsec_main;
@@ -329,7 +329,6 @@ ipsec4_input_node_fn (vlib_main_t * vm,
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (ipsec4_input_node,static) = {
- .function = ipsec4_input_node_fn,
.name = "ipsec4-input",
.vector_size = sizeof (u32),
.format_trace = format_ipsec_input_trace,
@@ -347,13 +346,12 @@ VLIB_REGISTER_NODE (ipsec4_input_node,static) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (ipsec4_input_node, ipsec4_input_node_fn);
-
static vlib_node_registration_t ipsec6_input_node;
-static uword
-ipsec6_input_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+
+VLIB_NODE_FN (ipsec6_input_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
u32 n_left_from, *from, next_index, *to_next;
ipsec_main_t *im = &ipsec_main;
@@ -477,7 +475,6 @@ ipsec6_input_node_fn (vlib_main_t * vm,
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (ipsec6_input_node,static) = {
- .function = ipsec6_input_node_fn,
.name = "ipsec6-input",
.vector_size = sizeof (u32),
.format_trace = format_ipsec_input_trace,
@@ -490,7 +487,6 @@ VLIB_REGISTER_NODE (ipsec6_input_node,static) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (ipsec6_input_node, ipsec6_input_node_fn);
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vnet/ipsec/ipsec_output.c b/src/vnet/ipsec/ipsec_output.c
index e020f2a6532..6b99965d501 100644
--- a/src/vnet/ipsec/ipsec_output.c
+++ b/src/vnet/ipsec/ipsec_output.c
@@ -419,16 +419,15 @@ ipsec_output_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
return from_frame->n_vectors;
}
-static uword
-ipsec4_output_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
- vlib_frame_t * frame)
+VLIB_NODE_FN (ipsec4_output_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
return ipsec_output_inline (vm, node, frame, 0);
}
/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (ipsec4_output_node,static) = {
- .function = ipsec4_output_node_fn,
+VLIB_REGISTER_NODE (ipsec4_output_node) = {
.name = "ipsec4-output",
.vector_size = sizeof (u32),
.format_trace = format_ipsec_output_trace,
@@ -446,18 +445,15 @@ VLIB_REGISTER_NODE (ipsec4_output_node,static) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (ipsec4_output_node, ipsec4_output_node_fn);
-
-static uword
-ipsec6_output_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
- vlib_frame_t * frame)
+VLIB_NODE_FN (ipsec6_output_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
return ipsec_output_inline (vm, node, frame, 1);
}
/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (ipsec6_output_node,static) = {
- .function = ipsec6_output_node_fn,
+VLIB_REGISTER_NODE (ipsec6_output_node) = {
.name = "ipsec6-output",
.vector_size = sizeof (u32),
.format_trace = format_ipsec_output_trace,
@@ -475,7 +471,6 @@ VLIB_REGISTER_NODE (ipsec6_output_node,static) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (ipsec6_output_node, ipsec6_output_node_fn);
#else /* IPSEC > 1 */
/* Dummy ipsec output node, in case when IPSec is disabled */