RDMA/hns: Bugfix for checking whether the srq is full when post wr
authorWenpeng Liang <liangwenpeng@huawei.com>
Sat, 30 Jan 2021 08:58:00 +0000 (16:58 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 8 Feb 2021 23:37:33 +0000 (19:37 -0400)
commit1620f09b96ec14c1ff1ff64ee0aeabc027c653d5
treefab480751fe71ff9c20df99e6ef618b647fffe69
parent9dd052474a2645b2a6171d19ad17b05b180d446d
RDMA/hns: Bugfix for checking whether the srq is full when post wr

If a user posts WR by wr_list, the head pointer of idx_queue won't be
updated until all wqes are filled, so the judgment of whether head equals
to tail will get a wrong result. Fix above issue and move the head and
tail pointer from the srq structure into the idx_queue structure. After
idx_queue is filled with wqe idx, the head pointer of it will increase.

Fixes: c7bcb13442e1 ("RDMA/hns: Add SRQ support for hip08 kernel mode")
Link: https://lore.kernel.org/r/1611997090-48820-3-git-send-email-liweihang@huawei.com
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/hns/hns_roce_device.h
drivers/infiniband/hw/hns/hns_roce_hw_v2.c
drivers/infiniband/hw/hns/hns_roce_srq.c