diff mbox series

[V3,for-rc] RDMA/hns: Bugfix for mapping user db

Message ID 1556011826-92896-1-git-send-email-oulijun@huawei.com (mailing list archive)
State Mainlined
Commit 2557fabd6e29f349bfa0ac13f38ac98aa5eafc74
Delegated to: Jason Gunthorpe
Headers show
Series [V3,for-rc] RDMA/hns: Bugfix for mapping user db | expand

Commit Message

Lijun Ou April 23, 2019, 9:30 a.m. UTC
when the maximum send wr delivered by the user is zero,
qp does not have sq.

When allocating the sq db buffer to store the user sq pi pointer
and map it to the kernel mode, max_send_wr is used as the
trigger condition, while the kernel does not consider the
max_send_wr trigger condition when mapmping db. it will
cause sq record doorbell map fail and create qp fail.
The failed print information as follows:
...
...
[100271.504204] hns3 0000:7d:00.1: Send cmd: tail - 418, opcode - 0x8504, flag - 0x0011, retval - 0x0000
[100271.514826] hns3 0000:7d:00.1: Send cmd: 0xe59dc000 0x00000000 0x00000000 0x00000000 0x00000116 0x0000ffff
[100271.619589] hns3 0000:7d:00.1: sq record doorbell map failed!
[100271.628559] hns3 0000:7d:00.1: Create RC QP failed

Fixes: 0425e3e6e0c7 ("RDMA/hns: Support flush cqe for hip08 in kernel space")
Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
V2->V3:
1. Add a paragraph to describe what bad result it will have.

V1->V2:
1. Split it from the patchset("[PATCH for-rc 0/8] Some hns bugfixes for 5.0-rc3")
2. Add necessary note for fixing: line
---
 drivers/infiniband/hw/hns/hns_roce_qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jason Gunthorpe April 25, 2019, 1:41 p.m. UTC | #1
On Tue, Apr 23, 2019 at 05:30:26PM +0800, Lijun Ou wrote:
> when the maximum send wr delivered by the user is zero,
> qp does not have sq.
> 
> When allocating the sq db buffer to store the user sq pi pointer
> and map it to the kernel mode, max_send_wr is used as the
> trigger condition, while the kernel does not consider the
> max_send_wr trigger condition when mapmping db. it will
> cause sq record doorbell map fail and create qp fail.
> The failed print information as follows:
> ...
> ...
> [100271.504204] hns3 0000:7d:00.1: Send cmd: tail - 418, opcode - 0x8504, flag - 0x0011, retval - 0x0000
> [100271.514826] hns3 0000:7d:00.1: Send cmd: 0xe59dc000 0x00000000 0x00000000 0x00000000 0x00000116 0x0000ffff
> [100271.619589] hns3 0000:7d:00.1: sq record doorbell map failed!
> [100271.628559] hns3 0000:7d:00.1: Create RC QP failed
> 
> Fixes: 0425e3e6e0c7 ("RDMA/hns: Support flush cqe for hip08 in kernel space")
> Signed-off-by: Lijun Ou <oulijun@huawei.com>
> ---
> V2->V3:
> 1. Add a paragraph to describe what bad result it will have.
> 
> V1->V2:
> 1. Split it from the patchset("[PATCH for-rc 0/8] Some hns bugfixes for 5.0-rc3")
> 2. Add necessary note for fixing: line
> ---
>  drivers/infiniband/hw/hns/hns_roce_qp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-rc thanks

Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c
index 66cdf62..60cf9f0 100644
--- a/drivers/infiniband/hw/hns/hns_roce_qp.c
+++ b/drivers/infiniband/hw/hns/hns_roce_qp.c
@@ -533,7 +533,7 @@  static int hns_roce_set_kernel_sq_size(struct hns_roce_dev *hr_dev,
 
 static int hns_roce_qp_has_sq(struct ib_qp_init_attr *attr)
 {
-	if (attr->qp_type == IB_QPT_XRC_TGT)
+	if (attr->qp_type == IB_QPT_XRC_TGT || !attr->cap.max_send_wr)
 		return 0;
 
 	return 1;