Hi Jack.<br><br><div class="gmail_quote">On Sun, Aug 30, 2009 at 11:45 AM, Jack Morgenstein <span dir="ltr"><<a href="mailto:jackm@dev.mellanox.co.il">jackm@dev.mellanox.co.il</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Wednesday 26 August 2009 02:03, MANIKANTAN KALAIYA wrote:<br>
> Resending to the mailing list...<br>
><br>
> We have Ofed1.3.1 installed, one of the sub packages is libibverbs version 1.1.1. We have a small program that lists the number of IB cards available in the system through ibv_get_device_list(). See below for the sample code.<br>
<br>
</div>libibverbs reads the number of devices ONCE, at calling process startup (as part of its initialization).<br>
To get a new device count, you need to restart your program.<br></blockquote><div>Does this mean PCI Hotplug is not supported for Infiniband Adapters?<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
- Jack<br>
<div class="im"><br>
> The system has two IB cards, the value returned by ibv_get_device_list() in 'num_devices' is two, as expected.<br>
><br>
> However, when we disable one of the cards using the modprobe command, the program continues to return two cards present (monitoring is continuous in a while loop).<br>
> Killing and restarting the sample test process results in reporting correct number of IB cards available (returns one after it is restarted). One of the prior versions was known to report the correct number of IB cards without requiring to restart the program.<br>
><br>
> We would like to determine the number of cards present without having to go through a restart. Any inputs on this behavior is appreciated.<br>
><br>
> modprobe command - "sudo modprobe -r ib_mthca"<br>
><br>
> Test program:<br>
> =================================================<br>
> #include <stdio.h><br>
> #include <infiniband/verbs.h><br>
><br>
> int main(int argc, char **argv)<br>
> {<br>
> int ret, num_devices;<br>
> struct ibv_device **dev_list;<br>
><br>
> while(1) {<br>
><br>
> dev_list = ibv_get_device_list(&num_devices);<br>
><br>
> if (num_devices != 0) {<br>
> printf("IB ADAPTER AVAILABLE:%d\n", num_devices);<br>
> }<br>
> else {<br>
> printf("IB ADAPTER UNAVAILABLE\n");<br>
> }<br>
> sleep(2);<br>
> ibv_free_device_list(dev_list);<br>
> }<br>
><br>
> return(0);<br>
> }<br>
> =================================================<br>
><br>
> Thanks,<br>
> Mani.<br>
><br>
</div>_______________________________________________<br>
general mailing list<br>
<a href="mailto:general@lists.openfabrics.org">general@lists.openfabrics.org</a><br>
<a href="http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general" target="_blank">http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general</a><br>
<br>
To unsubscribe, please visit <a href="http://openib.org/mailman/listinfo/openib-general" target="_blank">http://openib.org/mailman/listinfo/openib-general</a><br>
</blockquote></div><br>