@@ -406,7 +406,7 @@ static int hns_roce_v2_poll_one(struct hns_roce_cq *cq,
case HNS_ROCE_RECV_OP_RDMA_WRITE_IMM:
wc->opcode = IBV_WC_RECV_RDMA_WITH_IMM;
wc->wc_flags = IBV_WC_WITH_IMM;
- wc->imm_data = cqe->immtdata;
+ wc->imm_data = htobe32(le32toh(cqe->immtdata));
break;
case HNS_ROCE_RECV_OP_SEND:
@@ -417,7 +417,7 @@ static int hns_roce_v2_poll_one(struct hns_roce_cq *cq,
case HNS_ROCE_RECV_OP_SEND_WITH_IMM:
wc->opcode = IBV_WC_RECV;
wc->wc_flags = IBV_WC_WITH_IMM;
- wc->imm_data = cqe->immtdata;
+ wc->imm_data = htobe32(le32toh(cqe->immtdata));
break;
case HNS_ROCE_RECV_OP_SEND_WITH_INV:
@@ -593,7 +593,7 @@ static int hns_roce_u_v2_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr,
if (wr->opcode == IBV_WR_SEND_WITH_IMM ||
wr->opcode == IBV_WR_RDMA_WRITE_WITH_IMM)
- rc_sq_wqe->immtdata = wr->imm_data;
+ rc_sq_wqe->immtdata = htole32(be32toh(wr->imm_data));
roce_set_field(rc_sq_wqe->byte_16, RC_SQ_WQE_BYTE_16_SGE_NUM_M,
RC_SQ_WQE_BYTE_16_SGE_NUM_S, wr->num_sge);
@@ -173,7 +173,7 @@ struct hns_roce_v2_cqe {
__le32 byte_4;
union {
__le32 rkey;
- __be32 immtdata;
+ __le32 immtdata;
};
__le32 byte_12;
__le32 byte_16;
@@ -227,7 +227,7 @@ struct hns_roce_rc_sq_wqe {
__le32 msg_len;
union {
__le32 inv_key;
- __be32 immtdata;
+ __le32 immtdata;
};
__le32 byte_16;
__le32 byte_20;
Because the data structure of hip08 is little endian, it need to fix the immediate field of wqe and cqe into __le32. This patch fixes it. Signed-off-by: Lijun Ou <oulijun@huawei.com> --- providers/hns/hns_roce_u_hw_v2.c | 6 +++--- providers/hns/hns_roce_u_hw_v2.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)