Skip to content

Commit

Permalink
RDMA/hns: Delete unnecessary branch of hns_roce_v2_query_qp
Browse files Browse the repository at this point in the history
When query_qp is called by userspace, max_send_wr and max_send_sge are set
to 0 by the kernel driver. However, the userspace does not use these two
return values from the kernel driver, but uses its own calculated values.
So there is no need for special treatment.

Fixes: 926a01d ("RDMA/hns: Add QP operations support for hip08 SoC")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Yangyang Li <[email protected]>
Signed-off-by: Weihang Li <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
  • Loading branch information
l00436852 authored and jgunthorpe committed Jun 22, 2021
1 parent cc925ec commit 58bc7ac
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/infiniband/hw/hns/hns_roce_hw_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -5182,13 +5182,8 @@ static int hns_roce_v2_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
qp_attr->cap.max_recv_sge = hr_qp->rq.max_gs - hr_qp->rq.rsv_sge;
qp_attr->cap.max_inline_data = hr_qp->max_inline_data;

if (!ibqp->uobject) {
qp_attr->cap.max_send_wr = hr_qp->sq.wqe_cnt;
qp_attr->cap.max_send_sge = hr_qp->sq.max_gs;
} else {
qp_attr->cap.max_send_wr = 0;
qp_attr->cap.max_send_sge = 0;
}
qp_attr->cap.max_send_wr = hr_qp->sq.wqe_cnt;
qp_attr->cap.max_send_sge = hr_qp->sq.max_gs;

qp_init_attr->qp_context = ibqp->qp_context;
qp_init_attr->qp_type = ibqp->qp_type;
Expand Down

0 comments on commit 58bc7ac

Please sign in to comment.