diff options
author | Michael J. Ruhl <michael.j.ruhl@intel.com> | 2017-05-04 15:14:57 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-05-05 02:31:46 +0300 |
commit | 5fbded483c699823a7cca001a5c27ddc4d73370f (patch) | |
tree | 283fd944cdb169bf6a7c59eb1023fe5c1de27c2b /drivers/infiniband/hw/hfi1/driver.c | |
parent | 780a4c16aaacba3746a20d9138a5b1f467035ffc (diff) | |
download | linux-5fbded483c699823a7cca001a5c27ddc4d73370f.tar.xz |
IB/hfi1: Search shared contexts on the opened device, not all devices
The search for available shared contexts walks each registered hfi1
device. This search is too broad because other devices may not
be on the same fabric, and using its contexts could cause unexpected
behavior.
Removed walking the list of devices, limiting the search to the opened
device. With the device walk removed, the hfi1_devdata (dd) is not
available. Added it to the hfi1_filedata for reference.
With this change, hfi1_count_units() was rendered obsolete and was
removed.
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/driver.c')
-rw-r--r-- | drivers/infiniband/hw/hfi1/driver.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/drivers/infiniband/hw/hfi1/driver.c b/drivers/infiniband/hw/hfi1/driver.c index fb319d2a579e..566d152e36f2 100644 --- a/drivers/infiniband/hw/hfi1/driver.c +++ b/drivers/infiniband/hw/hfi1/driver.c @@ -211,42 +211,6 @@ int hfi1_count_active_units(void) } /* - * Return count of all units, optionally return in arguments - * the number of usable (present) units, and the number of - * ports that are up. - */ -int hfi1_count_units(int *npresentp, int *nupp) -{ - int nunits = 0, npresent = 0, nup = 0; - struct hfi1_devdata *dd; - unsigned long flags; - int pidx; - struct hfi1_pportdata *ppd; - - spin_lock_irqsave(&hfi1_devs_lock, flags); - - list_for_each_entry(dd, &hfi1_dev_list, list) { - nunits++; - if ((dd->flags & HFI1_PRESENT) && dd->kregbase) - npresent++; - for (pidx = 0; pidx < dd->num_pports; ++pidx) { - ppd = dd->pport + pidx; - if (ppd->lid && ppd->linkup) - nup++; - } - } - - spin_unlock_irqrestore(&hfi1_devs_lock, flags); - - if (npresentp) - *npresentp = npresent; - if (nupp) - *nupp = nup; - - return nunits; -} - -/* * Get address of eager buffer from it's index (allocated in chunks, not * contiguous). */ |