OSDN Git Service

RDMA/hns: Allocate one more recv SGE for HIP08
authorLang Cheng <chenglang@huawei.com>
Sat, 30 Jan 2021 08:57:59 +0000 (16:57 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 8 Feb 2021 23:37:33 +0000 (19:37 -0400)
commit9dd052474a2645b2a6171d19ad17b05b180d446d
tree420ded46006a3b9c38e46d219a7187b73fa58e19
parent899aba891cab1555c9ca16a558769efb177baf44
RDMA/hns: Allocate one more recv SGE for HIP08

The RQ/SRQ of HIP08 needs one special sge to stop receive reliably. So the
driver needs to allocate at least one SGE when creating RQ/SRQ and ensure
that at least one SGE is filled with the special value during post_recv.

Besides, the kernel driver should only do this for kernel ULP. For
userspace ULP, the userspace driver will allocate the reserved SGE in
buffer, and the kernel driver just needs to pin the corresponding size of
memory based on the userspace driver's requirements.

Link: https://lore.kernel.org/r/1611997090-48820-2-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>
drivers/infiniband/hw/hns/hns_roce_device.h
drivers/infiniband/hw/hns/hns_roce_hw_v2.c
drivers/infiniband/hw/hns/hns_roce_hw_v2.h
drivers/infiniband/hw/hns/hns_roce_qp.c
drivers/infiniband/hw/hns/hns_roce_srq.c