Fix minhop population in fabric with duplicate lids
PATCH 1/1 Fix minhop population in fabric with duplicate lids
From: Alex Netes <alexne-VPRAkNaXOzVWk0Htik3J/[email protected]>
Sometimes SET PortInfo from the lid_mgr can fail and a port will remain with it previous lid. In that case we might have more than one port with same lid. ucast_build_matrices calculate min hop tables from the lid stored in the physp.port_info object resulting a wrong calculation.
This patch zeros the physp.port_info.base_lid field before sending lid update to a port. In case SET fails, lid for that port will remain 0 and won't affect min_hop calculation.
--- include/opensm/osm_port.h | 30 ++++++++++++++++++++++++++++++ opensm/osm_lid_mgr.c | 8 +++++++- 2 files changed, 37 insertions(+), 1 deletions(-)
include/opensm/osm_port.h +30 -0
@@ -546,6 +546,36 @@ void osm_physp_set_port_info(IN osm_physp_t * p_physp,* Port, Physical Port *********/ +/****f* OpenSM: Physical Port/osm_physp_set_base_lid +* NAME +* osm_physp_set_base_lid +* +* DESCRIPTION +* Sets the base lid for this Physical Port. +* +* SYNOPSIS +*/ +static inline void osm_physp_set_base_lid(IN osm_physp_t * p_physp, + IN ib_net16_t base_lid) +{ +CL_ASSERT (p_physp); +CL_ASSERT (osm_physp_is_valid (p_physp)); + p_physp->port_info.base_lid = base_lid; +} + +/* +* PARAMETERS +* p_physp +* [in] Pointer to an osm_physp_t object. +* +* base_lid +* [in] Lid to set. +* +* NOTES +* +* SEE ALSO +*********/ +/****f* OpenSM: Physical Port/osm_physp_set_pkey_tbl * NAME * osm_physp_set_pkey_tbl
opensm/osm_lid_mgr.c +7 -1
@@ -885,8 +885,14 @@ static int lid_mgr_set_physp_pi(IN osm_lid_mgr_t * p_mgr, p_port->lid = lid; p_pi->base_lid = lid;if (memcmp (&p_pi->base_lid, &p_old_pi->base_lid, -sizeof (p_pi->base_lid))) +sizeof (p_pi->base_lid))) { +/* +* Reset stored base_lid. +* On successful send, we'll update it when we'll get a reply. +*/ +osm_physp_set_base_lid (p_physp,0 ); send_set = TRUE; + }/* we are updating the ports with our local sm_base_lid */ p_pi->master_sm_base_lid = p_mgr->p_subn->sm_base_lid;
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