提交 fc467537 编写于 作者: L Lijun Ou 提交者: Xie XiuQi

RDMA/hns: Bugfix for filling opcode of UD work request

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

According to IB protocol and hip08 user manual, The UD transport should
support send and send with immedate operation. Here fixes it.

Fixes: fd302d733fae ("{1620 CS} RDMA/hns: Add UD support for hip08 kernel")

Feature or Bugfix:Bugfix
Signed-off-by: NLijun Ou <oulijun@huawei.com>
Reviewed-by: Nliuyixian <liuyixian@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 e392c964
...@@ -439,11 +439,6 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, ...@@ -439,11 +439,6 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
V2_UD_SEND_WQE_BYTE_40_LBI_S, V2_UD_SEND_WQE_BYTE_40_LBI_S,
hr_dev->loop_idc); hr_dev->loop_idc);
roce_set_field(ud_sq_wqe->byte_4,
V2_UD_SEND_WQE_BYTE_4_OPCODE_M,
V2_UD_SEND_WQE_BYTE_4_OPCODE_S,
HNS_ROCE_V2_WQE_OP_SEND);
for (i = 0; i < wr->num_sge; i++) for (i = 0; i < wr->num_sge; i++)
tmp_len += wr->sg_list[i].length; tmp_len += wr->sg_list[i].length;
...@@ -451,16 +446,24 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, ...@@ -451,16 +446,24 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
cpu_to_le32(le32_to_cpu(ud_sq_wqe->msg_len) + tmp_len); cpu_to_le32(le32_to_cpu(ud_sq_wqe->msg_len) + tmp_len);
switch (wr->opcode) { switch (wr->opcode) {
case IB_WR_SEND:
hr_op = HNS_ROCE_V2_WQE_OP_SEND;
ud_sq_wqe->immtdata = 0;
break;
case IB_WR_SEND_WITH_IMM: case IB_WR_SEND_WITH_IMM:
case IB_WR_RDMA_WRITE_WITH_IMM: hr_op = HNS_ROCE_V2_WQE_OP_SEND_WITH_IMM;
ud_sq_wqe->immtdata = ud_sq_wqe->immtdata =
cpu_to_le32(be32_to_cpu(wr->ex.imm_data)); cpu_to_le32(be32_to_cpu(wr->ex.imm_data));
break; break;
default: default:
ud_sq_wqe->immtdata = 0; hr_op = HNS_ROCE_V2_WQE_OP_MASK;
break; break;
} }
roce_set_field(ud_sq_wqe->byte_4,
V2_UD_SEND_WQE_BYTE_4_OPCODE_M,
V2_UD_SEND_WQE_BYTE_4_OPCODE_S, hr_op);
/* Set sig attr */ /* Set sig attr */
roce_set_bit(ud_sq_wqe->byte_4, roce_set_bit(ud_sq_wqe->byte_4,
V2_UD_SEND_WQE_BYTE_4_CQE_S, V2_UD_SEND_WQE_BYTE_4_CQE_S,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册