aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Sliwa <szs@semihalf.com>2018-02-01 10:03:28 +0100
committerSzymon Sliwa <szs@semihalf.com>2018-02-19 17:47:48 +0100
commit9fddc230ddb574398bdcf8e4f1133f6d27d2846f (patch)
tree05570fd6b6b7019e17ed2d4b10320769d9c85da2
parent817aabfc08f12a5726b2863fd24c1ffe87bb5ad1 (diff)
plugins: odp: rename functions and change trace content
Change-Id: I1f71fae3af5e36b710c8c978d8b9b74ea802e012 Signed-off-by: Szymon Sliwa <szs@semihalf.com>
-rw-r--r--src/plugins/odp/ipsec/esp_decrypt.c31
-rw-r--r--src/plugins/odp/ipsec/esp_decrypt_ipsec_api.c22
-rw-r--r--src/plugins/odp/ipsec/esp_encrypt.c24
-rw-r--r--src/plugins/odp/ipsec/esp_encrypt_ipsec_api.c13
4 files changed, 48 insertions, 42 deletions
diff --git a/src/plugins/odp/ipsec/esp_decrypt.c b/src/plugins/odp/ipsec/esp_decrypt.c
index bbdf578..06707e3 100644
--- a/src/plugins/odp/ipsec/esp_decrypt.c
+++ b/src/plugins/odp/ipsec/esp_decrypt.c
@@ -79,7 +79,7 @@ format_esp_decrypt_trace (u8 * s, va_list * args)
CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
esp_decrypt_trace_t *t = va_arg (*args, esp_decrypt_trace_t *);
- s = format (s, "(ODP) esp: crypto %U integrity %U",
+ s = format (s, "odp-crypto esp: crypto %U integrity %U",
format_ipsec_crypto_alg, t->crypto_alg,
format_ipsec_integ_alg, t->integ_alg);
return s;
@@ -92,13 +92,14 @@ format_esp_decrypt_post_trace (u8 * s, va_list * args)
CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
- s = format (s, "POST DECRYPT CRYPTO (ODP)");
+ s = format (s, "odp-crypto post esp (decrypt)");
return s;
}
static uword
-esp_decrypt_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+odp_crypto_esp_decrypt_node_fn (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;
@@ -176,7 +177,8 @@ esp_decrypt_node_fn (vlib_main_t * vm,
if (PREDICT_FALSE (rv))
{
clib_warning ("anti-replay SPI %u seq %u", sa0->spi, seq);
- vlib_node_increment_counter (vm, odp_crypto_esp_decrypt_node.index,
+ vlib_node_increment_counter (vm,
+ odp_crypto_esp_decrypt_node.index,
ESP_DECRYPT_ERROR_REPLAY, 1);
to_next[0] = bi0;
to_next += 1;
@@ -310,7 +312,8 @@ esp_decrypt_node_fn (vlib_main_t * vm,
if (PREDICT_FALSE (!posted && !result.ok))
{
- vlib_node_increment_counter (vm, odp_crypto_esp_decrypt_node.index,
+ vlib_node_increment_counter (vm,
+ odp_crypto_esp_decrypt_node.index,
ESP_DECRYPT_ERROR_INTEG_ERROR,
1);
goto trace;
@@ -355,7 +358,7 @@ esp_decrypt_node_fn (vlib_main_t * vm,
{
if (PREDICT_FALSE (transport_ip6))
{
- memmove(oh6, ih6, sizeof(ip6_header_t));
+ memmove (oh6, ih6, sizeof (ip6_header_t));
next0 = ESP_DECRYPT_NEXT_IP6_INPUT;
oh6->protocol = f0->next_header;
@@ -366,7 +369,7 @@ esp_decrypt_node_fn (vlib_main_t * vm,
}
else
{
- memmove(oh4, ih4, sizeof(ip4_header_t));
+ memmove (oh4, ih4, sizeof (ip4_header_t));
next0 = ESP_DECRYPT_NEXT_IP4_INPUT;
oh4->ip_version_and_header_length = 0x45;
@@ -421,7 +424,7 @@ free_buffers_and_exit:
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (odp_crypto_esp_decrypt_node) = {
- .function = esp_decrypt_node_fn,
+ .function = odp_crypto_esp_decrypt_node_fn,
.name = "odp-crypto-esp-decrypt",
.vector_size = sizeof (u32),
.format_trace = format_esp_decrypt_trace,
@@ -439,11 +442,11 @@ VLIB_REGISTER_NODE (odp_crypto_esp_decrypt_node) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (odp_crypto_esp_decrypt_node, esp_decrypt_node_fn)
- static uword
- esp_decrypt_post_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node,
- vlib_frame_t * from_frame)
+VLIB_NODE_FUNCTION_MULTIARCH (odp_crypto_esp_decrypt_node,
+ odp_crypto_esp_decrypt_node_fn)
+ static uword esp_decrypt_post_node_fn (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
u32 n_left_from, *from, *to_next = 0, next_index;
from = vlib_frame_vector_args (from_frame);
diff --git a/src/plugins/odp/ipsec/esp_decrypt_ipsec_api.c b/src/plugins/odp/ipsec/esp_decrypt_ipsec_api.c
index 87427ea..5a1b2d3 100644
--- a/src/plugins/odp/ipsec/esp_decrypt_ipsec_api.c
+++ b/src/plugins/odp/ipsec/esp_decrypt_ipsec_api.c
@@ -79,7 +79,7 @@ format_esp_decrypt_trace (u8 * s, va_list * args)
CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
esp_decrypt_trace_t *t = va_arg (*args, esp_decrypt_trace_t *);
- s = format (s, "(ODP IPsec API) esp: crypto %U integrity %U",
+ s = format (s, "odp-ipsec esp: crypto %U integrity %U",
format_ipsec_crypto_alg, t->crypto_alg,
format_ipsec_integ_alg, t->integ_alg);
return s;
@@ -92,13 +92,14 @@ format_esp_decrypt_post_trace (u8 * s, va_list * args)
CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
- s = format (s, "POST DECRYPT CRYPTO (ODP)");
+ s = format (s, "odp-ipsec post esp (decrypt)");
return s;
}
static uword
-esp_decrypt_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+odp_ipsec_esp_decrypt_node_fn (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;
@@ -196,10 +197,10 @@ esp_decrypt_node_fn (vlib_main_t * vm,
int ret;
- if (!is_async)
- ret = odp_ipsec_in (&pkt, 1, &out_pkt, &processed, &oiopt);
- else
- ret = odp_ipsec_in_enq(&pkt, 1, &oiopt);
+ if (!is_async)
+ ret = odp_ipsec_in (&pkt, 1, &out_pkt, &processed, &oiopt);
+ else
+ ret = odp_ipsec_in_enq (&pkt, 1, &oiopt);
if (ret < 1)
{
@@ -253,7 +254,7 @@ free_buffers_and_exit:
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (odp_ipsec_esp_decrypt_node) = {
- .function = esp_decrypt_node_fn,
+ .function = odp_ipsec_esp_decrypt_node_fn,
.name = "odp-ipsec-esp-decrypt",
.vector_size = sizeof (u32),
.format_trace = format_esp_decrypt_trace,
@@ -270,8 +271,7 @@ VLIB_REGISTER_NODE (odp_ipsec_esp_decrypt_node) = {
},
};
-VLIB_NODE_FUNCTION_MULTIARCH (odp_ipsec_esp_decrypt_node, esp_decrypt_node_fn)
-
+VLIB_NODE_FUNCTION_MULTIARCH (odp_ipsec_esp_decrypt_node, odp_ipsec_esp_decrypt_node_fn)
static uword
esp_decrypt_post_node_fn (vlib_main_t * vm,
vlib_node_runtime_t * node,
diff --git a/src/plugins/odp/ipsec/esp_encrypt.c b/src/plugins/odp/ipsec/esp_encrypt.c
index 4e1d34d..a9caba6 100644
--- a/src/plugins/odp/ipsec/esp_encrypt.c
+++ b/src/plugins/odp/ipsec/esp_encrypt.c
@@ -79,7 +79,7 @@ format_esp_encrypt_trace (u8 * s, va_list * args)
CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
esp_encrypt_trace_t *t = va_arg (*args, esp_encrypt_trace_t *);
- s = format (s, "(ODP) esp: spi %u seq %u crypto %U integrity %U",
+ s = format (s, "odp-crypto esp: spi %u seq %u crypto %U integrity %U",
t->spi, t->seq,
format_ipsec_crypto_alg, t->crypto_alg,
format_ipsec_integ_alg, t->integ_alg);
@@ -93,14 +93,15 @@ format_esp_encrypt_post_trace (u8 * s, va_list * args)
CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
- s = format (s, "POST ENCRYPT CRYPTO (ODP) esp");
+ s = format (s, "odp-crypto post esp (encrypt)");
return s;
}
static uword
-esp_encrypt_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+odp_crypto_esp_encrypt_node_fn (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
u32 n_left_from, *from, *to_next = 0, next_index;
from = vlib_frame_vector_args (from_frame);
@@ -169,7 +170,8 @@ esp_encrypt_node_fn (vlib_main_t * vm,
{
clib_warning ("sequence number counter has cycled SPI %u",
sa0->spi);
- vlib_node_increment_counter (vm, odp_crypto_esp_encrypt_node.index,
+ vlib_node_increment_counter (vm,
+ odp_crypto_esp_encrypt_node.index,
ESP_ENCRYPT_ERROR_SEQ_CYCLED, 1);
//TODO: rekey SA
to_next[0] = bi0;
@@ -452,7 +454,7 @@ free_buffers_and_exit:
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (odp_crypto_esp_encrypt_node) = {
- .function = esp_encrypt_node_fn,
+ .function = odp_crypto_esp_encrypt_node_fn,
.name = "odp-crypto-esp-encrypt",
.vector_size = sizeof (u32),
.format_trace = format_esp_encrypt_trace,
@@ -470,11 +472,11 @@ VLIB_REGISTER_NODE (odp_crypto_esp_encrypt_node) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (odp_crypto_esp_encrypt_node, esp_encrypt_node_fn)
- static uword
- esp_encrypt_post_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node,
- vlib_frame_t * from_frame)
+VLIB_NODE_FUNCTION_MULTIARCH (odp_crypto_esp_encrypt_node,
+ odp_crypto_esp_encrypt_node_fn)
+ static uword esp_encrypt_post_node_fn (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
u32 n_left_from, *from, *to_next = 0, next_index;
from = vlib_frame_vector_args (from_frame);
diff --git a/src/plugins/odp/ipsec/esp_encrypt_ipsec_api.c b/src/plugins/odp/ipsec/esp_encrypt_ipsec_api.c
index 4feaa10..994cd9c 100644
--- a/src/plugins/odp/ipsec/esp_encrypt_ipsec_api.c
+++ b/src/plugins/odp/ipsec/esp_encrypt_ipsec_api.c
@@ -79,7 +79,7 @@ format_esp_encrypt_trace (u8 * s, va_list * args)
CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
esp_encrypt_trace_t *t = va_arg (*args, esp_encrypt_trace_t *);
- s = format (s, "(ODP) esp: spi %u seq %u crypto %U integrity %U",
+ s = format (s, "odp-ipsec esp: spi %u seq %u crypto %U integrity %U",
t->spi, t->seq,
format_ipsec_crypto_alg, t->crypto_alg,
format_ipsec_integ_alg, t->integ_alg);
@@ -93,13 +93,14 @@ format_esp_encrypt_post_trace (u8 * s, va_list * args)
CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
- s = format (s, "POST ENCRYPT CRYPTO (ODP) esp");
+ s = format (s, "odp-ipsec post esp (encrypt)");
return s;
}
static uword
-esp_encrypt_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+odp_ipsec_esp_encrypt_node_fn (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
u32 n_left_from, *from, *to_next = 0, next_index;
from = vlib_frame_vector_args (from_frame);
@@ -328,7 +329,7 @@ free_buffers_and_exit:
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (odp_ipsec_esp_encrypt_node) = {
- .function = esp_encrypt_node_fn,
+ .function = odp_ipsec_esp_encrypt_node_fn,
.name = "odp-ipsec-esp-encrypt",
.vector_size = sizeof (u32),
.format_trace = format_esp_encrypt_trace,
@@ -345,7 +346,7 @@ VLIB_REGISTER_NODE (odp_ipsec_esp_encrypt_node) = {
},
};
-VLIB_NODE_FUNCTION_MULTIARCH (odp_ipsec_esp_encrypt_node, esp_encrypt_node_fn)
+VLIB_NODE_FUNCTION_MULTIARCH (odp_ipsec_esp_encrypt_node, odp_ipsec_esp_encrypt_node_fn)
static uword
esp_encrypt_post_node_fn (vlib_main_t * vm,
vlib_node_runtime_t * node,