[openib-general] [PATCH] opensm: close umad port in osm_vendor_delete

Sasha Khapyorsky sashak at voltaire.com
Sun Jan 7 18:58:48 PST 2007


This adds umad_port_close() call in osm_vendor_delete(). So the same
process can reinitialize and reuse the vendor layer. Successful test
was reported.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 osm/libvendor/osm_vendor_ibumad.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/osm/libvendor/osm_vendor_ibumad.c b/osm/libvendor/osm_vendor_ibumad.c
index c2e04c3..35f127a 100644
--- a/osm/libvendor/osm_vendor_ibumad.c
+++ b/osm/libvendor/osm_vendor_ibumad.c
@@ -544,10 +544,15 @@ osm_vendor_delete(
 	umad_receiver_t *p_ur;
 	int agent_id;
 
-	/* unregister UMAD agents */
-	for (agent_id = 0; agent_id < UMAD_CA_MAX_AGENTS; agent_id++)
-		if ( (*pp_vend)->agents[agent_id] )
-			umad_unregister( (*pp_vend)->umad_port_id, agent_id );
+	if ((*pp_vend)->umad_port_id >= 0) {
+		/* unregister UMAD agents */
+		for (agent_id = 0; agent_id < UMAD_CA_MAX_AGENTS; agent_id++)
+			if ( (*pp_vend)->agents[agent_id] )
+				umad_unregister((*pp_vend)->umad_port_id,
+						agent_id );
+		umad_close_port((*pp_vend)->umad_port_id);
+		(*pp_vend)->umad_port_id = -1;
+	}
 
 	clear_madw( *pp_vend );
 	/* make sure all ports are closed */
-- 
1.5.0.rc0.g2484-dirty





More information about the general mailing list