Ack

-Nagu

-----Original Message-----
From: Praveen Malviya 
Sent: 29 October 2013 09:56
To: hans.fe...@ericsson.com; Nagendra Kumar
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] amfnd : issue remove cbk to all comps when CSIs are 
unevenly distributed [#233]

 osaf/services/saf/amf/amfnd/comp.cc |  45 ++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 25 deletions(-)


When AMFND gets removal of assignments from AMFD, remove callbacks are issued 
with TARGET_ALL to first level CSIs in reverse order. When components respond 
back to AMFND, remove callbacks are issued for second level CSIs and so on. It 
is found that sometimes callbacks are not issued from second level onwards when 
CSIs are not distributed evenly among components. In such a case removal of 
assignment is not completed and AMFND never sends response to AMFD for removal. 
This patch ensures that remove callbacks are issued to all assigned comps in 
TARGET_ALL case.

diff --git a/osaf/services/saf/amf/amfnd/comp.cc 
b/osaf/services/saf/amf/amfnd/comp.cc
--- a/osaf/services/saf/amf/amfnd/comp.cc
+++ b/osaf/services/saf/amf/amfnd/comp.cc
@@ -1739,33 +1739,28 @@ uint32_t avnd_comp_csi_remove_done(AVND_
                        if (NCSCC_RC_SUCCESS != rc)
                                goto done;
                }
-       } else {                /* assign all the csis belonging to the prv 
rank in one shot */
-               /* get the first csi-record for this comp */
-               curr_csi = 
m_AVND_CSI_REC_FROM_COMP_DLL_NODE_GET(m_NCS_DBLIST_FIND_FIRST(&comp->csi_list));
-               /* get the prv csi */
-               if (curr_csi) {
-find_next:
-                       curr_csi = (AVND_COMP_CSI_REC 
*)m_NCS_DBLIST_FIND_PREV(&curr_csi->si_dll_node);
-                       if (curr_csi) {
-                               if 
(m_AVND_COMP_CSI_CURR_ASSIGN_STATE_IS_REMOVED(curr_csi)) goto find_next;
+       } else {                
+               /* Issue remove callback with TARGET_ALL for CSIs belonging to 
prv rank.*/
+               for (curr_csi = 
m_AVND_CSI_REC_FROM_COMP_DLL_NODE_GET(m_NCS_DBLIST_FIND_FIRST(&comp->csi_list));
+                       curr_csi;
+                       curr_csi = 
m_AVND_CSI_REC_FROM_COMP_DLL_NODE_GET(m_NCS_DBLIST_FIND_NEXT(&curr_csi->comp_dll_node)))
 {
+                       for (AVND_COMP_CSI_REC *csi = (AVND_COMP_CSI_REC 
*)m_NCS_DBLIST_FIND_PREV(&curr_csi->si_dll_node);
+                                       csi;
+                                       csi = (AVND_COMP_CSI_REC 
*)m_NCS_DBLIST_FIND_PREV(&csi->si_dll_node)) {
+                               if 
(m_AVND_COMP_CSI_CURR_ASSIGN_STATE_IS_REMOVED(csi)) 
+                                       continue;
+                               else {
+                                       /* remove all the csis belonging to 
this comp */
+                                       rc = avnd_comp_csi_remove(cb, 
csi->comp, 0);
+                                       break;
+                               }
                        }
                }
-               else {
-                       /* csi rec is already deleted, so SI rec would also 
have been deleted
-                        *  we are already done with rmv operation, just quit
-                        */
-                       goto done;
-               }
-
-               /* remove all the csis belonging to this comp */
-               if (curr_csi){
-                       rc = avnd_comp_csi_remove(cb, curr_csi->comp, 0);
-               }
-               else {
-                       /* su operation doone if all csis in all sis of su are 
in removed state*/
-                       if(all_csis_in_removed_state(comp->su)) {
-                               rc = avnd_su_si_oper_done(cb, comp->su, 0);
-                       }
+
+               /* This is removal with TARGET_ALL. So if all CSIs in all SIs 
of SU are moved 
+                  to removed state, mark all SIs removed and inform AMF 
director.*/
+               if (all_csis_in_removed_state(comp->su) && 
m_AVND_SU_IS_ALL_SI(comp->su)) {
+                       rc = avnd_su_si_oper_done(cb, comp->su, 0);
                }
        }
 

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to