Skip to contentSkip to conversation

opensm: Added cleanup of SA cache after handover

PATCH New Alex Netes 1 participant 1 message May 31, 2011 InfiniBand

lore
Share & tools
lore

Alex Netes

author
#0 lore raw

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 inconsitent. The solution is to clean the SA cache each time the SM becomes STANDBY after a handover.

---
 include/opensm/osm_subnet.h |    9 ++++-
 opensm/osm_sm_state_mgr.c   |    1 +
 opensm/osm_state_mgr.c      |   82 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 91 insertions(+), 1 deletions(-)
include/opensm/osm_subnet.h +8 -1
index 83ef77e..41f2546 100644
@@ -552,6 +552,7 @@ typedef struct osm_subn {
 	boolean_t first_time_master_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];
@@ -669,13 +670,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
index a568267..99ab4d2 100644
@@ -414,6 +414,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 +82 -0

100 lines not on this page · raw message

Signature · 7 lines
1.7.5.2

-- Alex
--
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