aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/cxgb3/cxio_hal.c
diff options
context:
space:
mode:
authorSteve Wise <swise@opengridcomputing.com>2010-01-27 15:22:34 -0500
committerRoland Dreier <rolandd@cisco.com>2010-02-24 13:40:29 -0500
commit5279d3ac2d9ca578d04c6f0c760485b0621eb393 (patch)
treed6fcd241a879c4e8b340e96e091a32cf1c44b3ac /drivers/infiniband/hw/cxgb3/cxio_hal.c
parent9918b28d2bf733816c5d1612fe17ca380b601b10 (diff)
RDMA/cxgb3: Don't allocate the SW queue for user mode CQs
Only kernel mode CQs need the SW queue memory allocated. The SW queue for user mode CQs is allocated in userspace by libcxgb3. Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/cxgb3/cxio_hal.c')
-rw-r--r--drivers/infiniband/hw/cxgb3/cxio_hal.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c b/drivers/infiniband/hw/cxgb3/cxio_hal.c
index 8837d56f9c92..a28e862f2d68 100644
--- a/drivers/infiniband/hw/cxgb3/cxio_hal.c
+++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c
@@ -154,7 +154,7 @@ static int cxio_hal_clear_qp_ctx(struct cxio_rdev *rdev_p, u32 qpid)
154 return iwch_cxgb3_ofld_send(rdev_p->t3cdev_p, skb); 154 return iwch_cxgb3_ofld_send(rdev_p->t3cdev_p, skb);
155} 155}
156 156
157int cxio_create_cq(struct cxio_rdev *rdev_p, struct t3_cq *cq) 157int cxio_create_cq(struct cxio_rdev *rdev_p, struct t3_cq *cq, int kernel)
158{ 158{
159 struct rdma_cq_setup setup; 159 struct rdma_cq_setup setup;
160 int size = (1UL << (cq->size_log2)) * sizeof(struct t3_cqe); 160 int size = (1UL << (cq->size_log2)) * sizeof(struct t3_cqe);
@@ -162,12 +162,12 @@ int cxio_create_cq(struct cxio_rdev *rdev_p, struct t3_cq *cq)
162 cq->cqid = cxio_hal_get_cqid(rdev_p->rscp); 162 cq->cqid = cxio_hal_get_cqid(rdev_p->rscp);
163 if (!cq->cqid) 163 if (!cq->cqid)
164 return -ENOMEM; 164 return -ENOMEM;
165 cq->sw_queue = kzalloc(size, GFP_KERNEL); 165 if (kernel) {
166 if (!cq->sw_queue) 166 cq->sw_queue = kzalloc(size, GFP_KERNEL);
167 return -ENOMEM; 167 if (!cq->sw_queue)
168 cq->queue = dma_alloc_coherent(&(rdev_p->rnic_info.pdev->dev), 168 return -ENOMEM;
169 (1UL << (cq->size_log2)) * 169 }
170 sizeof(struct t3_cqe), 170 cq->queue = dma_alloc_coherent(&(rdev_p->rnic_info.pdev->dev), size,
171 &(cq->dma_addr), GFP_KERNEL); 171 &(cq->dma_addr), GFP_KERNEL);
172 if (!cq->queue) { 172 if (!cq->queue) {
173 kfree(cq->sw_queue); 173 kfree(cq->sw_queue);