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 <[EMAIL PROTECTED]>
---
 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


_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to