Skip to content

Commit

Permalink
Merge pull request #1513 from hginjgerx/bugffff
Browse files Browse the repository at this point in the history
libhns: Two bugfixes in post_send flow
  • Loading branch information
rleon authored Nov 12, 2024
2 parents 423f8a1 + 18e3117 commit 48d0db2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions providers/hns/hns_roce_u_hw_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ static int set_rc_wqe(void *wqe, struct hns_roce_qp *qp, struct ibv_send_wr *wr,

hr_reg_write_bool(wqe, RCWQE_CQE,
!!(wr->send_flags & IBV_SEND_SIGNALED));
hr_reg_write_bool(wqe, RCWQE_FENCE,
hr_reg_write_bool(wqe, RCWQE_SO,
!!(wr->send_flags & IBV_SEND_FENCE));
hr_reg_write_bool(wqe, RCWQE_SE,
!!(wr->send_flags & IBV_SEND_SOLICITED));
Expand Down Expand Up @@ -1272,7 +1272,7 @@ int hns_roce_u_v2_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr,
struct hns_roce_context *ctx = to_hr_ctx(ibvqp->context);
struct hns_roce_qp *qp = to_hr_qp(ibvqp);
struct hns_roce_sge_info sge_info = {};
struct hns_roce_rc_sq_wqe *wqe;
struct hns_roce_rc_sq_wqe *wqe = NULL;
struct ibv_qp_attr attr = {};
unsigned int wqe_idx, nreq;
int ret;
Expand All @@ -1288,15 +1288,15 @@ int hns_roce_u_v2_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr,
sge_info.start_idx = qp->next_sge; /* start index of extend sge */

for (nreq = 0; wr; ++nreq, wr = wr->next) {
if (hns_roce_v2_wq_overflow(&qp->sq, nreq,
to_hr_cq(qp->verbs_qp.qp.send_cq))) {
ret = ENOMEM;
if (wr->num_sge > (int)qp->sq.max_gs) {
ret = qp->sq.max_gs > 0 ? EINVAL : EOPNOTSUPP;
*bad_wr = wr;
goto out;
}

if (wr->num_sge > qp->sq.max_gs) {
ret = EINVAL;
if (hns_roce_v2_wq_overflow(&qp->sq, nreq,
to_hr_cq(qp->verbs_qp.qp.send_cq))) {
ret = ENOMEM;
*bad_wr = wr;
goto out;
}
Expand Down

0 comments on commit 48d0db2

Please # to comment.