1. This is a preliminary patch. 2. This patch brings complexity of handling multiple csi in one go and has its own repercussions. 3. There may be problem in handling multiple csi addition failures at the same time. 4. Error test cases has not been tested and would wait for test results from reviewers..
Thanks -Nagu > -----Original Message----- > From: Nagendra Kumar > Sent: 11 April 2014 19:47 > To: hans.fe...@ericsson.com; hans.nordeb...@ericsson.com; Praveen Malviya > Cc: opensaf-devel@lists.sourceforge.net > Subject: [devel] [PATCH 1 of 1] amfd: Allow multiple csi addition in single > ccb > [#750] > > osaf/services/saf/avsv/avd/avd_csi.c | 38 > +++++++++++++++++++-------- > osaf/services/saf/avsv/avd/avd_sgproc.c | 12 ++++++++ > osaf/services/saf/avsv/avd/include/avd_csi.h | 1 + > 3 files changed, 40 insertions(+), 11 deletions(-) > > > Problem: Amf rejects csi addition if previous csi addition is in progress. > > Analysis: Amfd can allow csi addition in sequence but can delay applying > subsequent csi addition. > > Fix: Next csi addition are delayed till the first csi addition procers if > finished. > > diff --git a/osaf/services/saf/avsv/avd/avd_csi.c > b/osaf/services/saf/avsv/avd/avd_csi.c > --- a/osaf/services/saf/avsv/avd/avd_csi.c > +++ b/osaf/services/saf/avsv/avd/avd_csi.c > @@ -441,12 +441,8 @@ static SaAisErrorT csi_ccb_completed_cre > t_sisu = avd_si->list_of_sisu; > while(t_sisu) { > if (t_sisu->csi_add_rem == true) { > - LOG_WA("CSI create of '%s' rejected: > pending assignment for '%s'", > + LOG_WA("CSI create of '%s' in queue: > pending assignment for '%s'", > opdata- > >objectName.value, t_sisu->su->name.value); > - if (avd_cb->avail_state_avd == > SA_AMF_HA_ACTIVE) { > - rc = > SA_AIS_ERR_BAD_OPERATION; > - goto done; > - } > } > t_sisu = t_sisu->si_next; > }/* while(t_sisu) */ > @@ -799,15 +795,15 @@ static void csi_ccb_apply_modify_hdlr(st > * Purpose: This routine handles create operations on SaAmfCSI objects. > * > * > - * Input : Ccb Util Oper Data. > + * Input : Ccb Util Oper Data and Csi. > * > - * Returns: None. > + * Returns: OK or NO OP. > * > * NOTES : None. > * > * > > ************************************************************* > *************/ > -static void csi_ccb_apply_create_hdlr(struct CcbUtilOperationData *opdata) > +SaAisErrorT csi_ccb_apply_create_hdlr(struct CcbUtilOperationData > +*opdata, AVD_CSI *avd_csi) > { > AVD_CSI *csi = NULL; > AVD_COMP *t_comp; > @@ -815,7 +811,12 @@ static void csi_ccb_apply_create_hdlr(st > SaBoolT first_sisu = true; > AVD_COMP_CSI_REL *compcsi; > AVD_COMPCS_TYPE *cst; > - > + SaAisErrorT rc = SA_AIS_ERR_NO_OP; > + if (opdata == NULL) { > + csi = avd_csi; > + osafassert(csi != NULL); > + goto csi_addition; > + } > TRACE_ENTER2("CCB ID %llu, '%s'", opdata->ccbId, opdata- > >objectName.value); > > > @@ -826,10 +827,22 @@ static void csi_ccb_apply_create_hdlr(st > csi = csi_create(&opdata->objectName); > } > csi_get_attr_and_add_to_model(csi, opdata->param.create.attrValues, > opdata->param.create.parentName); > - > +csi_addition: > if (avd_cb->avail_state_avd != SA_AMF_HA_ACTIVE) > goto done; > > + if (NULL != csi->si->list_of_sisu) { > + t_sisu = csi->si->list_of_sisu; > + while(t_sisu) { > + if (t_sisu->csi_add_rem == true) { > + LOG_WA("CSI create '%s' delayed: pending > assignment for '%s'", > + opdata->objectName.value, > t_sisu->su->name.value); > + goto done; > + } > + t_sisu = t_sisu->si_next; > + }/* while(t_sisu) */ > + } > + > /* Check whether si has been assigned to any SU. */ > if (NULL != csi->si->list_of_sisu) { > t_sisu = csi->si->list_of_sisu; > @@ -907,6 +920,7 @@ static void csi_ccb_apply_create_hdlr(st > avd_susi_delete(avd_cb, t_sisu, true); > goto done; > } > + rc = SA_AIS_OK; > > } > t_sisu->csi_add_rem = true; > @@ -922,17 +936,19 @@ static void csi_ccb_apply_create_hdlr(st > csi->si->sg_of_si->si_func(avd_cb, csi->si); > } > done: > + return rc; > TRACE_LEAVE(); > } > > static void csi_ccb_apply_cb(CcbUtilOperationData_t *opdata) { > > + SaAisErrorT rc = SA_AIS_OK; > TRACE_ENTER2("CCB ID %llu, '%s'", opdata->ccbId, opdata- > >objectName.value); > > switch (opdata->operationType) { > case CCBUTIL_CREATE: > - csi_ccb_apply_create_hdlr(opdata); > + rc = csi_ccb_apply_create_hdlr(opdata, NULL); > break; > case CCBUTIL_MODIFY: > csi_ccb_apply_modify_hdlr(opdata); > diff --git a/osaf/services/saf/avsv/avd/avd_sgproc.c > b/osaf/services/saf/avsv/avd/avd_sgproc.c > --- a/osaf/services/saf/avsv/avd/avd_sgproc.c > +++ b/osaf/services/saf/avsv/avd/avd_sgproc.c > @@ -533,6 +533,7 @@ void avd_su_si_assign_evh(AVD_CL_CB *cb, > AVD_AVND *node; > AVD_SU *su, *temp_su; > AVD_SU_SI_REL *susi; > + SaAisErrorT rc = SA_AIS_ERR_NO_OP; > bool q_flag = false, qsc_flag = false, all_su_unassigned = true, > all_csi_rem = true; > > TRACE_ENTER2("id:%u, node:%x, act:%u, '%s', '%s', ha:%u, err:%u, > single:%u", @@ -798,6 +799,17 @@ void avd_su_si_assign_evh(AVD_CL_CB > *cb, > } > t_sisu = t_sisu->si_next; > }/* while(t_sisu) */ > + if (t_sisu == NULL) { > + AVD_CSI *temp_csi; > + for (temp_csi = susi->si->list_of_csi; > temp_csi; temp_csi = > + temp_csi- > >si_list_of_csi_next) { > + if (temp_csi->list_compcsi == > NULL) { > + rc = > csi_ccb_apply_create_hdlr(NULL, temp_csi); > + if (rc == SA_AIS_OK) > + goto done; > + } > + } > + } > /* Comsume this message. */ > goto done; > } > diff --git a/osaf/services/saf/avsv/avd/include/avd_csi.h > b/osaf/services/saf/avsv/avd/include/avd_csi.h > --- a/osaf/services/saf/avsv/avd/include/avd_csi.h > +++ b/osaf/services/saf/avsv/avd/include/avd_csi.h > @@ -160,5 +160,6 @@ extern void avd_csi_delete(struct avd_cs extern void > csi_cmplt_delete(struct avd_csi_tag *csi, SaBoolT ckpt); extern AVD_CSI > *csi_create(const SaNameT *csi_name); extern bool > csi_assignment_validate(struct avd_sg_tag *sg); > +extern SaAisErrorT csi_ccb_apply_create_hdlr(struct > +CcbUtilOperationData *opdata, AVD_CSI *csi); > > #endif > > ------------------------------------------------------------------------------ > Put Bad Developers to Shame > Dominate Development with Jenkins Continuous Integration Continuously > Automate Build, Test & Deployment Start a new project now. Try Jenkins in the > cloud. > http://p.sf.net/sfu/13600_Cloudbees > _______________________________________________ > Opensaf-devel mailing list > Opensaf-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/opensaf-devel ------------------------------------------------------------------------------ Put Bad Developers to Shame Dominate Development with Jenkins Continuous Integration Continuously Automate Build, Test & Deployment Start a new project now. Try Jenkins in the cloud. http://p.sf.net/sfu/13600_Cloudbees _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel