opensm: Added cleanup of SA cache after handover
PATCH 1/1 opensm: Added cleanup of SA cache after handover
Previously, when SM becomes STANDBY after being MASTER it preserved the SA cache. When the SM will become MASTER again, its' SA cache might be inconsistent. The solution is to clean the SA cache each time the SM becomes STANDBY after a handover.
--- include/opensm/osm_port.h | 56 +++++++++++++++++++++++++ include/opensm/osm_subnet.h | 9 ++++- opensm/osm_sm_state_mgr.c | 1 + opensm/osm_state_mgr.c | 96 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 161 insertions(+), 1 deletions(-)
include/opensm/osm_port.h +56 -0
@@ -1553,5 +1553,61 @@ void osm_alias_guid_delete(IN OUT osm_alias_guid_t ** pp_alias_guid);* Port *********/ +/****f* OpenSM: Port/osm_alias_guid_get_alias_guid +* NAME +* osm_alias_guid_get_alias_guid +* +* DESCRIPTION +* This function retrieves alias guid from alias guid object. +* +* SYNOPSIS +*/ +static inline ib_net64_t osm_alias_guid_get_alias_guid(IN osm_alias_guid_t *p_alias_guid) +{ +CL_ASSERT (p_alias_guid); +return p_alias_guid->alias_guid; +} +/* +* PARAMETERS +* p_alias_guid +* [in] Pointer to a pointer to an alias guid object. +* +* RETURN VALUE +* This function returns the alias guid or NULL if fails. +* +* NOTES +* +* SEE ALSO +* Port +*********/ + +/****f* OpenSM: Port/osm_alias_guid_get_base_guid +* NAME +* osm_alias_guid_get_base_guid +* +* DESCRIPTION +* This function retrieves base guid from alias guid object. +* +* SYNOPSIS +*/ +static inline ib_net64_t osm_alias_guid_get_base_guid(IN osm_alias_guid_t *p_alias_guid) +{ +CL_ASSERT (p_alias_guid); +return p_alias_guid->p_base_port->guid; +} +/* +* PARAMETERS +* p_alias_guid +* [in] Pointer to a pointer to an alias guid object. +* +* RETURN VALUE +* This function returns the base guid or NULL if fails. +* +* NOTES +* +* SEE ALSO +* Port +*********/ + END_C_DECLS#endif /* _OSM_PORT_H_ */
include/opensm/osm_subnet.h +8 -1
@@ -584,6 +584,7 @@ typedef struct osm_subn {boolean_t set_client_rereg_on_sweep;boolean_t coming_out_of_standby;boolean_t sweeping_enabled; +boolean_t clean_sa;unsigned need_update;cl_fmap_t mgrp_mgid_tbl;void *mboxes[IB_LID_MCAST_END_HO -IB_LID_MCAST_START_HO +1 ];
@@ -712,13 +713,19 @@ typedef struct osm_subn {* TRUE on the first sweep after the SM was in standby. * Used for nulling any cache of LID and Routing. * The flag is set true if the SM state was standby and now -* changed to MASTER it is reset at the end of the sweep. +* changed to MASTER. It is reset at the end of the sweep. * * sweeping_enabled * FALSE - sweeping is administratively disabled, all * sweeping is inhibited, TRUE - sweeping is done * normally * +* clean_sa +* TRUE on the first sweep after SM is in standby after handover. +* Used for nulling the SA cache. the flag is set true if the SM +* state was master and now changed to standby. The flag is reset +* at the end of the SA cleanup. +* * need_update * This flag should be on during first non-master heavy * (including pre-master discovery stage)
opensm/osm_sm_state_mgr.c +1 -0
@@ -418,6 +418,7 @@ ib_api_status_t osm_sm_state_mgr_process(osm_sm_t * sm,*/ sm->p_subn->sm_state =IB_SMINFO_STATE_STANDBY ;osm_report_sm_state (sm); + sm->p_subn->clean_sa = TRUE;sm_state_mgr_start_polling (sm);break ;case OSM_SM_SIGNAL_WAIT_FOR_HANDOVER :
opensm/osm_state_mgr.c +96 -0
115 lines not on this page · raw message
Signature · 6 lines
1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html