Skip to content
Commit 53ab1c64 authored by Mike Marciniszyn's avatar Mike Marciniszyn Committed by Roland Dreier
Browse files

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: default avatarMike Marciniszyn <mike.marciniszyn@qlogic.com>
Reviewed-by: default avatarRam Vepa <ram.vepa@qlogic.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 976d1676
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment