Yes in this case it is a bit confusing with such a similar name. I think a MDS_ prefix can be used but also move the stuff to the C-file. This is not part of some API so I think it belongs better in the C-file. /Hans
On 10/10/2013 09:22 AM, Bertil Engelholm wrote: > I don't know if we have a principle for naming macros in OpenSAF. I think it > might be a good idea to > prefix any OpenSAF macros with OSAF (e.g. OSAF_TIPCIMPORTANCE, OSAF_RUNASROOT > etc). > Maybe for the future, comments ? > > /Bertil > > -----Original Message----- > From: Ingvar Bergstrom [mailto:ingvar.bergst...@ericsson.com] > Sent: den 10 oktober 2013 08:53 > To: mahesh.va...@oracle.com > Cc: opensaf-devel@lists.sourceforge.net > Subject: [devel] [PATCH 1 of 1] mds: configurable TIPC importance [#589] > > osaf/libs/core/mds/include/mds_dt_tipc.h | 8 ++++++++ > osaf/libs/core/mds/mds_dt_tipc.c | 14 ++++++++++++++ > 2 files changed, 22 insertions(+), 0 deletions(-) > > > The default TIPC importance (TIPC_LOW_IMPORTANCE) can be changed by defining > TIPCIMPORTANCE at compile time. > e.g. -DTIPCIMPORTANCE=TIPC_HIGH_IMPORTANCE. > Possible values are: > TIPC_LOW_IMPORTANCE, TIPC_MEDIUM_IMPORTANCE and TIPC_HIGH_IMPORTANCE > > diff --git a/osaf/libs/core/mds/include/mds_dt_tipc.h > b/osaf/libs/core/mds/include/mds_dt_tipc.h > --- a/osaf/libs/core/mds/include/mds_dt_tipc.h > +++ b/osaf/libs/core/mds/include/mds_dt_tipc.h > @@ -47,6 +47,14 @@ > > #define MDS_TIPC_NM_PREFIX 0x4d44 /* "M" = ASCII 0x4d */ > > +#ifndef TIPCIMPORTANCE > +#define TIPCIMPORTANCE TIPC_LOW_IMPORTANCE #endif > + > +#if TIPCIMPORTANCE == TIPC_CRITICAL_IMPORTANCE #define TIPCIMPORTANCE > +ILLEGAL_IMPORTANCE /*Will catch TIPC_CRITICAL_IMPORTANCE at compile > +time */ #endif > + > typedef enum { > MDS_TIPC_NM_TYPE_SVC_INST = 0x01000000, > MDS_TIPC_NM_TYPE_VDEST, > diff --git a/osaf/libs/core/mds/mds_dt_tipc.c > b/osaf/libs/core/mds/mds_dt_tipc.c > --- a/osaf/libs/core/mds/mds_dt_tipc.c > +++ b/osaf/libs/core/mds/mds_dt_tipc.c > @@ -294,6 +294,20 @@ uint32_t mdtm_tipc_init(NODE_ID nodeid, > return NCSCC_RC_FAILURE; > } > > + /* Set the default TIPC importance level */ > + if (TIPCIMPORTANCE > TIPC_HIGH_IMPORTANCE) { > + m_MDS_LOG_ERR("MDTM: Can't set socket option TIPC_IMP = > %d\n", TIPCIMPORTANCE); > + osafassert(0); > + } > + > + int imp = TIPCIMPORTANCE; > + if (setsockopt(tipc_cb.BSRsock, SOL_TIPC, TIPC_IMPORTANCE, &imp, > sizeof(imp)) != 0) { > + m_MDS_LOG_ERR("MDTM: Can't set default socket option > TIPC_IMP err :%s\n", strerror(errno)); > + osafassert(0); > + } else { > + m_MDS_LOG_INFO("MDTM: Successfully set default socket option > TIPC_IMP = %d", TIPCIMPORTANCE); > + } > + > return NCSCC_RC_SUCCESS; > } > > > ------------------------------------------------------------------------------ > 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 > Opensaf-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/opensaf-devel > > ------------------------------------------------------------------------------ > 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 > Opensaf-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/opensaf-devel > > ------------------------------------------------------------------------------ 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 Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel