[devel] [PATCH 0 of 1] Review Request for amf refactoring app, csi v5 [#713]

2014-01-17 Thread Hans Nordeback
Summary: use template class to replace all patricia tree db
Review request for Trac Ticket(s): #713
Peer Reviewer(s): HansF, Nagu, Praveen
Pull request to: 
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-
 EXPLAIN/COMMENT THE PATCH SERIES HERE

changeset bac12675101c169096e71da81c044a3943eaa681
Author: Hans Nordeback hans.nordeb...@ericsson.com
Date:   Fri, 17 Jan 2014 09:32:20 +0100

amfd: use stl::map in app, csi, ... v5 [#713]

use template class AmfDb to replace all patricia tree db


Added Files:

 osaf/services/saf/amf/amfd/include/db.h


Complete diffstat:
--
 osaf/services/saf/amf/amfd/app.cc|  24 ++--
 osaf/services/saf/amf/amfd/ckpt_enc.cc   |   4 +++-
 osaf/services/saf/amf/amfd/csi.cc|  24 ++--
 osaf/services/saf/amf/amfd/include/app.h |  22 ++
 osaf/services/saf/amf/amfd/include/csi.h |  14 ++
 osaf/services/saf/amf/amfd/include/db.h  |  64 

 osaf/services/saf/amf/amfd/util.cc   |   5 +++--
 7 files changed, 78 insertions(+), 79 deletions(-)


Testing Commands:
-
 LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES


Testing, Expected Results:
--
 PASTE COMMAND OUTPUTS / TEST RESULTS


Conditions of Submission:
-
 HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk

[devel] [PATCH 0 of 1] Review Request for amf: amfd to exit immediately upon receiving local amfnd down [#728]

2014-01-17 Thread mathi . naickan
Summary: amf: amfd to exit immediately upon receiving local amfnd down [#728] 
Review request for Trac Ticket(s): #728
Peer Reviewer(s): Hans, Nagendra
Pull request to: LIST THE PERSON WITH PUSH ACCESS HERE
Affected branch(es): opensaf-4.4.x, default
Development branch: IF ANY GIVE THE REPO URL


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-
Failover detection/processing is quicker from 4.4 onwards because FM now acts
upon AMFND down. This patch makes amfd exit immediately after amfnd down.

changeset 089a1b23dcf15fc4440de98d05b69f8e8575cd66
Author: Mathivanan N.P.mathi.naic...@oracle.com
Date:   Fri, 17 Jan 2014 14:17:54 +0530

amf: amfd to exit immediately upon receiving local amfnd down [#728] 
Today
amfd exits when the /etc/init.d/opensafd script invokes osaf-amfd 
clc-cli
script. This delayed exit can cause two problems 1) amfd exit can 
create a
race with dtmd exit 2) The delayed exit can create problems during 
failover
like say the amfd on the new active becomes functionally active and the 
old
active still has a stale amfd. The patch makes AMFD exit immediately 
upon
recieving amfnd down event.


Complete diffstat:
--
 osaf/services/saf/amf/amfd/ndfsm.cc |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)


Testing Commands:
-
1) perform failover/reverse-failover on TIPC/TCP with amf demo.
2) perform failover/reverse-failover on TIPC/TCP without amf demo.


Testing, Expected Results:
--
Failover should succeed without any problems.

Conditions of Submission:
-
Ack from Nagendra, HansF

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get 

[devel] [PATCH 1 of 1] amf: amfd to exit immediately upon receiving local amfnd down [#728]

2014-01-17 Thread mathi . naickan
 osaf/services/saf/amf/amfd/ndfsm.cc |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)


Today amfd exits when the /etc/init.d/opensafd script invokes osaf-amfd clc-cli 
script.
This delayed exit can cause two problems 1) amfd exit can create a race with 
dtmd exit
2) The delayed exit can create problems during failover like say the amfd on 
the new active
becomes functionally active and the old active still has a stale amfd.
The patch makes AMFD exit immediately upon recieving amfnd down event.

diff --git a/osaf/services/saf/amf/amfd/ndfsm.cc 
b/osaf/services/saf/amf/amfd/ndfsm.cc
--- a/osaf/services/saf/amf/amfd/ndfsm.cc
+++ b/osaf/services/saf/amf/amfd/ndfsm.cc
@@ -27,6 +27,7 @@
 
 #include amfd.h
 #include cluster.h
+#include daemon.h
 
 /*
  * Function: avd_node_up_func
@@ -321,7 +322,8 @@ void avd_mds_avnd_down_evh(AVD_CL_CB *cb
// Do nothing if the local node goes down. Most likely due to 
system shutdown.
// If node director goes down due to a bug, the AMF watchdog 
will restart the node.
if (node-node_info.nodeId == cb-node_id_avd) {
-   TRACE(Ignoring down event for local node director);
+   LOG_NO(exiting (local AMFND down));
+   _Exit(0);
goto done;
}
 

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 2] Review Request for amf refactoring v6 [#713]

2014-01-17 Thread Hans Nordeback
Summary: use template class to replace patricia tree db
Review request for Trac Ticket(s): #713
Peer Reviewer(s): HansF, Nagu, Praveen
Pull request to: 
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-
 EXPLAIN/COMMENT THE PATCH SERIES HERE

changeset af8b73a1a2c2cf41ad6f9b7d7406b549e6d58038
Author: Hans Nordeback hans.nordeb...@ericsson.com
Date:   Fri, 17 Jan 2014 10:12:17 +0100

amfd: use template class db to replace patricia tree db [#713]

changeset eacf398c3b352f7c02475ce125f1cfd2f1753f55
Author: Hans Nordeback hans.nordeb...@ericsson.com
Date:   Fri, 17 Jan 2014 10:43:05 +0100

amfd: use db_template for the csi db [#713]


Added Files:

 osaf/services/saf/amf/amfd/include/db_template.h


Complete diffstat:
--
 osaf/services/saf/amf/amfd/csi.cc|  20 +---
 osaf/services/saf/amf/amfd/include/csi.h |   5 +++--
 osaf/services/saf/amf/amfd/include/db_template.h |  63 
+++
 3 files changed, 75 insertions(+), 13 deletions(-)


Testing Commands:
-
 LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES


Testing, Expected Results:
--
 PASTE COMMAND OUTPUTS / TEST RESULTS


Conditions of Submission:
-
 HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net

[devel] [PATCH 2 of 2] amfd: use db_template for the csi db [#713]

2014-01-17 Thread Hans Nordeback
 osaf/services/saf/amf/amfd/csi.cc|  20 +---
 osaf/services/saf/amf/amfd/include/csi.h |   5 +++--
 2 files changed, 12 insertions(+), 13 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/csi.cc 
b/osaf/services/saf/amf/amfd/csi.cc
--- a/osaf/services/saf/amf/amfd/csi.cc
+++ b/osaf/services/saf/amf/amfd/csi.cc
@@ -24,7 +24,7 @@
 #include imm.h
 #include proc.h
 
-static NCS_PATRICIA_TREE csi_db;
+AmfDbAVD_CSI *csi_db = 0;
 
 void avd_csi_delete(AVD_CSI *csi)
 {
@@ -42,8 +42,8 @@ void avd_csi_delete(AVD_CSI *csi)
avd_cstype_remove_csi(csi);
avd_si_remove_csi(csi);
 
-   rc = ncs_patricia_tree_del(csi_db, csi-tree_node);
-   osafassert(rc == NCSCC_RC_SUCCESS);
+   csi_db-erase(csi);
+
delete csi;
TRACE_LEAVE2();
 }
@@ -74,8 +74,8 @@ AVD_CSI *avd_csi_get(const SaNameT *dn)
 
tmp.length = dn-length;
memcpy(tmp.value, dn-value, tmp.length);
-   
-   return (AVD_CSI *)ncs_patricia_tree_get(csi_db, (uint8_t *)tmp);
+
+   return csi_db-find(tmp);
 }
 
 /**
@@ -260,8 +260,9 @@ AVD_CSI *csi_create(const SaNameT *csi_n
csi-name.length = csi_name-length;
csi-tree_node.key_info = (uint8_t *)(csi-name);
 
-   if (ncs_patricia_tree_add(csi_db, csi-tree_node) != NCSCC_RC_SUCCESS)
-   osafassert(0);
+   if (csi_db-find(csi-name) == NULL) {
+   csi_db-insert(csi);
+   }
 
return csi;
 }
@@ -1238,10 +1239,7 @@ void avd_csi_add_csiattr(AVD_CSI *csi, A
 
 void avd_csi_constructor(void)
 {
-   NCS_PATRICIA_PARAMS patricia_params;
-
-   patricia_params.key_size = sizeof(SaNameT);
-   osafassert(ncs_patricia_tree_init(csi_db, patricia_params) == 
NCSCC_RC_SUCCESS);
+   csi_db = new AmfCsiDbAVD_CSI;
avd_class_impl_set(const_castSaImmClassNameT(SaAmfCSI), NULL, NULL, 
csi_ccb_completed_cb, csi_ccb_apply_cb);
 }
 
diff --git a/osaf/services/saf/amf/amfd/include/csi.h 
b/osaf/services/saf/amf/amfd/include/csi.h
--- a/osaf/services/saf/amf/amfd/include/csi.h
+++ b/osaf/services/saf/amf/amfd/include/csi.h
@@ -37,6 +37,7 @@
 #include susi.h
 #include comp.h
 #include pg.h
+#include db_template.h
 
 /* The attribute value structure for the CSIs. */
 typedef struct avd_csi_attr_tag {
@@ -54,8 +55,6 @@ typedef struct avd_csi_deps_tag {
  * associated with the CSI on the AvD.
  */
 typedef struct avd_csi_tag {
-   NCS_PATRICIA_NODE tree_node;/* key will be the CSI name */
-
SaNameT name;
SaNameT saAmfCSType;
AVD_CSI_DEPS *saAmfCSIDependencies; /* list of all CSI dependencies for 
this CSI */
@@ -83,6 +82,8 @@ typedef struct avd_csi_tag {
   from * current SI being assigned */
 } AVD_CSI;
 
+extern AmfDbAVD_CSI *csi_db;
+
 typedef struct avd_cstype {
NCS_PATRICIA_NODE tree_node;/* key is name */
SaNameT name;   /* name of the CSType */

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 2] amfd: use template class db to replace patricia tree db [#713]

2014-01-17 Thread Hans Nordeback
 osaf/services/saf/amf/amfd/include/db_template.h |  63 
 1 files changed, 63 insertions(+), 0 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/include/db_template.h 
b/osaf/services/saf/amf/amfd/include/db_template.h
new file mode 100644
--- /dev/null
+++ b/osaf/services/saf/amf/amfd/include/db_template.h
@@ -0,0 +1,63 @@
+/*  -*- OpenSAF  -*-
+ *
+ * (C) Copyright 2014 The OpenSAF Foundation
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+ * under the GNU Lesser General Public License Version 2.1, February 1999.
+ * The complete license can be accessed from the following location:
+ * http://opensource.org/licenses/lgpl-license.php
+ * See the Copying file included with the OpenSAF distribution for full
+ * licensing terms.
+ *
+ * Author(s): Ericsson AB
+ *
+ */
+#ifndef DB_TEMPLATE_H
+#defineDB_TEMPLATE_H
+
+#include map
+#include string
+
+template typename T
+class AmfDb {
+  public:
+   void insert(T *obj);
+   void erase(T *obj);
+   T *find(const SaNameT *name);
+   
+   typedef std::mapstd::string, T* AmfDbMap;
+   typedef typename AmfDbMap::const_iterator const_iterator;
+
+   const_iterator begin() const {return db.begin();}
+   const_iterator end() const {return db.end();}
+
+  private:
+   AmfDbMap db;
+};
+
+template typename T
+void AmfDbT::insert(T *obj) {
+  std::string name((const char*)obj-name.value, obj-name.length);
+  db[name] = obj;
+}
+
+template typename T
+void AmfDbT::erase(T *obj) {
+  std::string name((const char*)obj-name.value, obj-name.length);
+  typename AmfDbMap::iterator it = db.find(name);
+  db.erase(it);
+}
+
+template typename T
+T *AmfDbT::find(const SaNameT *dn) {
+  std::string name((const char*)dn-value, dn-length);
+  typename AmfDbMap::iterator it = db.find(name);
+  if (it == db.end())
+return NULL;
+  else
+return it-second;
+}
+
+#endif /* DB_TEMPLATE_H */

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 2 of 2] amfd: use db_template for the csi db [#713]

2014-01-17 Thread Hans Nordeback
 osaf/services/saf/amf/amfd/csi.cc|  22 ++
 osaf/services/saf/amf/amfd/include/csi.h |   5 +++--
 2 files changed, 13 insertions(+), 14 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/csi.cc 
b/osaf/services/saf/amf/amfd/csi.cc
--- a/osaf/services/saf/amf/amfd/csi.cc
+++ b/osaf/services/saf/amf/amfd/csi.cc
@@ -24,12 +24,12 @@
 #include imm.h
 #include proc.h
 
-static NCS_PATRICIA_TREE csi_db;
+AmfDbAVD_CSI *csi_db = 0;
 
 void avd_csi_delete(AVD_CSI *csi)
 {
AVD_CSI_ATTR *temp;
-   unsigned int rc;
+
TRACE_ENTER2(%s, csi-name.value);
 
/* Delete CSI attributes */
@@ -42,8 +42,8 @@ void avd_csi_delete(AVD_CSI *csi)
avd_cstype_remove_csi(csi);
avd_si_remove_csi(csi);
 
-   rc = ncs_patricia_tree_del(csi_db, csi-tree_node);
-   osafassert(rc == NCSCC_RC_SUCCESS);
+   csi_db-erase(csi);
+
delete csi;
TRACE_LEAVE2();
 }
@@ -74,8 +74,8 @@ AVD_CSI *avd_csi_get(const SaNameT *dn)
 
tmp.length = dn-length;
memcpy(tmp.value, dn-value, tmp.length);
-   
-   return (AVD_CSI *)ncs_patricia_tree_get(csi_db, (uint8_t *)tmp);
+
+   return csi_db-find(tmp);
 }
 
 /**
@@ -258,10 +258,10 @@ AVD_CSI *csi_create(const SaNameT *csi_n
csi = new AVD_CSI();
memcpy(csi-name.value, csi_name-value, csi_name-length);
csi-name.length = csi_name-length;
-   csi-tree_node.key_info = (uint8_t *)(csi-name);
 
-   if (ncs_patricia_tree_add(csi_db, csi-tree_node) != NCSCC_RC_SUCCESS)
-   osafassert(0);
+   if (csi_db-find(csi-name) == NULL) {
+   csi_db-insert(csi);
+   }
 
return csi;
 }
@@ -1238,10 +1238,8 @@ void avd_csi_add_csiattr(AVD_CSI *csi, A
 
 void avd_csi_constructor(void)
 {
-   NCS_PATRICIA_PARAMS patricia_params;
+   csi_db = new AmfDbAVD_CSI;
 
-   patricia_params.key_size = sizeof(SaNameT);
-   osafassert(ncs_patricia_tree_init(csi_db, patricia_params) == 
NCSCC_RC_SUCCESS);
avd_class_impl_set(const_castSaImmClassNameT(SaAmfCSI), NULL, NULL, 
csi_ccb_completed_cb, csi_ccb_apply_cb);
 }
 
diff --git a/osaf/services/saf/amf/amfd/include/csi.h 
b/osaf/services/saf/amf/amfd/include/csi.h
--- a/osaf/services/saf/amf/amfd/include/csi.h
+++ b/osaf/services/saf/amf/amfd/include/csi.h
@@ -37,6 +37,7 @@
 #include susi.h
 #include comp.h
 #include pg.h
+#include db_template.h
 
 /* The attribute value structure for the CSIs. */
 typedef struct avd_csi_attr_tag {
@@ -54,8 +55,6 @@ typedef struct avd_csi_deps_tag {
  * associated with the CSI on the AvD.
  */
 typedef struct avd_csi_tag {
-   NCS_PATRICIA_NODE tree_node;/* key will be the CSI name */
-
SaNameT name;
SaNameT saAmfCSType;
AVD_CSI_DEPS *saAmfCSIDependencies; /* list of all CSI dependencies for 
this CSI */
@@ -83,6 +82,8 @@ typedef struct avd_csi_tag {
   from * current SI being assigned */
 } AVD_CSI;
 
+extern AmfDbAVD_CSI *csi_db;
+
 typedef struct avd_cstype {
NCS_PATRICIA_NODE tree_node;/* key is name */
SaNameT name;   /* name of the CSType */

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 2] Review Request for amf refactoring v7 [#713]

2014-01-17 Thread Hans Nordeback
Summary: use template class to replace patricia tree db
Review request for Trac Ticket(s): #713
Peer Reviewer(s): HansF, Nagu, Praveen
Pull request to: 
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-
 EXPLAIN/COMMENT THE PATCH SERIES HERE

changeset af8b73a1a2c2cf41ad6f9b7d7406b549e6d58038
Author: Hans Nordeback hans.nordeb...@ericsson.com
Date:   Fri, 17 Jan 2014 10:12:17 +0100

amfd: use template class db to replace patricia tree db [#713]

changeset cf73b72267ec107cf5054978393ab4a88ee219d6
Author: Hans Nordeback hans.nordeb...@ericsson.com
Date:   Fri, 17 Jan 2014 10:59:24 +0100

amfd: use db_template for the csi db [#713]


Added Files:

 osaf/services/saf/amf/amfd/include/db_template.h


Complete diffstat:
--
 osaf/services/saf/amf/amfd/csi.cc|  22 ++
 osaf/services/saf/amf/amfd/include/csi.h |   5 +++--
 osaf/services/saf/amf/amfd/include/db_template.h |  63 
+++
 3 files changed, 76 insertions(+), 14 deletions(-)


Testing Commands:
-
 LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES


Testing, Expected Results:
--
 PASTE COMMAND OUTPUTS / TEST RESULTS


Conditions of Submission:
-
 HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net

Re: [devel] [PATCH 1 of 2] amfd: use template class db to replace patricia tree db [#713]

2014-01-17 Thread Anders Björnerstedt
Since you are rewriting the internal database for AMFD, could you try to 
avoid using the SaNameT type in this new representation ?
I mean these are internal structures so you dont need to use SaNameT here.
We are trying to find a way to move away from the troublesome SaNameT type, in 
general.

/AndersBj

-Original Message-
From: Hans Nordeback [mailto:hans.nordeb...@ericsson.com] 
Sent: den 17 januari 2014 11:03
To: Hans Feldt; praveen.malv...@oracle.com; nagendr...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 1 of 2] amfd: use template class db to replace patricia 
tree db [#713]

 osaf/services/saf/amf/amfd/include/db_template.h |  63 
 1 files changed, 63 insertions(+), 0 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/include/db_template.h 
b/osaf/services/saf/amf/amfd/include/db_template.h
new file mode 100644
--- /dev/null
+++ b/osaf/services/saf/amf/amfd/include/db_template.h
@@ -0,0 +1,63 @@
+/*  -*- OpenSAF  -*-
+ *
+ * (C) Copyright 2014 The OpenSAF Foundation
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of 
+MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are 
+licensed
+ * under the GNU Lesser General Public License Version 2.1, February 1999.
+ * The complete license can be accessed from the following location:
+ * http://opensource.org/licenses/lgpl-license.php
+ * See the Copying file included with the OpenSAF distribution for full
+ * licensing terms.
+ *
+ * Author(s): Ericsson AB
+ *
+ */
+#ifndef DB_TEMPLATE_H
+#defineDB_TEMPLATE_H
+
+#include map
+#include string
+
+template typename T
+class AmfDb {
+  public:
+   void insert(T *obj);
+   void erase(T *obj);
+   T *find(const SaNameT *name);
+   
+   typedef std::mapstd::string, T* AmfDbMap;
+   typedef typename AmfDbMap::const_iterator const_iterator;
+
+   const_iterator begin() const {return db.begin();}
+   const_iterator end() const {return db.end();}
+
+  private:
+   AmfDbMap db;
+};
+
+template typename T
+void AmfDbT::insert(T *obj) {
+  std::string name((const char*)obj-name.value, obj-name.length);
+  db[name] = obj;
+}
+
+template typename T
+void AmfDbT::erase(T *obj) {
+  std::string name((const char*)obj-name.value, obj-name.length);
+  typename AmfDbMap::iterator it = db.find(name);
+  db.erase(it);
+}
+
+template typename T
+T *AmfDbT::find(const SaNameT *dn) {
+  std::string name((const char*)dn-value, dn-length);
+  typename AmfDbMap::iterator it = db.find(name);
+  if (it == db.end())
+return NULL;
+  else
+return it-second;
+}
+
+#endif /* DB_TEMPLATE_H */

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical 
Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for osaf: increase csisetcallback timeout for services using saflog (CLM, NTF)[#720]

2014-01-17 Thread mathi . naickan
Summary: osaf: increase csisetcallback timeout for services using saflog (CLM, 
NTF)[#720]
Review request for Trac Ticket(s): #720
Peer Reviewer(s): praveen, ramesh 
Pull request to: LIST THE PERSON WITH PUSH ACCESS HERE
Affected branch(es): 4.2, 4.3 
Development branch: IF ANY GIVE THE REPO URL


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-
See below. This change is not necessary in newer releases because
the a separate thread for file operations has been introduced in LGS.

changeset 00896f749ea98c70cbe8e1b292992c2609c203e9
Author: Mathivanan N.P.mathi.naic...@oracle.com
Date:   Fri, 17 Jan 2014 16:07:55 +0530

osaf: increase csisetcallback timeout for services using saflog (CLM, 
NTF)
[#720] It has been observed (in pre 4.4) on field that a client of LOG 
(in
the specific case - CLM, but in general all LOG API users) can get 
blocked
when calling saflog() or LOG() because the LGS was busy doing a file
operation. The current MDS API timeout is 10 seconds and the 
csisetcallback
timeout for all(except SMF has about 30 seconds) services is 10 
seconds. in
the worst case scenario, the saflog() internal utility can take 30 
seconds
before returning, i.e. saflog internally calls three synchronous apis. 
This
patch changes the csisetcallback timeout to 40 seconds.


Complete diffstat:
--
 osaf/services/saf/clmsv/config/clmsv_objects.xml |  4 ++--
 osaf/services/saf/ntfsv/config/ntfsv_objects.xml |  2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--


Conditions of Submission:
-
Ack from Praveen(ntfsv) and Ramesh(clm)

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing 

Re: [devel] [PATCH 1 of 2] amfd: use template class db to replace patricia tree db [#713]

2014-01-17 Thread Anders Björnerstedt
Just use std:string directly instead of SaNameT.

/AndersBj

-Original Message-
From: Anders Björnerstedt [mailto:anders.bjornerst...@ericsson.com] 
Sent: den 17 januari 2014 11:10
To: Hans Nordebäck; Hans Feldt; praveen.malv...@oracle.com; 
nagendr...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 1 of 2] amfd: use template class db to replace 
patricia tree db [#713]

Since you are rewriting the internal database for AMFD, could you try to avoid 
using the SaNameT type in this new representation ?
I mean these are internal structures so you dont need to use SaNameT here.
We are trying to find a way to move away from the troublesome SaNameT type, in 
general.

/AndersBj

-Original Message-
From: Hans Nordeback [mailto:hans.nordeb...@ericsson.com]
Sent: den 17 januari 2014 11:03
To: Hans Feldt; praveen.malv...@oracle.com; nagendr...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 1 of 2] amfd: use template class db to replace patricia 
tree db [#713]

 osaf/services/saf/amf/amfd/include/db_template.h |  63 
 1 files changed, 63 insertions(+), 0 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/include/db_template.h 
b/osaf/services/saf/amf/amfd/include/db_template.h
new file mode 100644
--- /dev/null
+++ b/osaf/services/saf/amf/amfd/include/db_template.h
@@ -0,0 +1,63 @@
+/*  -*- OpenSAF  -*-
+ *
+ * (C) Copyright 2014 The OpenSAF Foundation
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of 
+MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are 
+licensed
+ * under the GNU Lesser General Public License Version 2.1, February 1999.
+ * The complete license can be accessed from the following location:
+ * http://opensource.org/licenses/lgpl-license.php
+ * See the Copying file included with the OpenSAF distribution for full
+ * licensing terms.
+ *
+ * Author(s): Ericsson AB
+ *
+ */
+#ifndef DB_TEMPLATE_H
+#defineDB_TEMPLATE_H
+
+#include map
+#include string
+
+template typename T
+class AmfDb {
+  public:
+   void insert(T *obj);
+   void erase(T *obj);
+   T *find(const SaNameT *name);
+   
+   typedef std::mapstd::string, T* AmfDbMap;
+   typedef typename AmfDbMap::const_iterator const_iterator;
+
+   const_iterator begin() const {return db.begin();}
+   const_iterator end() const {return db.end();}
+
+  private:
+   AmfDbMap db;
+};
+
+template typename T
+void AmfDbT::insert(T *obj) {
+  std::string name((const char*)obj-name.value, obj-name.length);
+  db[name] = obj;
+}
+
+template typename T
+void AmfDbT::erase(T *obj) {
+  std::string name((const char*)obj-name.value, obj-name.length);
+  typename AmfDbMap::iterator it = db.find(name);
+  db.erase(it);
+}
+
+template typename T
+T *AmfDbT::find(const SaNameT *dn) {
+  std::string name((const char*)dn-value, dn-length);
+  typename AmfDbMap::iterator it = db.find(name);
+  if (it == db.end())
+return NULL;
+  else
+return it-second;
+}
+
+#endif /* DB_TEMPLATE_H */

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical 
Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical 
Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 1] Review Request for IMMTEST: add new test cases for NO_DANGLING flag [#636]

2014-01-17 Thread Neelakanta Reddy
Hi zoran,

The patch introduces ImmOmInitialize failures.

  4  FAILEDsaImmOmInitialize - SA_AIS_ERR_VERSION - uninitialized 
version (expected SA_AIS_ERR_VERSION, got SA_AIS_ERR_FAILED_OPERATION)
 Minor version not set correctly as out param expected 12 got 13
 5  FAILEDsaImmOmInitialize - SA_AIS_ERR_VERSION - too high 
release level (expected SA_AIS_ERR_VERSION, got SA_AIS_ERR_FAILED_OPERATION)
 Minor version not set correctly as out param expected 12 got 13
 6  FAILEDsaImmOmInitialize - SA_AIS_OK - minor version set to 2 
(expected SA_AIS_OK, got SA_AIS_ERR_FAILED_OPERATION)
 Minor version not set correctly as out param expected 12 got 13
 7  FAILEDsaImmOmInitialize - SA_AIS_ERR_VERSION - major version 
set to 3 (expected SA_AIS_ERR_VERSION, got SA_AIS_ERR_FAILED_OPERATION)
 Minor version not set correctly as out param expected 12 got 13
 8  FAILEDsaImmOmInitialize - SA_AIS_ERR_VERSION - B.3.99 
requested (expected SA_AIS_ERR_VERSION, got SA_AIS_ERR_FAILED_OPERATION)
 Minor version not set correctly as out param expected 12 got 13
 9  FAILEDsaImmOmInitialize - SA_AIS_ERR_VERSION - A.1.1 
requested (expected SA_AIS_ERR_VERSION, got SA_AIS_ERR_FAILED_OPERATION)
 Minor version not set correctly as out param expected 12 got 13
10  FAILEDsaImmOmInitialize - SA_AIS_OK - A.2.99 requested 
(expected SA_AIS_OK, got SA_AIS_ERR_FAILED_OPERATION)
 Minor version not set correctly as out param expected 12 got 13
11  FAILEDsaImmOmInitialize - SA_AIS_ERR_VERSION - A.2.1 
requested on _o2 (expected SA_AIS_ERR_VERSION, got 
SA_AIS_ERR_FAILED_OPERATION)


/Neel.


On Thursday 16 January 2014 05:22 PM, Zoran Milinkovic wrote:
 Summary: IMMTEST: add new test cases for NO_DANGLING flag [#636]
 Review request for Trac Ticket(s): 636
 Peer Reviewer(s): Neelakanta
 Pull request to: Zoran
 Affected branch(es): opensaf-4.4.x, default(4.5)
 Development branch: default(4.5)

 
 Impacted area   Impact y/n
 
   Docsn
   Build systemn
   RPM/packaging   n
   Configuration files n
   Startup scripts n
   SAF servicesn
   OpenSAF servicesn
   Core libraries  n
   Samples n
   Tests   y
   Other   n


 Comments (indicate scope for each y above):
 -

 changeset 2712ca2144d20f371dc462264ba722e6eb82031f
 Author:   Zoran Milinkovic zoran.milinko...@ericsson.com
 Date: Thu, 16 Jan 2014 12:48:29 +0100

   IMMTEST: add new test cases for NO_DANGLING flag [#636]


 Complete diffstat:
 --
   tests/immsv/common/immtest.c   |  145 
 +++-
   tests/immsv/common/immtest.h   |   23 ++
   tests/immsv/implementer/test_saImmOiAugmentCcbInitialize.c |   26 +-
   tests/immsv/management/test_cleanup.c  |6 ++-
   tests/immsv/management/test_saImmOmCcbInitialize.c |   38 
 
   tests/immsv/management/test_saImmOmCcbObjectCreate_2.c |  328 
 ++
   tests/immsv/management/test_saImmOmCcbObjectDelete.c   |  262 
 
   tests/immsv/management/test_saImmOmCcbObjectModify_2.c |  234 
 
   tests/immsv/management/test_saImmOmClassCreate_2.c |   36 
 
   tests/immsv/management/test_saImmOmClassDescriptionGet_2.c |   35 
 +++
   10 files changed, 1116 insertions(+), 17 deletions(-)


 Testing Commands:
 -
 immomtest


 Testing, Expected Results:
 --
 All tests must pass


 Conditions of Submission:
 -
 Ack from Neelakanta


 Arch  Built StartedLinux distro
 ---
 mipsn  n
 mips64  n  n
 x86 n  n
 x86_64  n  n
 powerpc n  n
 powerpc64   n  n


 Reviewer Checklist:
 ---
 [Submitters: make sure that your review doesn't trigger any checkmarks!]


 Your checkin has not passed review because (see checked entries):

 ___ Your RR template is generally incomplete; it has too many blank entries
  that need proper data filled in.

 ___ You have failed to nominate the proper persons for review and push.

 ___ Your patches do not have proper short+long header

 ___ You have grammar/spelling in your header that is unacceptable.

 ___ You have exceeded a 

Re: [devel] [PATCH 1 of 2] amfd: use template class db to replace patricia tree db [#713]

2014-01-17 Thread Anders Bjornerstedt
Ok but it would not be wrong even if your focus is on conversion to c++ 
here, if the new
c++ code just happened not to use SaNameT at that inner level. Just 
saves time long term
without causing any problem.

/AndersBj

Hans Feldt wrote:
 Yes we are aware of that, just trying to do one logical thing at a
 time. First item was to remove use of patricia trees.
 /HansF

 On 17 January 2014 11:42, Anders Björnerstedt
 anders.bjornerst...@ericsson.com wrote:
   
 Just use std:string directly instead of SaNameT.

 /AndersBj

 -Original Message-
 From: Anders Björnerstedt [mailto:anders.bjornerst...@ericsson.com]
 Sent: den 17 januari 2014 11:10
 To: Hans Nordebäck; Hans Feldt; praveen.malv...@oracle.com; 
 nagendr...@oracle.com
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: Re: [devel] [PATCH 1 of 2] amfd: use template class db to replace 
 patricia tree db [#713]

 Since you are rewriting the internal database for AMFD, could you try to 
 avoid using the SaNameT type in this new representation ?
 I mean these are internal structures so you dont need to use SaNameT here.
 We are trying to find a way to move away from the troublesome SaNameT type, 
 in general.

 /AndersBj

 -Original Message-
 From: Hans Nordeback [mailto:hans.nordeb...@ericsson.com]
 Sent: den 17 januari 2014 11:03
 To: Hans Feldt; praveen.malv...@oracle.com; nagendr...@oracle.com
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: [devel] [PATCH 1 of 2] amfd: use template class db to replace 
 patricia tree db [#713]

  osaf/services/saf/amf/amfd/include/db_template.h |  63 
 
  1 files changed, 63 insertions(+), 0 deletions(-)


 diff --git a/osaf/services/saf/amf/amfd/include/db_template.h 
 b/osaf/services/saf/amf/amfd/include/db_template.h
 new file mode 100644
 --- /dev/null
 +++ b/osaf/services/saf/amf/amfd/include/db_template.h
 @@ -0,0 +1,63 @@
 +/*  -*- OpenSAF  -*-
 + *
 + * (C) Copyright 2014 The OpenSAF Foundation
 + *
 + * This program is distributed in the hope that it will be useful, but
 + * WITHOUT ANY WARRANTY; without even the implied warranty of
 +MERCHANTABILITY
 + * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are
 +licensed
 + * under the GNU Lesser General Public License Version 2.1, February 1999.
 + * The complete license can be accessed from the following location:
 + * http://opensource.org/licenses/lgpl-license.php
 + * See the Copying file included with the OpenSAF distribution for full
 + * licensing terms.
 + *
 + * Author(s): Ericsson AB
 + *
 + */
 +#ifndef DB_TEMPLATE_H
 +#defineDB_TEMPLATE_H
 +
 +#include map
 +#include string
 +
 +template typename T
 +class AmfDb {
 +  public:
 +   void insert(T *obj);
 +   void erase(T *obj);
 +   T *find(const SaNameT *name);
 +
 +   typedef std::mapstd::string, T* AmfDbMap;
 +   typedef typename AmfDbMap::const_iterator const_iterator;
 +
 +   const_iterator begin() const {return db.begin();}
 +   const_iterator end() const {return db.end();}
 +
 +  private:
 +   AmfDbMap db;
 +};
 +
 +template typename T
 +void AmfDbT::insert(T *obj) {
 +  std::string name((const char*)obj-name.value, obj-name.length);
 +  db[name] = obj;
 +}
 +
 +template typename T
 +void AmfDbT::erase(T *obj) {
 +  std::string name((const char*)obj-name.value, obj-name.length);
 +  typename AmfDbMap::iterator it = db.find(name);
 +  db.erase(it);
 +}
 +
 +template typename T
 +T *AmfDbT::find(const SaNameT *dn) {
 +  std::string name((const char*)dn-value, dn-length);
 +  typename AmfDbMap::iterator it = db.find(name);
 +  if (it == db.end())
 +return NULL;
 +  else
 +return it-second;
 +}
 +
 +#endif /* DB_TEMPLATE_H */

 --
 CenturyLink Cloud: The Leader in Enterprise Cloud Services.
 Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical 
 Workloads, Development Environments  Everything In Between.
 Get a Quote or Start a Free Trial Today.
 http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
 ___
 Opensaf-devel mailing list
 Opensaf-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/opensaf-devel

 --
 CenturyLink Cloud: The Leader in Enterprise Cloud Services.
 Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical 
 Workloads, Development Environments  Everything In Between.
 Get a Quote or Start a Free Trial Today.
 http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
 ___
 Opensaf-devel mailing list
 Opensaf-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/opensaf-devel

 --
 CenturyLink Cloud: The Leader in Enterprise Cloud Services.
 Learn Why More Businesses Are Choosing 

[devel] [PATCH 0 of 1] Review Request for base: Use default scheduling policy when configured policy is invalid [#690]

2014-01-17 Thread Anders Widell
Summary: base: Use default scheduling policy when configured policy is invalid 
[#690]
Review request for Trac Ticket(s): 690
Peer Reviewer(s): Ramesh
Pull request to: 
Affected branch(es): opensaf-4.2.x, opensaf-4.3.x, opensaf-4.4.x, default(4.5)
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  y
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset b030f158fa19817ac62b65cebf371a8b7167b2b6
Author: Anders Widell anders.wid...@ericsson.com
Date:   Fri, 17 Jan 2014 15:43:56 +0100

base: Use default scheduling policy when configured policy is invalid 
[#690]

OpenSAF would fail to start when an invalid thread scheduling policy has
been configured, e.g. using the following configuration options for one 
of
the OpenSAF services:

export OSAF_MDS_SCHED_PRIORITY=0 export OSAF_MDS_SCHED_POLICY=3

The OpenSAF services fail with the following messages:

Dec 24 14:40:02 SLES_NEW2 opensafd[15010]: ER Timed-out for response 
from
RDE Dec 24 14:40:02 SLES_NEW2 opensafd[15010]: ER Dec 24 14:40:02 
SLES_NEW2
opensafd[15010]: ER Going for recovery Dec 24 14:40:02 SLES_NEW2
opensafd[15010]: ER Trying To RESPAWN 
/usr/lib64/opensaf/clc-cli/osaf-rded
attempt #1 Dec 24 14:40:02 SLES_NEW2 opensafd[15010]: ER Sending 
SIGKILL to
RDE, pid=15031

The reason is that scheduling policy 3 (SCHED_BATCH) is not a valid
parameter to the pthread_attr_setschedpolicy() function, and OpenSAF 
passes
the configured policy to this function without whecking that it is 
valid.

A check for this case has been added, so that we fall back to the 
default
scheduling policy when an invalid policy has been configured.


Complete diffstat:
--
 osaf/libs/core/leap/os_defs.c |  13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)


Testing Commands:
-
Add the following lines to nid.conf and then start OpenSAF:

export OSAF_MDS_SCHED_PRIORITY=0
export OSAF_MDS_SCHED_POLICY=3


Testing, Expected Results:
--
OpenSAF should start up successfully.


Conditions of Submission:
-
Ack from Ramesh


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

[devel] [PATCH 1 of 1] base: Use default scheduling policy when configured policy is invalid [#690]

2014-01-17 Thread Anders Widell
 osaf/libs/core/leap/os_defs.c |  13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)


OpenSAF would fail to start when an invalid thread scheduling policy has been
configured, e.g. using the following configuration options for one of the
OpenSAF services:

export OSAF_MDS_SCHED_PRIORITY=0
export OSAF_MDS_SCHED_POLICY=3

The OpenSAF services fail with the following messages:

Dec 24 14:40:02 SLES_NEW2 opensafd[15010]: ER Timed-out for response from RDE
Dec 24 14:40:02 SLES_NEW2 opensafd[15010]: ER
Dec 24 14:40:02 SLES_NEW2 opensafd[15010]: ER Going for recovery
Dec 24 14:40:02 SLES_NEW2 opensafd[15010]: ER Trying To RESPAWN 
/usr/lib64/opensaf/clc-cli/osaf-rded attempt #1
Dec 24 14:40:02 SLES_NEW2 opensafd[15010]: ER Sending SIGKILL to RDE, pid=15031

The reason is that scheduling policy 3 (SCHED_BATCH) is not a valid parameter to
the pthread_attr_setschedpolicy() function, and OpenSAF passes the configured
policy to this function without whecking that it is valid.

A check for this case has been added, so that we fall back to the default
scheduling policy when an invalid policy has been configured.

diff --git a/osaf/libs/core/leap/os_defs.c b/osaf/libs/core/leap/os_defs.c
--- a/osaf/libs/core/leap/os_defs.c
+++ b/osaf/libs/core/leap/os_defs.c
@@ -164,15 +164,16 @@ unsigned int ncs_os_task(NCS_OS_TASK *ta
min_prio = sched_get_priority_min(policy);
max_prio = sched_get_priority_max(policy);

-   if((sp.sched_priority  min_prio) || (sp.sched_priority 
  max_prio)) {
+   if ((sp.sched_priority  min_prio) || 
(sp.sched_priority  max_prio) ||
+   pthread_attr_setschedpolicy(attr, policy) != 0) {
/* Set to defaults */
-   syslog(LOG_NOTICE, scheduling priority %d for 
given policy %d to the task %s is not \
-   within 
the range, setting to default \
-   values , 
sp.sched_priority, policy, task-info.create.i_name);
+   syslog(LOG_NOTICE, scheduling priority %d or 
policy %d for the 
+  task %s is invalid, setting to default 
values,
+  sp.sched_priority, policy, 
task-info.create.i_name);
policy = task-info.create.i_policy;
sp.sched_priority = 
task-info.create.i_priority;
-   syslog(LOG_INFO, %s task default policy is %d, 
\
-   priority is %d, task-info.create.i_name, 
policy, sp.sched_priority);
+   syslog(LOG_INFO, %s task default policy is %d, 
priority is %d,
+  task-info.create.i_name, policy, 
sp.sched_priority);
}

 #ifdef RLIMIT_RTPRIO

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] amfd: use db_template for the comp db [#713]

2014-01-17 Thread Hans Nordeback
 osaf/services/saf/amf/amfd/ckpt_enc.cc|  14 ++
 osaf/services/saf/amf/amfd/comp.cc|  57 +-
 osaf/services/saf/amf/amfd/compcstype.cc  |   2 +-
 osaf/services/saf/amf/amfd/imm.cc |   7 +--
 osaf/services/saf/amf/amfd/include/comp.h |   9 ++--
 osaf/services/saf/amf/amfd/util.cc|   6 +-
 6 files changed, 33 insertions(+), 62 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/ckpt_enc.cc 
b/osaf/services/saf/amf/amfd/ckpt_enc.cc
--- a/osaf/services/saf/amf/amfd/ckpt_enc.cc
+++ b/osaf/services/saf/amf/amfd/ckpt_enc.cc
@@ -2603,17 +2603,14 @@ static uint32_t enc_cs_siass(AVD_CL_CB *
 static uint32_t enc_cs_comp_config(AVD_CL_CB *cb, NCS_MBCSV_CB_ENC *enc, 
uint32_t *num_of_obj)
 {
uint32_t status = NCSCC_RC_SUCCESS;
-   AVD_COMP *comp;
-   SaNameT comp_name = {0};
EDU_ERR ederror = static_castEDU_ERR(0);
TRACE_ENTER();
 
-   /* 
-* Walk through the entire list and send the entire list data.
-*/
-   comp_name.length = 0;
-   for (comp = avd_comp_getnext(comp_name); comp != NULL;
-comp = avd_comp_getnext(comp_name)) {
+   /* Walk through all component instances and encode. */
+   // If use std=c++11 in Makefile.common the following syntax can be used 
instead:
+   // for (auto it = app_db-begin()
+   for (std::mapstd::string, AVD_COMP*::const_iterator it = 
comp_db-begin(); it != comp_db-end(); it++) {
+   AVD_COMP *comp = it-second;
status = m_NCS_EDU_VER_EXEC(cb-edu_hdl, 
avsv_edp_ckpt_msg_comp, enc-io_uba,
EDP_OP_TYPE_ENC, comp, ederror, 
enc-i_peer_version);
 
@@ -2622,7 +2619,6 @@ static uint32_t enc_cs_comp_config(AVD_C
return NCSCC_RC_FAILURE;
}
 
-   comp_name = comp-comp_info.name;
(*num_of_obj)++;
}
 
diff --git a/osaf/services/saf/amf/amfd/comp.cc 
b/osaf/services/saf/amf/amfd/comp.cc
--- a/osaf/services/saf/amf/amfd/comp.cc
+++ b/osaf/services/saf/amf/amfd/comp.cc
@@ -40,17 +40,7 @@
 #include proc.h
 #include ckpt_msg.h
 
-static NCS_PATRICIA_TREE comp_db;
-
-void avd_comp_db_add(AVD_COMP *comp)
-{
-   unsigned int rc;
-
-   if (avd_comp_get(comp-comp_info.name) == NULL) {
-   rc = ncs_patricia_tree_add(comp_db, comp-tree_node);
-   osafassert(rc == NCSCC_RC_SUCCESS);
-   }
-}
+AmfDbAVD_COMP *comp_db = 0;
 
 AVD_COMP *avd_comp_new(const SaNameT *dn)
 {
@@ -60,7 +50,6 @@ AVD_COMP *avd_comp_new(const SaNameT *dn

memcpy(comp-comp_info.name.value, dn-value, dn-length);
comp-comp_info.name.length = dn-length;
-   comp-tree_node.key_info = (uint8_t *)(comp-comp_info.name);
comp-comp_info.cap = SA_AMF_COMP_ONE_ACTIVE_OR_ONE_STANDBY;
comp-comp_info.category = AVSV_COMP_TYPE_NON_SAF;
comp-comp_info.def_recvr = SA_AMF_COMPONENT_RESTART;
@@ -143,26 +132,16 @@ AVD_COMP *avd_comp_get(const SaNameT *dn
 
tmp.length = dn-length;
memcpy(tmp.value, dn-value, tmp.length);
-
-   return (AVD_COMP *)ncs_patricia_tree_get(comp_db, (uint8_t *)tmp);
-}
-
-AVD_COMP *avd_comp_getnext(const SaNameT *dn)
-{
-   SaNameT tmp = {0};
-
-   tmp.length = dn-length;
-   memcpy(tmp.value, dn-value, tmp.length);
-
-   return (AVD_COMP *)ncs_patricia_tree_getnext(comp_db, (uint8_t *)tmp);
+   
+   return comp_db-find(tmp);
 }
 
 void avd_comp_delete(AVD_COMP *comp)
 {
+   comp_db-erase(comp);
m_AVSV_SEND_CKPT_UPDT_ASYNC_RMV(avd_cb, comp, 
AVSV_CKPT_AVD_COMP_CONFIG);
avd_su_remove_comp(comp);
avd_comptype_remove_comp(comp);
-   (void)ncs_patricia_tree_del(comp_db, comp-tree_node);
delete comp;
 }
 
@@ -185,8 +164,11 @@ static void comp_add_to_model(AVD_COMP *
avsv_sanamet_init(comp-comp_info.name, dn, safSu);
comp-su = avd_su_get(dn);
 
-   avd_comp_db_add(comp);
-   comp-comp_type = avd_comptype_get(comp-saAmfCompType);
+   if (comp_db-find(comp-name) == NULL) {
+   comp_db-insert(comp);
+   }
+   
+   comp-comp_type = avd_comptype_get(comp-name);
osafassert(comp-comp_type);
avd_comptype_add_comp(comp);
avd_su_add_comp(comp);
@@ -432,18 +414,18 @@ static AVD_COMP *comp_create(const SaNam
else
TRACE(already created, refreshing config...);
 
-   error = immutil_getAttr(const_castSaImmAttrNameT(saAmfCompType), 
attributes, 0, comp-saAmfCompType);
+   error = immutil_getAttr(const_castSaImmAttrNameT(saAmfCompType), 
attributes, 0, comp-name);
osafassert(error == SA_AIS_OK);
 
-   if ((comptype = avd_comptype_get(comp-saAmfCompType)) == NULL) {
-   LOG_ER(saAmfCompType '%s' does not exist, 
comp-saAmfCompType.value);
+   if ((comptype = avd_comptype_get(comp-name)) == NULL) {
+   LOG_ER(saAmfCompType '%s' does not exist, 

[devel] [PATCH 0 of 1] Review Request for amf refactoring [#713]

2014-01-17 Thread Hans Nordeback
Summary: use db_template for comp class db
Review request for Trac Ticket(s): #713
Peer Reviewer(s): HansF,Nagu,Praveen
Pull request to: 
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-
 EXPLAIN/COMMENT THE PATCH SERIES HERE

changeset 486d4a5f41cb6a513a69ff71aa9d3e5e6fa5d728
Author: Hans Nordeback hans.nordeb...@ericsson.com
Date:   Fri, 17 Jan 2014 17:54:06 +0100

amfd: use db_template for the comp db [#713]


Complete diffstat:
--
 osaf/services/saf/amf/amfd/ckpt_enc.cc|  14 +-
 osaf/services/saf/amf/amfd/comp.cc|  57 
++---
 osaf/services/saf/amf/amfd/compcstype.cc  |   2 +-
 osaf/services/saf/amf/amfd/imm.cc |   7 ++-
 osaf/services/saf/amf/amfd/include/comp.h |   9 -
 osaf/services/saf/amf/amfd/util.cc|   6 +++---
 6 files changed, 33 insertions(+), 62 deletions(-)


Testing Commands:
-
 LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES


Testing, Expected Results:
--
 PASTE COMMAND OUTPUTS / TEST RESULTS


Conditions of Submission:
-
 HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for amf refactoring [#713]

2014-01-17 Thread Hans Nordeback
Summary: use db_template for app class db 
Review request for Trac Ticket(s): #713
Peer Reviewer(s): HansF, Nagu, Praveen
Pull request to: 
Affected branch(es): 
Development branch: 


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-
 EXPLAIN/COMMENT THE PATCH SERIES HERE

changeset 4c4db8a8cc9f81fe323e54d4bc1e602cc76821b8
Author: Hans Nordeback hans.nordeb...@ericsson.com
Date:   Fri, 17 Jan 2014 17:54:06 +0100

amfd: use db_template for the app db [#713


Complete diffstat:
--
 osaf/services/saf/amf/amfd/app.cc|  77 
+++--
 osaf/services/saf/amf/amfd/ckpt_enc.cc   |  13 +
 osaf/services/saf/amf/amfd/ckpt_updt.cc  |   7 ---
 osaf/services/saf/amf/amfd/include/app.h |  11 +--
 osaf/services/saf/amf/amfd/sg.cc |   2 +-
 osaf/services/saf/amf/amfd/si.cc |   2 +-
 osaf/services/saf/amf/amfd/util.cc   |  18 ++
 7 files changed, 49 insertions(+), 81 deletions(-)


Testing Commands:
-
 LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES


Testing, Expected Results:
--
 PASTE COMMAND OUTPUTS / TEST RESULTS


Conditions of Submission:
-
 HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] amfd: use db_template for the app db [#713

2014-01-17 Thread Hans Nordeback
 osaf/services/saf/amf/amfd/app.cc|  77 +--
 osaf/services/saf/amf/amfd/ckpt_enc.cc   |  13 ++---
 osaf/services/saf/amf/amfd/ckpt_updt.cc  |   7 +-
 osaf/services/saf/amf/amfd/include/app.h |  11 ++--
 osaf/services/saf/amf/amfd/sg.cc |   2 +-
 osaf/services/saf/amf/amfd/si.cc |   2 +-
 osaf/services/saf/amf/amfd/util.cc   |  18 ---
 7 files changed, 49 insertions(+), 81 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/app.cc 
b/osaf/services/saf/amf/amfd/app.cc
--- a/osaf/services/saf/amf/amfd/app.cc
+++ b/osaf/services/saf/amf/amfd/app.cc
@@ -24,60 +24,26 @@
 #include imm.h
 #include si.h
 
-static NCS_PATRICIA_TREE app_db;
+AmfDbAVD_APP *app_db = 0;
 
-void avd_app_db_add(AVD_APP *app)
+// TODO(hafe) change this to a constructor
+static AVD_APP *avd_app_new(const SaNameT *dn)
 {
-   unsigned int rc;
-
-   if (avd_app_get(app-name) == NULL) {
-   rc = ncs_patricia_tree_add(app_db, app-tree_node);
-   osafassert(rc == NCSCC_RC_SUCCESS);
-   }
-}
-
-AVD_APP *avd_app_new(const SaNameT *dn)
-{
-   AVD_APP *app;
-
-   app = new AVD_APP();
-
+   AVD_APP *app = new AVD_APP();
memcpy(app-name.value, dn-value, dn-length);
app-name.length = dn-length;
-   app-tree_node.key_info = (uint8_t *)(app-name);
-
return app;
 }
 
-void avd_app_delete(AVD_APP *app)
+// TODO(hafe) change this to a destructor
+static void avd_app_delete(AVD_APP *app)
 {
-   unsigned int rc = ncs_patricia_tree_del(app_db, app-tree_node);
-   osafassert(rc == NCSCC_RC_SUCCESS);
+   app_db-erase(app);
m_AVSV_SEND_CKPT_UPDT_ASYNC_RMV(avd_cb, app, AVSV_CKPT_AVD_APP_CONFIG);
avd_apptype_remove_app(app);
delete app;
 }
 
-AVD_APP *avd_app_get(const SaNameT *dn)
-{
-   SaNameT tmp = {0};
-
-   tmp.length = dn-length;
-   memcpy(tmp.value, dn-value, tmp.length);
-
-   return (AVD_APP *)ncs_patricia_tree_get(app_db, (uint8_t *)tmp);
-}
-
-AVD_APP *avd_app_getnext(const SaNameT *dn)
-{
-   SaNameT tmp = {0};
-
-   tmp.length = dn-length;
-   memcpy(tmp.value, dn-value, tmp.length);
-
-   return (AVD_APP *)ncs_patricia_tree_getnext(app_db, (uint8_t *)tmp);
-}
-
 static void app_add_to_model(AVD_APP *app)
 {
TRACE_ENTER2(%s, app-name.value);
@@ -88,7 +54,10 @@ static void app_add_to_model(AVD_APP *ap
goto done;
}
 
-   avd_app_db_add(app);
+   if (app_db-find(app-name) == NULL) {
+   app_db-insert(app);
+   }
+
/* Find application type and make a link with app type */
app-app_type = avd_apptype_get(app-saAmfAppType);
osafassert(app-app_type);
@@ -229,7 +198,8 @@ AVD_APP *avd_app_create(const SaNameT *d
** If called at new active at failover, the object is found in the DB
** but needs to get configuration attributes initialized.
*/
-   if (NULL == (app = avd_app_get(dn))) {
+   app = app_db-find(dn);
+   if (app == NULL) {
if ((app = avd_app_new(dn)) == NULL)
goto done;
} else
@@ -314,7 +284,7 @@ static void app_ccb_apply_cb(CcbUtilOper
break;
case CCBUTIL_MODIFY: {
const SaImmAttrModificationT_2 *attr_mod;
-   app = avd_app_get(opdata-objectName);
+   app = app_db-find(opdata-objectName);
 
while ((attr_mod = opdata-param.modify.attrMods[i++]) != NULL) 
{
const SaImmAttrValuesT_2 *attribute = 
attr_mod-modAttr;
@@ -334,7 +304,7 @@ static void app_ccb_apply_cb(CcbUtilOper
break;
}
case CCBUTIL_DELETE:
-   app = avd_app_get(opdata-objectName);
+   app = app_db-find(opdata-objectName);
/* by this time all the SGs and SIs under this 
 * app object should have been *DELETED* just  
 * do a sanity check here
@@ -359,7 +329,7 @@ static void app_admin_op_cb(SaImmOiHandl
TRACE_ENTER2(%s, object_name-value);
 
/* Find the app name. */
-   app = avd_app_get(object_name);
+   app = app_db-find(object_name);
osafassert(app != NULL);
 
if (op_id == SA_AMF_ADMIN_UNLOCK) {
@@ -416,7 +386,7 @@ done:
 static SaAisErrorT app_rt_attr_cb(SaImmOiHandleT immOiHandle,
const SaNameT *objectName, const SaImmAttrNameT *attributeNames)
 {
-   AVD_APP *app = avd_app_get(objectName);
+   AVD_APP *app = app_db-find(objectName);
SaImmAttrNameT attributeName;
int i = 0;
 
@@ -493,12 +463,11 @@ SaAisErrorT avd_app_config_get(void)
 
 void avd_app_constructor(void)
 {
-   NCS_PATRICIA_PARAMS patricia_params;
+   app_db = new AmfDbAVD_APP;
 
-   patricia_params.key_size = sizeof(SaNameT);
-   osafassert(ncs_patricia_tree_init(app_db, patricia_params) == 
NCSCC_RC_SUCCESS);
-
-   

Re: [devel] checkpoint section create performance

2014-01-17 Thread Alex Jones
AVM,

 I found another performance issue in the checkpoint subsystem.

 I was still not able to replicate 40k sections from 5 active blades 
to the 6th standby blade (blade 6 has 200k sections in 5 checkpoints).  
The writes on the active blades were fine, but the standby couldn't keep 
up.  On the standby the CPU was pegged and all ckpt API functions were 
returning with SA_AIS_ERR_TIMEOUT, including ActiveReplicaSet, and 
CheckpointClose!

 So, I ran oprofile on the standby and found the following.  90% of 
the time was being spent in cpnd_ckpt_sec_get_create().  In this 
function it is clearly seen that the section database is implemented as 
a linked list.  This is horribly expensive with large numbers of 
sections, especially when these sections are being replicated at high rates.

 As a proof of concept, I reimplemented the section database using 
the C++ STL map.  This improved performance tenfold.

 With the following changes I can now easily replicate 40k sections 
each from 5 blades to the standby (200k sections being simultaneously 
replicated on the backup blade.)

 1. Make the section create message asynchronous when
SA_CKPT_WR_ACTIVE_REPLICA is specified.
 2. Change the section database data structure from linked list to STL map.
 3. Change MAX_SYNC_TRANSFER_SIZE in cpsv_evt.h from 30M to 3M.

 I'll reimplement the section database patch using the internal 
patricia tree code and post the patch, unless you feel there's a better 
way to do it.


Alex

On 01/14/2014 05:13 PM, Alex Jones wrote:
 3.7.1 saCkptSectionCreate()
 If the checkpoint was created with the SA_CKPT_WR_ALL_REPLICAS 
 property, the section is created in all of the checkpoint replicas 
 when the invocation returns; otherwise, the section has been created 
 at least in the active checkpoint replica when the invocation returns 
 and will be created asynchronously in the other checkpoint replicas.

 It looks like the implementation behaves like the checkpoint was 
 created with SA_CKPT_WR_ALL_REPLICAS, (even if 
 SA_CKPT_WR_ACTIVE_REPLICA or SA_CKPT_WR_ACTIVE_REPLICA_WEAK are 
 specified) for section creates.

 I've been digging into the code, and it looks like 
 cpnd_evt_proc_ckpt_sect_create sends a synchronous message to each 
 replica to create the section regardless of the property.

 I realize this is spec compliant, but performance could be greatly 
 enhanced for large numbers of sections when using the 
 SA_CKPT_WR_ACTIVE_REPLICA or SA_CKPT_WR_ACTIVE_REPLICA_WEAK property 
 by making this asynchronous.

 Any chance we can change this behaviour, and make it like 
 saCkptCheckpointWrite?

 Alex

 On 01/14/2014 03:16 PM, Alex Jones wrote:
 AVM,

 In my 5+1 setup, when I have the standby node open all the 
 checkpoints and read from them, as well as open the hot-standby 
 callback, the section creates done on the other active nodes can take 
 a very long time.  (For 40k sections, it can sometimes take over 2 
 minutes).

 Once the sections have been created, however, subsequent writes 
 and overwrites are very fast.  (Writing 1k data into 40k sections 
 takes 10 seconds).

 But, if I don't open the checkpoints on the standby, the section 
 creates on the active nodes are fast (about 22 seconds for 40k 
 sections), and the write and overwrite performance is basically 
 unchanged.

 This suggests that there is some kind of synchronous mechanism 
 going on between replicas when creating sections.

 Can you explain why I am seeing this performance degradation when 
 creating sections when a standby replica is opened, but there is no 
 performance hit for writing and overwriting?

 Thanks!

 Alex



--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel