Sorry for the delay Alex.
ACK,
Mathi.

> -----Original Message-----
> From: Alex Jones [mailto:[email protected]]
> Sent: Friday, April 29, 2016 9:24 PM
> To: Mathivanan Naickan Palanivelu
> Cc: [email protected]
> Subject: [PATCH 1 of 1] plm: set state_model for HEs at switchover [#1789]
> 
>  osaf/services/saf/plmsv/plms/hpi_intf/plms_hsm.c |  47
> ++++++++++++++++++++++++
>  osaf/services/saf/plmsv/plms/plms_stdby.c        |  17 ++++++++
>  2 files changed, 64 insertions(+), 0 deletions(-)
> 
> 
> Apr 29 09:01:38 q50-s1 osafplmd[6482]: ER Invalid state model: 0 Apr 29
> 09:01:38 q50-s1 osafplmd[6482]: ER Ent
> safHE=Stirling_Blade_slot_6,safDomain=Q50chassis deactivation failed.
> 
> After switchover PLM does not set the state_model variable in
> PLMS_ENTITY.
> The only time it gets set is when a hotswap event comes up from HPI. At this
> point PLM admin operations on HEs without the state_model set all fail with
> the above log message.
> 
> Solution is to set the state_model after switchover.
> 
> diff --git a/osaf/services/saf/plmsv/plms/hpi_intf/plms_hsm.c
> b/osaf/services/saf/plmsv/plms/hpi_intf/plms_hsm.c
> --- a/osaf/services/saf/plmsv/plms/hpi_intf/plms_hsm.c
> +++ b/osaf/services/saf/plmsv/plms/hpi_intf/plms_hsm.c
> @@ -51,6 +51,8 @@ PLMS_HSM_CB     *hsm_cb = &_hsm_cb;
> 
> **********************************************************
> *************/
>  SaUint32T plms_hsm_initialize(PLMS_HPI_CONFIG *hpi_cfg);  SaUint32T
> plms_hsm_finalize(void);
> +SaUint32T plms_get_hotswap_model(const SaHpiEntityPathT *,
> +                                     PLMS_HPI_STATE_MODEL *);
>  static SaUint32T hsm_get_hotswap_model(SaHpiRptEntryT *rpt_entry,
>                                              SaUint32T      
> *hotswap_state_model);
>  static SaUint32T hsm_send_hotswap_event(SaHpiRptEntryT   *rpt_entry,
> @@ -237,6 +239,51 @@ SaUint32T plms_hsm_finalize(void)
> 
>       return NCSCC_RC_SUCCESS;
>  }
> +
> +SaUint32T plms_get_hotswap_model(const SaHpiEntityPathT *epath_ptr,
> +                                     PLMS_HPI_STATE_MODEL *model)
> +{
> +     PLMS_HSM_CB *cb = hsm_cb;
> +     SaUint32T rc = NCSCC_RC_SUCCESS;
> +
> +     do {
> +             SaHpiUint32T instanceId = SAHPI_FIRST_ENTRY;
> +             SaHpiResourceIdT resourceId = 0;
> +             SaHpiInstrumentIdT instrumentId = 0;
> +             SaHpiUint32T rptUpdateCount = 0;
> +
> +             SaErrorT hpirc = saHpiGetIdByEntityPath(cb->session_id,
> +                                                     *epath_ptr,
> +                                                     SAHPI_NO_RECORD,
> +                                                     &instanceId,
> +                                                     &resourceId,
> +                                                     &instrumentId,
> +                                                     &rptUpdateCount);
> +
> +             if (hpirc != SA_OK) {
> +                     LOG_ER("failed to get resource id: %i", hpirc);
> +                     rc = NCSCC_RC_FAILURE;
> +                     break;
> +             }
> +
> +             SaHpiRptEntryT rptEntry;
> +
> +             hpirc = saHpiRptEntryGetByResourceId(cb->session_id,
> +                                                     resourceId,
> +                                                     &rptEntry);
> +
> +             if (hpirc != SA_OK) {
> +                     LOG_ER("failed to get rpt entry id: %i", hpirc);
> +                     rc = NCSCC_RC_FAILURE;
> +                     break;
> +             }
> +
> +             rc = hsm_get_hotswap_model(&rptEntry, model);
> +     } while (false);
> +
> +     return rc;
> +}
> +
> 
> /**********************************************************
> ***********
>   * Name              : plms_send_hpi_evt_ntf
>   *
> diff --git a/osaf/services/saf/plmsv/plms/plms_stdby.c
> b/osaf/services/saf/plmsv/plms/plms_stdby.c
> --- a/osaf/services/saf/plmsv/plms/plms_stdby.c
> +++ b/osaf/services/saf/plmsv/plms/plms_stdby.c
> @@ -96,6 +96,7 @@ SaUint32T plms_proc_standby_active_role_
>       TRACE_LEAVE();
>       return NCSCC_RC_SUCCESS;
>  }
> +
> 
> /**********************************************************
> *************
>   * Name          : plms_build_epath_to_entity_map_tree
>   *
> @@ -110,6 +111,8 @@ SaUint32T plms_proc_standby_active_role_
> SaUint32T plms_build_epath_to_entity_map_tree()
>  {
>       SaUint32T (* hsm_func_ptr)(SaInt8T *epath_str,SaHpiEntityPathT
> *epath_ptr) = NULL;
> +     SaUint32T (* hsm_get_state_model)(const SaHpiEntityPathT
> *epath_ptr,
> +                                             PLMS_HPI_STATE_MODEL
> *model) = NULL;
>       PLMS_EPATH_TO_ENTITY_MAP_INFO *epath_to_ent;
>       PLMS_ENTITY *plm_ent;
>       PLMS_CB       *cb = plms_cb;
> @@ -120,6 +123,13 @@ SaUint32T plms_build_epath_to_entity_map
>               LOG_ER("dlsym() of HPI lib failed with error %s", dlerror());
>               return NCSCC_RC_FAILURE;
>       }
> +
> +     hsm_get_state_model = dlsym(cb->hpi_intf_hdl,
> "plms_get_hotswap_model");
> +     if ( NULL == hsm_get_state_model ) {
> +             LOG_ER("dlsym() for plms_get_hotswap_model failed %s",
> dlerror());
> +             return NCSCC_RC_FAILURE;
> +     }
> +
>       plm_ent = (PLMS_ENTITY *) ncs_patricia_tree_getnext(&cb-
> >entity_info,
>                       (SaUint8T *) 0);
>       while (plm_ent != NULL) {
> @@ -152,6 +162,13 @@ SaUint32T plms_build_epath_to_entity_map
>                       }
>                       TRACE("Entity Path: %s of entity: %s added to
> epath_to_ent_map tree",
>                               plm_ent-
> >entity.he_entity.saPlmHECurrEntityPath, plm_ent->dn_name_str);
> +
> +                     /* get the state model so we can perform HPI
> operations */
> +                     ret_err = (*hsm_get_state_model)(&epath_to_ent-
> >epath_key, &plm_ent->state_model);
> +                     if ( NCSCC_RC_SUCCESS != ret_err  ){
> +                             LOG_ER("unable to get state_model %d",
> ret_err);
> +                             return ret_err;
> +                     }
>               }
>               plm_ent = (PLMS_ENTITY *) ncs_patricia_tree_getnext(&cb-
> >entity_info,
>                       (SaUint8T *) &plm_ent->dn_name);
> 

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to