Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: RDMA/cxgb4: Obtain RDMA QID ranges from LLD/FW
This commit is contained in:
commit
3e7561636f
|
@ -250,12 +250,17 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev)
|
||||||
rdev->cqshift = PAGE_SHIFT - ilog2(rdev->lldi.ucq_density);
|
rdev->cqshift = PAGE_SHIFT - ilog2(rdev->lldi.ucq_density);
|
||||||
rdev->cqmask = rdev->lldi.ucq_density - 1;
|
rdev->cqmask = rdev->lldi.ucq_density - 1;
|
||||||
PDBG("%s dev %s stag start 0x%0x size 0x%0x num stags %d "
|
PDBG("%s 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\n",
|
"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\n",
|
||||||
__func__, pci_name(rdev->lldi.pdev), rdev->lldi.vr->stag.start,
|
__func__, pci_name(rdev->lldi.pdev), rdev->lldi.vr->stag.start,
|
||||||
rdev->lldi.vr->stag.size, c4iw_num_stags(rdev),
|
rdev->lldi.vr->stag.size, c4iw_num_stags(rdev),
|
||||||
rdev->lldi.vr->pbl.start,
|
rdev->lldi.vr->pbl.start,
|
||||||
rdev->lldi.vr->pbl.size, rdev->lldi.vr->rq.start,
|
rdev->lldi.vr->pbl.size, rdev->lldi.vr->rq.start,
|
||||||
rdev->lldi.vr->rq.size);
|
rdev->lldi.vr->rq.size,
|
||||||
|
rdev->lldi.vr->qp.start,
|
||||||
|
rdev->lldi.vr->qp.size,
|
||||||
|
rdev->lldi.vr->cq.start,
|
||||||
|
rdev->lldi.vr->cq.size);
|
||||||
PDBG("udb len 0x%x udb base %p db_reg %p gts_reg %p qpshift %lu "
|
PDBG("udb len 0x%x udb base %p db_reg %p gts_reg %p qpshift %lu "
|
||||||
"qpmask 0x%x cqshift %lu cqmask 0x%x\n",
|
"qpmask 0x%x cqshift %lu cqmask 0x%x\n",
|
||||||
(unsigned)pci_resource_len(rdev->lldi.pdev, 2),
|
(unsigned)pci_resource_len(rdev->lldi.pdev, 2),
|
||||||
|
|
|
@ -110,11 +110,12 @@ static int c4iw_init_qid_fifo(struct c4iw_rdev *rdev)
|
||||||
|
|
||||||
spin_lock_init(&rdev->resource.qid_fifo_lock);
|
spin_lock_init(&rdev->resource.qid_fifo_lock);
|
||||||
|
|
||||||
if (kfifo_alloc(&rdev->resource.qid_fifo, T4_MAX_QIDS * sizeof(u32),
|
if (kfifo_alloc(&rdev->resource.qid_fifo, rdev->lldi.vr->qp.size *
|
||||||
GFP_KERNEL))
|
sizeof(u32), GFP_KERNEL))
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
for (i = T4_QID_BASE; i < T4_QID_BASE + T4_MAX_QIDS; i++)
|
for (i = rdev->lldi.vr->qp.start;
|
||||||
|
i < rdev->lldi.vr->qp.start + rdev->lldi.vr->qp.size; i++)
|
||||||
if (!(i & rdev->qpmask))
|
if (!(i & rdev->qpmask))
|
||||||
kfifo_in(&rdev->resource.qid_fifo,
|
kfifo_in(&rdev->resource.qid_fifo,
|
||||||
(unsigned char *) &i, sizeof(u32));
|
(unsigned char *) &i, sizeof(u32));
|
||||||
|
|
|
@ -36,8 +36,6 @@
|
||||||
#include "t4_msg.h"
|
#include "t4_msg.h"
|
||||||
#include "t4fw_ri_api.h"
|
#include "t4fw_ri_api.h"
|
||||||
|
|
||||||
#define T4_QID_BASE 1024
|
|
||||||
#define T4_MAX_QIDS 256
|
|
||||||
#define T4_MAX_NUM_QP (1<<16)
|
#define T4_MAX_NUM_QP (1<<16)
|
||||||
#define T4_MAX_NUM_CQ (1<<15)
|
#define T4_MAX_NUM_CQ (1<<15)
|
||||||
#define T4_MAX_NUM_PD (1<<15)
|
#define T4_MAX_NUM_PD (1<<15)
|
||||||
|
|
Loading…
Reference in New Issue