Skip to content

Commit

Permalink
RDMA/hns: Avoid unnecessary memset on WQEs in post_send
Browse files Browse the repository at this point in the history
All fields of WQE will be rewrote, so the memset is unnecessary. And when
SQ is working in OWNER mode, the pipeline may prefetch the WQEs beyond PI,
the memset operation may flip the owner bit too early, then the pipeline
may get a wrong WQ.

Link: https://lore.kernel.org/r/1612517974-31867-11-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
  • Loading branch information
Lang Cheng authored and Jason Gunthorpe committed Feb 9, 2021
1 parent 9937033 commit 62490fd
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/infiniband/hw/hns/hns_roce_hw_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ static inline int set_ud_wqe(struct hns_roce_qp *qp,
int ret;

valid_num_sge = calc_wr_sge_num(wr, &msg_len);
memset(ud_sq_wqe, 0, sizeof(*ud_sq_wqe));

ret = set_ud_opcode(ud_sq_wqe, wr);
if (WARN_ON(ret))
Expand Down Expand Up @@ -575,7 +574,6 @@ static inline int set_rc_wqe(struct hns_roce_qp *qp,
int ret;

valid_num_sge = calc_wr_sge_num(wr, &msg_len);
memset(rc_sq_wqe, 0, sizeof(*rc_sq_wqe));

rc_sq_wqe->msg_len = cpu_to_le32(msg_len);

Expand Down

0 comments on commit 62490fd

Please sign in to comment.