IB/hfi1: Search shared contexts on the opened device, not all devices
authorMichael J. Ruhl <michael.j.ruhl@intel.com>
Thu, 4 May 2017 12:14:57 +0000 (05:14 -0700)
committerDoug Ledford <dledford@redhat.com>
Thu, 4 May 2017 23:31:46 +0000 (19:31 -0400)
commit5fbded483c699823a7cca001a5c27ddc4d73370f
tree283fd944cdb169bf6a7c59eb1023fe5c1de27c2b
parent780a4c16aaacba3746a20d9138a5b1f467035ffc
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>
drivers/infiniband/hw/hfi1/driver.c
drivers/infiniband/hw/hfi1/file_ops.c
drivers/infiniband/hw/hfi1/hfi.h