osaf/services/saf/amf/amfnd/di.cc |  31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 deletions(-)


When responding to AMFD for any assignment, AMFND should call 
m_AVND_SU_ASSIGN_PEND_RESET(su) only
after checking the assignment states of all SIs in SU. if any SI is still in 
assigning/removing state then
flag should not be reset. Change of this patch is needed in situation when 
AMFND gets per susi level
assignments from AMFD like SI dep related configuration or during fresh 
assignments.

diff --git a/osaf/services/saf/amf/amfnd/di.cc 
b/osaf/services/saf/amf/amfnd/di.cc
--- a/osaf/services/saf/amf/amfnd/di.cc
+++ b/osaf/services/saf/amf/amfnd/di.cc
@@ -505,6 +505,32 @@ uint32_t avnd_di_oper_send(AVND_CB *cb, 
        return rc;
 }
 
+/*
+* @brief       Checks if any SI assigned to SU is in assigning/removing state.
+*
+* @param [in]  ptr to SU
+*
+* @returns     true/false
+*/
+
+static bool avnd_su_all_sis_in_assigned_state(const AVND_SU *su)
+{
+       AVND_SU_SI_REC *curr_si;
+       bool all_csi_assigned = true;
+
+       for (curr_si = (AVND_SU_SI_REC *)m_NCS_DBLIST_FIND_FIRST(&su->si_list);
+                       curr_si && all_csi_assigned;
+                       curr_si = (AVND_SU_SI_REC 
*)m_NCS_DBLIST_FIND_NEXT(&curr_si->su_dll_node)) {
+               if (m_AVND_SU_SI_CURR_ASSIGN_STATE_IS_ASSIGNING(curr_si) ||
+                               
m_AVND_SU_SI_CURR_ASSIGN_STATE_IS_REMOVING(curr_si)) {
+                       all_csi_assigned = false;
+                       break;
+               }
+       }
+
+       return all_csi_assigned;
+}
+
 /****************************************************************************
   Name          : avnd_di_susi_resp_send
  
@@ -529,7 +555,7 @@ uint32_t avnd_di_susi_resp_send(AVND_CB 
        memset(&msg, 0, sizeof(AVND_MSG));
 
        // should be in assignment pending state to be here
-       osafassert(m_AVND_SU_ASSIGN_PEND_SET(su));
+       osafassert(m_AVND_SU_IS_ASSIGN_PEND(su));
 
        /* get the curr-si */
        curr_si = (si) ? si : (AVND_SU_SI_REC 
*)m_NCS_DBLIST_FIND_FIRST(&su->si_list);
@@ -593,7 +619,8 @@ uint32_t avnd_di_susi_resp_send(AVND_CB 
                        msg.info.avd = 0;
 
                /* we have completed the SU SI msg processing */
-               m_AVND_SU_ASSIGN_PEND_RESET(su);
+               if (avnd_su_all_sis_in_assigned_state(su))
+                       m_AVND_SU_ASSIGN_PEND_RESET(su);
                m_AVND_SU_ALL_SI_RESET(su);
                m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, su, 
AVND_CKPT_SU_FLAG_CHANGE);
        } else

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to