<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6618.4">
<TITLE>How to avoid "ibwarn: [27319] port_alloc: umad port id 0 is already allocated for mthca0 1" when trying to reconnect to SA. </TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P DIR=LTR><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">Our application is querying the LID, GUID and subnetID</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial"> for a given service at the SA.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">In order to do so before ev</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">e</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">ry connecti</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">on to the data source, which might last for several ours or some seconds, a connection to the SA</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"> <FONT SIZE=2 FACE="Arial">is established</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"> <FONT SIZE=2 FACE="Arial">via</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial"></FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"> <FONT SIZE=2 FACE="Arial">the</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"> <FONT SIZE=2 FACE="Arial">osm</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"> <FONT SIZE=2 FACE="Arial">interface</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">After that I</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">’</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">m tear</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">ing</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial"> down the connection to the SA</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">For the next connection</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">, which might be to another server,</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"> <FONT SIZE=2 FACE="Arial"> I have to do all over again.</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">My problem is that I can only</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"> <FONT SIZE=2 FACE="Arial">establish</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial"> a connection to the SA once!</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">A second attempt to build up a connection gives the error message above.</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">Any idea/help welcome:</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"></SPAN></P>
<P DIR=LTR><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"></SPAN></P>
<P DIR=LTR><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">Her</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">e</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New"> is the code I</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">’</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">m using to build up</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"> <FONT SIZE=2 FACE="Courier New">the connection</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New"></FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"> <FONT SIZE=2 FACE="Courier New">to the SA:</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"></SPAN></P>
<P DIR=LTR><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"></SPAN></P>
<P DIR=LTR><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">c</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">omplib_init();</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">osm_log_construct(&_osmLog);</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">if ((status = osm_log_init_v2(&_osmLog, TRUE, 0x0001, NULL, 0, TRUE )) != IB_SUCCESS )</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">{</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New"></FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"> <FONT SIZE=2 FACE="Courier New"> return -1;</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">}</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">osm_log_set_level(&_osmLog, OSM_LOG_NONE);</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">_osmVendorPtr = osm_vendor_new(&_osmLog, 100);</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">osm_mad_pool_construct(&_osmMadPool);</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">if ((status = osm_mad_pool_init(&_osmMadPool, &_osmLog)) != IB_SUCCESS )</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">{</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"> <FONT SIZE=2 FACE="Courier New">return -1;</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">}</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">_</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">osmBindHandle = osmv_bind_sa (_osmVendorPtr, &_osmMadPool, _localGid.global.interface_id);</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">if (_osmBindHandle == OSM_BIND_INVALID_HANDLE)</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">{</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New"> return -1;</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">}</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"></SPAN></P>
<P DIR=LTR><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">A</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">nd</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial"> this is the code I</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">’</FONT></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">m trying to tear down the connection to th SA</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"></SPAN></P>
<P DIR=LTR><SPAN LANG="de"></SPAN><SPAN LANG="de"></SPAN><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">osm_mad_pool_destroy(&_osmMadPool);</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">if (_osmVendorPtr)</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">{</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New"> osm_vendor_delete(&_osmVendorPtr);</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New"> _osmVendorPtr = NULL;</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Courier New">}</FONT></SPAN></P>
</BODY>
</HTML>