Mike Marciniszyn 53ab1c6498 IB/qib: Correct nfreectxts for multiple HCAs
The code that was recently introduced to report the number
of free contexts is flawed for multiple HCAs:

       /* Return the number of free user ports (contexts) available. */
       return scnprintf(buf, PAGE_SIZE, "%u\n", dd->cfgctxts -
                dd->first_user_ctxt - (u32)qib_stats.sps_ctxts);

The qib_stats is global to the module, not per HCA, so the code is broken
for multiple HCAs.

This patch adds a qib_devdata field, freectxts, that reflects the free
contexts for this HCA.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Reviewed-by: Ram Vepa <ram.vepa@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-10-06 09:33:35 -07:00
..
2011-05-20 11:46:11 -07:00
2011-01-07 17:50:24 +11:00
2011-07-18 12:09:26 -07:00
2011-01-10 17:42:22 -08:00
2011-01-16 21:16:31 -08:00
2011-03-31 11:26:23 -03:00
2010-07-19 13:21:24 -07:00
2011-03-31 11:26:23 -03:00
2011-03-17 13:08:27 -03:00
2011-03-31 11:26:23 -03:00
2011-01-16 21:16:31 -08:00