osaf/libs/common/avsv/avsv_d2nedu.c | 8 +++++++- osaf/libs/common/avsv/include/avsv_d2nmsg.h | 1 + osaf/services/saf/avsv/avd/avd_util.c | 1 + osaf/services/saf/avsv/avnd/avnd_sudb.c | 5 +++++ osaf/services/saf/avsv/avnd/include/avnd_su.h | 1 + 5 files changed, 15 insertions(+), 1 deletions(-)
When the AMF node director receives the REG_SU message, it reads the saAmfSUFailover attribute from IMM. If IMM does not respond in a timely manner the amfnd process will be aborted and the node restarted. By including su_failover (an int) in the REG_SU msg, the read from IMM can be skipped. diff --git a/osaf/libs/common/avsv/avsv_d2nedu.c b/osaf/libs/common/avsv/avsv_d2nedu.c --- a/osaf/libs/common/avsv/avsv_d2nedu.c +++ b/osaf/libs/common/avsv/avsv_d2nedu.c @@ -575,6 +575,7 @@ uint32_t avsv_edp_su_info_msg(EDU_HDL *h uint32_t rc = NCSCC_RC_SUCCESS; AVSV_SU_INFO_MSG *struct_ptr = NULL, **d_ptr = NULL; uint16_t ver2 = AVSV_AVD_AVND_MSG_FMT_VER_2; + uint16_t ver5 = AVSV_AVD_AVND_MSG_FMT_VER_5; EDU_INST_SET avsv_su_info_msg_rules[] = { {EDU_START, avsv_edp_su_info_msg, EDQ_LNKLIST, 0, 0, @@ -595,11 +596,16 @@ uint32_t avsv_edp_su_info_msg(EDU_HDL *h {EDU_EXEC, ncs_edp_ncs_bool, 0, 0, 0, (long)&((AVSV_SU_INFO_MSG *)0)->is_ncs, 0, NULL}, + /* Include su_is_external in version 2 and higher */ {EDU_VER_GE, NULL, 0, 0, 2, 0, 0, (EDU_EXEC_RTINE)((uint16_t *)(&(ver2)))}, - {EDU_EXEC, ncs_edp_ncs_bool, 0, 0, 0, (long)&((AVSV_SU_INFO_MSG *)0)->su_is_external, 0, NULL}, + /* Include su_failover in version 5 and higher */ + {EDU_VER_GE, NULL, 0, 0, 2, 0, 0, (EDU_EXEC_RTINE)((uint16_t *)(&(ver5)))}, + {EDU_EXEC, ncs_edp_ncs_bool, 0, 0, 0, + (long)&((AVSV_SU_INFO_MSG *)0)->su_failover, 0, NULL}, + {EDU_TEST_LL_PTR, avsv_edp_su_info_msg, 0, 0, 0, (long)&((AVSV_SU_INFO_MSG *)0)->next, 0, NULL}, {EDU_END, 0, 0, 0, 0, 0, 0, NULL}, diff --git a/osaf/libs/common/avsv/include/avsv_d2nmsg.h b/osaf/libs/common/avsv/include/avsv_d2nmsg.h --- a/osaf/libs/common/avsv/include/avsv_d2nmsg.h +++ b/osaf/libs/common/avsv/include/avsv_d2nmsg.h @@ -116,6 +116,7 @@ typedef struct avsv_su_info_msg { uint32_t su_restart_max; bool is_ncs; bool su_is_external; /*indicates if this SU is external */ + bool su_failover; struct avsv_su_info_msg *next; } AVSV_SU_INFO_MSG; diff --git a/osaf/services/saf/avsv/avd/avd_util.c b/osaf/services/saf/avsv/avd/avd_util.c --- a/osaf/services/saf/avsv/avd/avd_util.c +++ b/osaf/services/saf/avsv/avd/avd_util.c @@ -509,6 +509,7 @@ static uint32_t avd_prep_su_info(AVD_CL_ su_info->su_restart_prob = su->sg_of_su->saAmfSGSuRestartProb; su_info->is_ncs = su->sg_of_su->sg_ncs_spec; su_info->su_is_external = su->su_is_external; + su_info->su_failover = su->saAmfSUFailover; su_info->next = su_msg->msg_info.d2n_reg_su.su_list; su_msg->msg_info.d2n_reg_su.su_list = su_info; diff --git a/osaf/services/saf/avsv/avnd/avnd_sudb.c b/osaf/services/saf/avsv/avnd/avnd_sudb.c --- a/osaf/services/saf/avsv/avnd/avnd_sudb.c +++ b/osaf/services/saf/avsv/avnd/avnd_sudb.c @@ -148,6 +148,11 @@ AVND_SU *avnd_sudb_rec_add(AVND_CB *cb, su->is_ncs = info->is_ncs; su->su_is_external = info->su_is_external; + /* SU failover was introduced in director version 6, if the director is + * older then that, read from IMM */ + if (cb->avd_mds_ver >= 6) + su->su_failover = info->su_failover; + /* * Update the rest of the parameters with default values. */ diff --git a/osaf/services/saf/avsv/avnd/include/avnd_su.h b/osaf/services/saf/avsv/avnd/include/avnd_su.h --- a/osaf/services/saf/avsv/avnd/include/avnd_su.h +++ b/osaf/services/saf/avsv/avnd/include/avnd_su.h @@ -157,6 +157,7 @@ typedef struct avnd_su_tag { /* To have the knowledge in AvND if this su belongs to NCS_SG */ bool is_ncs; bool su_is_external; /*indicates if this SU is external */ + bool su_failover; } AVND_SU; ------------------------------------------------------------------------------ _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel