diff mbox series

[for-next,1/2] RDMA/hns: Bugfix for filling the sge of srq

Message ID 1559298484-63548-2-git-send-email-oulijun@huawei.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show
Series Two srq bugfixes | expand

Commit Message

Lijun Ou May 31, 2019, 10:28 a.m. UTC
When user post recv a srq with multiple sges, the hardware will
get the last correct sge and count the sge numbers according to
the specific identifier with lkey. For example, when the driver
fill the sges with every wr less than the max sge that the user
configured when creating srq, the hardware will stop getting the
sge according to the specific lkey in the sge. However, it will
always end with the first sge in the current post srq recv
interface implementation.

Fixes: c7bcb13442e1 ("RDMA/hns: Add SRQ support for hip08 kernel mode")
Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jason Gunthorpe June 7, 2019, 6:02 p.m. UTC | #1
On Fri, May 31, 2019 at 06:28:03PM +0800, Lijun Ou wrote:
> When user post recv a srq with multiple sges, the hardware will
> get the last correct sge and count the sge numbers according to
> the specific identifier with lkey. For example, when the driver
> fill the sges with every wr less than the max sge that the user
> configured when creating srq, the hardware will stop getting the
> sge according to the specific lkey in the sge. However, it will
> always end with the first sge in the current post srq recv
> interface implementation.
> 
> Fixes: c7bcb13442e1 ("RDMA/hns: Add SRQ support for hip08 kernel mode")
> Signed-off-by: Lijun Ou <oulijun@huawei.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Applied to for-next, thanks

Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 135c703..ca319fc 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -6079,9 +6079,9 @@  static int hns_roce_v2_post_srq_recv(struct ib_srq *ibsrq,
 		}
 
 		if (i < srq->max_gs) {
-			dseg->len = 0;
-			dseg->lkey = cpu_to_le32(0x100);
-			dseg->addr = 0;
+			dseg[i].len = 0;
+			dseg[i].lkey = cpu_to_le32(0x100);
+			dseg[i].addr = 0;
 		}
 
 		srq->wrid[wqe_idx] = wr->wr_id;