Skip state_mgr_check_tbl_consistency when no LID changed by lid or link managers
PATCH 1/1 Skip state_mgr_check_tbl_consistency when no LID changed by lid or link managers
From: Vladimir Koushnir <vladimirk-VPRAkNaXOzVWk0Htik3J/[email protected]>
If no LID was changed/allocated during by the lid manager and no PortInfo(Set) was sent, there is no need to run the state_mgr_check_tbl_consistency routine.
--- include/opensm/osm_lid_mgr.h | 12 ++++++++---- opensm/osm_lid_mgr.c | 1 + opensm/osm_link_mgr.c | 1 + opensm/osm_state_mgr.c | 7 +++++++ 4 files changed, 17 insertions(+), 4 deletions(-)
include/opensm/osm_lid_mgr.h +8 -4
@@ -98,6 +98,7 @@ typedef struct osm_lid_mgr {cl_plock_t *p_lock;osm_db_domain_t *p_g2l;cl_qlist_t free_ranges; +boolean_t dirty;uint8_t used_lids[IB_LID_UCAST_END_HO +1 ]; } osm_lid_mgr_t;/*
@@ -120,16 +121,19 @@ typedef struct osm_lid_mgr {* p_g2l * Pointer to the database domain storing guid to lid mapping. * -* used_lids -* An array of used lids. keeps track of -* existing and non existing mapping of guid->lid -* * free_ranges * A list of available free lid ranges. The list is initialized * by the code that initializes the lid assignment and is consumed * by the procedure that finds a free range. It holds elements of * type osm_lid_mgr_range_t * +* dirty +* Indicates that lid table was updated +* +* used_lids +* An array of used lids. keeps track of +* existing and non existing mapping of guid->lid +* * SEE ALSO * LID Manager object *********/
opensm/osm_lid_mgr.c +1 -0
@@ -892,6 +892,7 @@ static int lid_mgr_set_physp_pi(IN osm_lid_mgr_t * p_mgr,*/ osm_physp_set_base_lid (p_physp,0 ); send_set = TRUE; + p_mgr->dirty = TRUE; }/* we are updating the ports with our local sm_base_lid */
opensm/osm_link_mgr.c +1 -0
@@ -129,6 +129,7 @@ static int link_mgr_set_physp_pi(osm_sm_t * sm, IN osm_physp_t * p_physp, p_port =osm_get_port_by_guid (sm->p_subn,osm_physp_get_port_guid (p_physp)); p_pi->base_lid = p_port->lid; + sm->lid_mgr.dirty = TRUE; send_set = TRUE; }
opensm/osm_state_mgr.c +7 -0
@@ -1400,6 +1400,11 @@ static void state_mgr_check_tbl_consistency(IN osm_sm_t * sm)OSM_LOG_ENTER (sm->p_log); +if (sm->lid_mgr.dirty == FALSE) + goto Exit; + + sm->lid_mgr.dirty = FALSE; +cl_ptr_vector_construct (&ref_port_lid_tbl); cl_ptr_vector_init(&ref_port_lid_tbl, cl_ptr_vector_get_size(&sm->p_subn->port_lid_tbl),
@@ -1491,6 +1496,8 @@ static void state_mgr_check_tbl_consistency(IN osm_sm_t * sm) }cl_ptr_vector_destroy (&ref_port_lid_tbl); + +Exit:OSM_LOG_EXIT (sm->p_log); }
Signature · 6 lines
1.7.8.2 -- 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