aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/cxgb4/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/cxgb4/device.c')
-rw-r--r--drivers/infiniband/hw/cxgb4/device.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
index c13c0ba30f63..d499cd61c0e8 100644
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@ -783,6 +783,7 @@ void c4iw_init_dev_ucontext(struct c4iw_rdev *rdev,
783static int c4iw_rdev_open(struct c4iw_rdev *rdev) 783static int c4iw_rdev_open(struct c4iw_rdev *rdev)
784{ 784{
785 int err; 785 int err;
786 unsigned int factor;
786 787
787 c4iw_init_dev_ucontext(rdev, &rdev->uctx); 788 c4iw_init_dev_ucontext(rdev, &rdev->uctx);
788 789
@@ -806,8 +807,18 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev)
806 return -EINVAL; 807 return -EINVAL;
807 } 808 }
808 809
809 rdev->qpmask = rdev->lldi.udb_density - 1; 810 /* This implementation requires a sge_host_page_size <= PAGE_SIZE. */
810 rdev->cqmask = rdev->lldi.ucq_density - 1; 811 if (rdev->lldi.sge_host_page_size > PAGE_SIZE) {
812 pr_err("%s: unsupported sge host page size %u\n",
813 pci_name(rdev->lldi.pdev),
814 rdev->lldi.sge_host_page_size);
815 return -EINVAL;
816 }
817
818 factor = PAGE_SIZE / rdev->lldi.sge_host_page_size;
819 rdev->qpmask = (rdev->lldi.udb_density * factor) - 1;
820 rdev->cqmask = (rdev->lldi.ucq_density * factor) - 1;
821
811 pr_debug("dev %s stag start 0x%0x size 0x%0x num stags %d pbl start 0x%0x size 0x%0x rq start 0x%0x size 0x%0x qp qid start %u size %u cq qid start %u size %u srq size %u\n", 822 pr_debug("dev %s stag start 0x%0x size 0x%0x num stags %d pbl start 0x%0x size 0x%0x rq start 0x%0x size 0x%0x qp qid start %u size %u cq qid start %u size %u srq size %u\n",
812 pci_name(rdev->lldi.pdev), rdev->lldi.vr->stag.start, 823 pci_name(rdev->lldi.pdev), rdev->lldi.vr->stag.start,
813 rdev->lldi.vr->stag.size, c4iw_num_stags(rdev), 824 rdev->lldi.vr->stag.size, c4iw_num_stags(rdev),