mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-26 03:20:55 +07:00
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>
This commit is contained in:
parent
2f1fb507ee
commit
30a6a62fc3
@ -1345,7 +1345,6 @@ int c4iw_destroy_qp(struct ib_qp *ib_qp)
|
|||||||
wait_event(qhp->wait, !qhp->ep);
|
wait_event(qhp->wait, !qhp->ep);
|
||||||
|
|
||||||
remove_handle(rhp, &rhp->qpidr, qhp->wq.sq.qid);
|
remove_handle(rhp, &rhp->qpidr, qhp->wq.sq.qid);
|
||||||
remove_handle(rhp, &rhp->qpidr, qhp->wq.rq.qid);
|
|
||||||
atomic_dec(&qhp->refcnt);
|
atomic_dec(&qhp->refcnt);
|
||||||
wait_event(qhp->wait, !atomic_read(&qhp->refcnt));
|
wait_event(qhp->wait, !atomic_read(&qhp->refcnt));
|
||||||
|
|
||||||
@ -1448,30 +1447,26 @@ struct ib_qp *c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs,
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto err2;
|
goto err2;
|
||||||
|
|
||||||
ret = insert_handle(rhp, &rhp->qpidr, qhp, qhp->wq.rq.qid);
|
|
||||||
if (ret)
|
|
||||||
goto err3;
|
|
||||||
|
|
||||||
if (udata) {
|
if (udata) {
|
||||||
mm1 = kmalloc(sizeof *mm1, GFP_KERNEL);
|
mm1 = kmalloc(sizeof *mm1, GFP_KERNEL);
|
||||||
if (!mm1) {
|
if (!mm1) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto err4;
|
goto err3;
|
||||||
}
|
}
|
||||||
mm2 = kmalloc(sizeof *mm2, GFP_KERNEL);
|
mm2 = kmalloc(sizeof *mm2, GFP_KERNEL);
|
||||||
if (!mm2) {
|
if (!mm2) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto err5;
|
goto err4;
|
||||||
}
|
}
|
||||||
mm3 = kmalloc(sizeof *mm3, GFP_KERNEL);
|
mm3 = kmalloc(sizeof *mm3, GFP_KERNEL);
|
||||||
if (!mm3) {
|
if (!mm3) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto err6;
|
goto err5;
|
||||||
}
|
}
|
||||||
mm4 = kmalloc(sizeof *mm4, GFP_KERNEL);
|
mm4 = kmalloc(sizeof *mm4, GFP_KERNEL);
|
||||||
if (!mm4) {
|
if (!mm4) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto err7;
|
goto err6;
|
||||||
}
|
}
|
||||||
|
|
||||||
uresp.qid_mask = rhp->rdev.qpmask;
|
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,
|
|||||||
spin_unlock(&ucontext->mmap_lock);
|
spin_unlock(&ucontext->mmap_lock);
|
||||||
ret = ib_copy_to_udata(udata, &uresp, sizeof uresp);
|
ret = ib_copy_to_udata(udata, &uresp, sizeof uresp);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err8;
|
goto err7;
|
||||||
mm1->key = uresp.sq_key;
|
mm1->key = uresp.sq_key;
|
||||||
mm1->addr = virt_to_phys(qhp->wq.sq.queue);
|
mm1->addr = virt_to_phys(qhp->wq.sq.queue);
|
||||||
mm1->len = PAGE_ALIGN(qhp->wq.sq.memsize);
|
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,
|
|||||||
__func__, qhp, qhp->attr.sq_num_entries, qhp->attr.rq_num_entries,
|
__func__, qhp, qhp->attr.sq_num_entries, qhp->attr.rq_num_entries,
|
||||||
qhp->wq.sq.qid);
|
qhp->wq.sq.qid);
|
||||||
return &qhp->ibqp;
|
return &qhp->ibqp;
|
||||||
err8:
|
|
||||||
kfree(mm4);
|
|
||||||
err7:
|
err7:
|
||||||
kfree(mm3);
|
kfree(mm4);
|
||||||
err6:
|
err6:
|
||||||
kfree(mm2);
|
kfree(mm3);
|
||||||
err5:
|
err5:
|
||||||
kfree(mm1);
|
kfree(mm2);
|
||||||
err4:
|
err4:
|
||||||
remove_handle(rhp, &rhp->qpidr, qhp->wq.rq.qid);
|
kfree(mm1);
|
||||||
err3:
|
err3:
|
||||||
remove_handle(rhp, &rhp->qpidr, qhp->wq.sq.qid);
|
remove_handle(rhp, &rhp->qpidr, qhp->wq.sq.qid);
|
||||||
err2:
|
err2:
|
||||||
|
Loading…
Reference in New Issue
Block a user