@@ -76,6 +76,7 @@ enum init_stage {
NAME_TABLE_INIT,
IPSEC_EVENTS_INIT,
IPSEC_SAD_INIT,
+ IPSEC_INIT,
ALL_INIT /* All init stages completed */
};
@@ -142,6 +143,9 @@ int _odp_ishm_init_local(void);
int _odp_ishm_term_global(void);
int _odp_ishm_term_local(void);
+int _odp_ipsec_init_global(void);
+int _odp_ipsec_term_global(void);
+
int _odp_ipsec_sad_init_global(void);
int _odp_ipsec_sad_term_global(void);
@@ -150,6 +150,12 @@ int odp_init_global(odp_instance_t *instance,
}
stage = IPSEC_SAD_INIT;
+ if (_odp_ipsec_init_global()) {
+ ODP_ERR("ODP IPsec init failed.\n");
+ goto init_failed;
+ }
+ stage = IPSEC_INIT;
+
*instance = (odp_instance_t)odp_global_data.main_pid;
return 0;
@@ -174,6 +180,13 @@ int _odp_term_global(enum init_stage stage)
switch (stage) {
case ALL_INIT:
+ case IPSEC_INIT:
+ if (_odp_ipsec_term_global()) {
+ ODP_ERR("ODP IPsec term failed.\n");
+ rc = -1;
+ }
+ /* Fall through */
+
case IPSEC_SAD_INIT:
if (_odp_ipsec_sad_term_global()) {
ODP_ERR("ODP IPsec SAD term failed.\n");
@@ -1796,3 +1796,16 @@ odp_event_t odp_ipsec_packet_to_event(odp_packet_t pkt)
{
return odp_packet_to_event(pkt);
}
+
+int _odp_ipsec_init_global(void)
+{
+ odp_ipsec_config_init(&ipsec_config);
+
+ return 0;
+}
+
+int _odp_ipsec_term_global(void)
+{
+ /* Do nothing for now */
+ return 0;
+}