aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-05-30 02:01:55 -0700
committerDave Barach <openvpp@barachs.net>2019-05-30 11:47:23 +0000
commitd37da9004f168c248ba8f4fdc1acd5e0344ae7f6 (patch)
tree26de08521efeff5d2bbcbe2a787121617df60bcc /src/vnet
parent78d91cf9a514cb25f6ea9c901bb7d6c398f5cdc7 (diff)
lisp-cp: start lisp retry service on demand
Change-Id: I07681d94301e19389dda0caacd5a93b21d9aff1f Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/lisp-cp/control.c22
-rw-r--r--src/vnet/lisp-cp/control.h4
2 files changed, 18 insertions, 8 deletions
diff --git a/src/vnet/lisp-cp/control.c b/src/vnet/lisp-cp/control.c
index f8e9c1d5b44..c54ec577fb4 100644
--- a/src/vnet/lisp-cp/control.c
+++ b/src/vnet/lisp-cp/control.c
@@ -2297,6 +2297,9 @@ vnet_lisp_enable_disable (u8 is_enable)
}
}
+ if (is_enable)
+ vnet_lisp_create_retry_process (lcm);
+
/* update global flag */
lcm->is_enabled = is_enable;
@@ -4903,14 +4906,17 @@ vnet_lisp_stats_enable_disable_state (void)
return lcm->flags & LISP_FLAG_STATS_ENABLED;
}
-/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (lisp_retry_service_node,static) = {
- .function = send_map_resolver_service,
- .type = VLIB_NODE_TYPE_PROCESS,
- .name = "lisp-retry-service",
- .process_log2_n_stack_bytes = 16,
-};
-/* *INDENT-ON* */
+void
+vnet_lisp_create_retry_process (lisp_cp_main_t * lcm)
+{
+ if (lcm->retry_service_index)
+ return;
+
+ lcm->retry_service_index = vlib_process_create (vlib_get_main (),
+ "lisp-retry-service",
+ send_map_resolver_service,
+ 16 /* stack_bytes */ );
+}
u32
vnet_lisp_set_transport_protocol (u8 protocol)
diff --git a/src/vnet/lisp-cp/control.h b/src/vnet/lisp-cp/control.h
index d8318b5530c..d3d320abb3e 100644
--- a/src/vnet/lisp-cp/control.h
+++ b/src/vnet/lisp-cp/control.h
@@ -281,6 +281,9 @@ typedef struct
/** either UDP based or binary API. Default is UDP */
lisp_transport_protocol_t transport_protocol;
+ /** Retry service node index */
+ u32 retry_service_index;
+
/* commodity */
ip4_main_t *im4;
ip6_main_t *im6;
@@ -378,6 +381,7 @@ int vnet_lisp_add_del_map_server (ip_address_t * addr, u8 is_add);
clib_error_t *vnet_lisp_enable_disable (u8 is_enabled);
u8 vnet_lisp_enable_disable_status (void);
+void vnet_lisp_create_retry_process (lisp_cp_main_t * lcm);
int vnet_lisp_pitr_set_locator_set (u8 * locator_set_name, u8 is_add);
int vnet_lisp_use_petr (ip_address_t * ip, u8 is_add);