diff options
author | Hariprasad S <hariprasad@chelsio.com> | 2015-04-21 16:15:01 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-05-05 09:18:01 -0400 |
commit | 4a75a86c8d04390f268d7237cc49fe9a8e36efe7 (patch) | |
tree | 99ba8b48deee5b03ad472ac8635dd629cd38af0c /drivers/infiniband | |
parent | 09ece8b9e983fe858de6eab7a386d58d194227b6 (diff) |
iw_cxgb4: enforce qp/cq id requirements
Currently the iw_cxgb4 implementation requires the qp and cq qid densities
to match as well as the qp and cq id ranges. So fail a device open if
the device configuration doesn't meet the requirements.
The reason for these restictions has to do with the fact that IQ qid X
has a UGTS register in the same bar2 page as EQ qid X. Thus both qids
need to be allocated to the same user process for security reasons.
The logic that does this (the qpid allocator in iw_cxgb4/resource.c)
handles this but requires the above restrictions.
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/cxgb4/device.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c index 7ed32537eb59..83209bb38285 100644 --- a/drivers/infiniband/hw/cxgb4/device.c +++ b/drivers/infiniband/hw/cxgb4/device.c | |||
@@ -765,6 +765,29 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev) | |||
765 | c4iw_init_dev_ucontext(rdev, &rdev->uctx); | 765 | c4iw_init_dev_ucontext(rdev, &rdev->uctx); |
766 | 766 | ||
767 | /* | 767 | /* |
768 | * This implementation assumes udb_density == ucq_density! Eventually | ||
769 | * we might need to support this but for now fail the open. Also the | ||
770 | * cqid and qpid range must match for now. | ||
771 | */ | ||
772 | if (rdev->lldi.udb_density != rdev->lldi.ucq_density) { | ||
773 | pr_err(MOD "%s: unsupported udb/ucq densities %u/%u\n", | ||
774 | pci_name(rdev->lldi.pdev), rdev->lldi.udb_density, | ||
775 | rdev->lldi.ucq_density); | ||
776 | err = -EINVAL; | ||
777 | goto err1; | ||
778 | } | ||
779 | if (rdev->lldi.vr->qp.start != rdev->lldi.vr->cq.start || | ||
780 | rdev->lldi.vr->qp.size != rdev->lldi.vr->cq.size) { | ||
781 | pr_err(MOD "%s: unsupported qp and cq id ranges " | ||
782 | "qp start %u size %u cq start %u size %u\n", | ||
783 | pci_name(rdev->lldi.pdev), rdev->lldi.vr->qp.start, | ||
784 | rdev->lldi.vr->qp.size, rdev->lldi.vr->cq.size, | ||
785 | rdev->lldi.vr->cq.size); | ||
786 | err = -EINVAL; | ||
787 | goto err1; | ||
788 | } | ||
789 | |||
790 | /* | ||
768 | * qpshift is the number of bits to shift the qpid left in order | 791 | * qpshift is the number of bits to shift the qpid left in order |
769 | * to get the correct address of the doorbell for that qp. | 792 | * to get the correct address of the doorbell for that qp. |
770 | */ | 793 | */ |