aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorSteve Wise <swise@opengridcomputing.com>2010-05-20 17:58:21 -0400
committerRoland Dreier <rolandd@cisco.com>2010-05-25 00:08:05 -0400
commit30a6a62fc35208924ffa8a472b0af4552441cbff (patch)
treec631297333335282bbc4f1bf2314d1f319c401bd /drivers/infiniband
parent2f1fb507eec22ee64b541ea8586a7365ede8be2e (diff)
RDMA/cxgb4: Only insert sq qid in lookup table
Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/cxgb4/qp.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index a41881b15e6d..0c28ed1eafa6 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -1345,7 +1345,6 @@ int c4iw_destroy_qp(struct ib_qp *ib_qp)
1345 wait_event(qhp->wait, !qhp->ep); 1345 wait_event(qhp->wait, !qhp->ep);
1346 1346
1347 remove_handle(rhp, &rhp->qpidr, qhp->wq.sq.qid); 1347 remove_handle(rhp, &rhp->qpidr, qhp->wq.sq.qid);
1348 remove_handle(rhp, &rhp->qpidr, qhp->wq.rq.qid);
1349 atomic_dec(&qhp->refcnt); 1348 atomic_dec(&qhp->refcnt);
1350 wait_event(qhp->wait, !atomic_read(&qhp->refcnt)); 1349 wait_event(qhp->wait, !atomic_read(&qhp->refcnt));
1351 1350
@@ -1448,30 +1447,26 @@ struct ib_qp *c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs,
1448 if (ret) 1447 if (ret)
1449 goto err2; 1448 goto err2;
1450 1449
1451 ret = insert_handle(rhp, &rhp->qpidr, qhp, qhp->wq.rq.qid);
1452 if (ret)
1453 goto err3;
1454
1455 if (udata) { 1450 if (udata) {
1456 mm1 = kmalloc(sizeof *mm1, GFP_KERNEL); 1451 mm1 = kmalloc(sizeof *mm1, GFP_KERNEL);
1457 if (!mm1) { 1452 if (!mm1) {
1458 ret = -ENOMEM; 1453 ret = -ENOMEM;
1459 goto err4; 1454 goto err3;
1460 } 1455 }
1461 mm2 = kmalloc(sizeof *mm2, GFP_KERNEL); 1456 mm2 = kmalloc(sizeof *mm2, GFP_KERNEL);
1462 if (!mm2) { 1457 if (!mm2) {
1463 ret = -ENOMEM; 1458 ret = -ENOMEM;
1464 goto err5; 1459 goto err4;
1465 } 1460 }
1466 mm3 = kmalloc(sizeof *mm3, GFP_KERNEL); 1461 mm3 = kmalloc(sizeof *mm3, GFP_KERNEL);
1467 if (!mm3) { 1462 if (!mm3) {
1468 ret = -ENOMEM; 1463 ret = -ENOMEM;
1469 goto err6; 1464 goto err5;
1470 } 1465 }
1471 mm4 = kmalloc(sizeof *mm4, GFP_KERNEL); 1466 mm4 = kmalloc(sizeof *mm4, GFP_KERNEL);
1472 if (!mm4) { 1467 if (!mm4) {
1473 ret = -ENOMEM; 1468 ret = -ENOMEM;
1474 goto err7; 1469 goto err6;
1475 } 1470 }
1476 1471
1477 uresp.qid_mask = rhp->rdev.qpmask; 1472 uresp.qid_mask = rhp->rdev.qpmask;
@@ -1493,7 +1488,7 @@ struct ib_qp *c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs,
1493 spin_unlock(&ucontext->mmap_lock); 1488 spin_unlock(&ucontext->mmap_lock);
1494 ret = ib_copy_to_udata(udata, &uresp, sizeof uresp); 1489 ret = ib_copy_to_udata(udata, &uresp, sizeof uresp);
1495 if (ret) 1490 if (ret)
1496 goto err8; 1491 goto err7;
1497 mm1->key = uresp.sq_key; 1492 mm1->key = uresp.sq_key;
1498 mm1->addr = virt_to_phys(qhp->wq.sq.queue); 1493 mm1->addr = virt_to_phys(qhp->wq.sq.queue);
1499 mm1->len = PAGE_ALIGN(qhp->wq.sq.memsize); 1494 mm1->len = PAGE_ALIGN(qhp->wq.sq.memsize);
@@ -1517,16 +1512,14 @@ struct ib_qp *c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs,
1517 __func__, qhp, qhp->attr.sq_num_entries, qhp->attr.rq_num_entries, 1512 __func__, qhp, qhp->attr.sq_num_entries, qhp->attr.rq_num_entries,
1518 qhp->wq.sq.qid); 1513 qhp->wq.sq.qid);
1519 return &qhp->ibqp; 1514 return &qhp->ibqp;
1520err8:
1521 kfree(mm4);
1522err7: 1515err7:
1523 kfree(mm3); 1516 kfree(mm4);
1524err6: 1517err6:
1525 kfree(mm2); 1518 kfree(mm3);
1526err5: 1519err5:
1527 kfree(mm1); 1520 kfree(mm2);
1528err4: 1521err4:
1529 remove_handle(rhp, &rhp->qpidr, qhp->wq.rq.qid); 1522 kfree(mm1);
1530err3: 1523err3:
1531 remove_handle(rhp, &rhp->qpidr, qhp->wq.sq.qid); 1524 remove_handle(rhp, &rhp->qpidr, qhp->wq.sq.qid);
1532err2: 1525err2: