From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CB68C04E53 for ; Wed, 15 May 2019 11:49:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5DF5A206BF for ; Wed, 15 May 2019 11:49:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557920940; bh=xOLBCSAStprb0C6iQ2nis4ye9Oz+cCxKK8aQHE2OgS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=uVHtpHajGSzklvUZ5K3ewG9RfOmcZqsNaCxjDPuQ8I/yJ2zCL26lddaA/PQ9z8pQL L0L7k01+/OAPj85oxzusneU5WwZlJewpgghgQS1UXIVA8afXjYcAaM192jbI9ppnbd bAfi151IcK3q/tFrdVhyvSKTRdyb8KmFaQrNZ5N8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729947AbfEOLsy (ORCPT ); Wed, 15 May 2019 07:48:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:33834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729355AbfEOLX1 (ORCPT ); Wed, 15 May 2019 07:23:27 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 44F81206BF; Wed, 15 May 2019 11:23:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919406; bh=xOLBCSAStprb0C6iQ2nis4ye9Oz+cCxKK8aQHE2OgS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=umORqie1/eqQwxlWgqII1DFiVeKeXE9kPbLn7ORZpr8mgXi1wVcg2xuN6/V+prn0/ h3JK35br9zqNyV+pcK6VDf4hJwO8lZI3Of5WdZ3XS87bEydFqiA5LW8QnAthuCg4wv 1eC3ixwpRBb2FUVo8z0dc/j8+4E6FC4y95nckJqo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lijun Ou , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.19 063/113] RDMA/hns: Bugfix for mapping user db Date: Wed, 15 May 2019 12:55:54 +0200 Message-Id: <20190515090658.342043883@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090652.640988966@linuxfoundation.org> References: <20190515090652.640988966@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit 2557fabd6e29f349bfa0ac13f38ac98aa5eafc74 ] When the maximum send wr delivered by the user is zero, the qp does not have a 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: hns3 0000:7d:00.1: Send cmd: tail - 418, opcode - 0x8504, flag - 0x0011, retval - 0x0000 hns3 0000:7d:00.1: Send cmd: 0xe59dc000 0x00000000 0x00000000 0x00000000 0x00000116 0x0000ffff hns3 0000:7d:00.1: sq record doorbell map failed! 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 Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hns/hns_roce_qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c index efb7e961ca651..2fa4fb17f6d3c 100644 --- a/drivers/infiniband/hw/hns/hns_roce_qp.c +++ b/drivers/infiniband/hw/hns/hns_roce_qp.c @@ -494,7 +494,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; -- 2.20.1