|
@@ -154,7 +154,7 @@ static int cxio_hal_clear_qp_ctx(struct cxio_rdev *rdev_p, u32 qpid)
|
|
|
return iwch_cxgb3_ofld_send(rdev_p->t3cdev_p, skb);
|
|
|
}
|
|
|
|
|
|
-int cxio_create_cq(struct cxio_rdev *rdev_p, struct t3_cq *cq)
|
|
|
+int cxio_create_cq(struct cxio_rdev *rdev_p, struct t3_cq *cq, int kernel)
|
|
|
{
|
|
|
struct rdma_cq_setup setup;
|
|
|
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)
|
|
|
cq->cqid = cxio_hal_get_cqid(rdev_p->rscp);
|
|
|
if (!cq->cqid)
|
|
|
return -ENOMEM;
|
|
|
- cq->sw_queue = kzalloc(size, GFP_KERNEL);
|
|
|
- if (!cq->sw_queue)
|
|
|
- return -ENOMEM;
|
|
|
- cq->queue = dma_alloc_coherent(&(rdev_p->rnic_info.pdev->dev),
|
|
|
- (1UL << (cq->size_log2)) *
|
|
|
- sizeof(struct t3_cqe),
|
|
|
+ if (kernel) {
|
|
|
+ cq->sw_queue = kzalloc(size, GFP_KERNEL);
|
|
|
+ if (!cq->sw_queue)
|
|
|
+ return -ENOMEM;
|
|
|
+ }
|
|
|
+ cq->queue = dma_alloc_coherent(&(rdev_p->rnic_info.pdev->dev), size,
|
|
|
&(cq->dma_addr), GFP_KERNEL);
|
|
|
if (!cq->queue) {
|
|
|
kfree(cq->sw_queue);
|