Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1474661
| From | Salil Mehta <salil.mehta@huawei.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH for-next 05/10] IB/hns: Fix two possible bugs for rdma cm |
| Date | 2016-09-01 23:30 +0200 |
| Message-ID | <scHID-79t-53@gated-at.bofh.it> (permalink) |
| References | <scHIB-79t-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Lijun Ou <oulijun@huawei.com>
Fix the length of wqe that maybe lead to an error and
write the end bytes of QP1C into the register.
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Reviewed-by: Wei Hu <xavier.huwei@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index 399f5de..aaea95c 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -205,8 +205,7 @@ int hns_roce_v1_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
(wr->send_flags & IB_SEND_FENCE ?
(cpu_to_le32(HNS_ROCE_WQE_FENCE)) : 0);
- wqe = (struct hns_roce_wqe_ctrl_seg *)wqe +
- sizeof(struct hns_roce_wqe_ctrl_seg);
+ wqe += sizeof(struct hns_roce_wqe_ctrl_seg);
switch (wr->opcode) {
case IB_WR_RDMA_READ:
@@ -235,8 +234,7 @@ int hns_roce_v1_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
break;
}
ctrl->flag |= cpu_to_le32(ps_opcode);
- wqe = (struct hns_roce_wqe_raddr_seg *)wqe +
- sizeof(struct hns_roce_wqe_raddr_seg);
+ wqe += sizeof(struct hns_roce_wqe_raddr_seg);
dseg = wqe;
if (wr->send_flags & IB_SEND_INLINE && wr->num_sge) {
@@ -253,8 +251,7 @@ int hns_roce_v1_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
memcpy(wqe, ((void *) (uintptr_t)
wr->sg_list[i].addr),
wr->sg_list[i].length);
- wqe = (struct hns_roce_wqe_raddr_seg *)
- wqe + wr->sg_list[i].length;
+ wqe += wr->sg_list[i].length;
}
ctrl->flag |= HNS_ROCE_WQE_INLINE;
} else {
@@ -1795,6 +1792,7 @@ static int hns_roce_v1_m_sqp(struct ib_qp *ibqp, const struct ib_qp_attr *attr,
writel(context->qp1c_bytes_28, addr + 6);
writel(context->qp1c_bytes_32, addr + 7);
writel(context->cur_sq_wqe_ba_l, addr + 8);
+ writel(context->qp1c_bytes_40, addr + 9);
}
/* Modify QP1C status */
--
1.7.9.5
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH for-next 00/10] Add CM(Connection Manager) Support to HNS RoCe Driver Salil Mehta <salil.mehta@huawei.com> - 2016-09-01 23:30 +0200 [PATCH for-next 10/10] IB/hns: Add node_guid definition to the bindings document Salil Mehta <salil.mehta@huawei.com> - 2016-09-01 23:30 +0200 [PATCH for-next 01/10] IB/hns: Register HNS RoCE Driver get_netdev() with IB Core Salil Mehta <salil.mehta@huawei.com> - 2016-09-01 23:30 +0200 [PATCH for-next 07/10] IB/hns: Change the logic for allocating uar registers Salil Mehta <salil.mehta@huawei.com> - 2016-09-01 23:30 +0200 [PATCH for-next 08/10] IB/hns: Fix the bug of rdma cm connecting on user mode Salil Mehta <salil.mehta@huawei.com> - 2016-09-01 23:30 +0200 [PATCH for-next 09/10] IB/hns: Fix two bugs for rdma cm connecting Salil Mehta <salil.mehta@huawei.com> - 2016-09-01 23:30 +0200 [PATCH for-next 04/10] IB/hns: Fix the value of device_cap_flags Salil Mehta <salil.mehta@huawei.com> - 2016-09-01 23:30 +0200 [PATCH for-next 05/10] IB/hns: Fix two possible bugs for rdma cm Salil Mehta <salil.mehta@huawei.com> - 2016-09-01 23:30 +0200 [PATCH for-next 06/10] IB/hns: Add phy_port for computing GSI/QPN Salil Mehta <salil.mehta@huawei.com> - 2016-09-01 23:30 +0200
csiph-web