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: NMike Marciniszyn <mike.marciniszyn@qlogic.com> Reviewed-by: NRam Vepa <ram.vepa@qlogic.com> Signed-off-by: NRoland Dreier <roland@purestorage.com>
Showing
想要评论请 注册 或 登录