Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4563451pja; Thu, 21 Nov 2019 21:56:45 -0800 (PST) X-Google-Smtp-Source: APXvYqx34rDp4gIahc4ANqEfYkoZa8FKZaZHAucDoVio8wON9zszAlOM6iDFZYke0U2rMv1ug84C X-Received: by 2002:a17:906:258a:: with SMTP id m10mr19692665ejb.304.1574402205455; Thu, 21 Nov 2019 21:56:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574402205; cv=none; d=google.com; s=arc-20160816; b=ZU8gfKJdBChJogMoiWH+aU0vtePuoVgFMrjKG6pfte8DWlmoi9QFyWtIzgFNfoQbfw +Sqa1H8HnVZ8RoPUEdAnIgrqe/lQTH/uj561DzweYYG6ZMeFVYU3dG3f+jeC5ZviYNJr h3R4DpPVbnkEiqx/felHGMykkfIr2xzBFJ+bWqWimAU47O8MM/cb1Oosyk6LFcLOtGGu NLWT0/DrEL242UVYmXpEgfvGdSXO1Ii+meGKsWxn7HtHGRW0wiyPqNBcFMczGaFSGV1g xjzq9MUTg8LmTpJa/0J98x4ZsmRluyeuJrZXBnTo78rpZmBq43h+I30qV8ibZ6CR2kHQ 1NTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TtLz7RatxBjWxsgncfC8x69Y/dHY3X4ib5MpnBuvSiM=; b=z8kZrWNHNTRYeS+Bec7U3QKCpzJNLZp3tHR9dvVwO3b/zV7BdebhFBEhlnUBVOzh7d mtfnE0lPI6iUHoy/hcT1jJE+NABVbq53gQZTLURgpt9rAhk5JOGo5o6uUpn0gygzh8xT XorxhmF/k8H4pMS4QPqItLW7bD4cnuZFcPIHV71fK7rkty7wTS7HGaZapH9HsIjsqDVk ypjTL0D4d/gkcnDK36hRqjzti+6GPRxmkpHIA19c2NqMGZciCeTHz7BigVvJ5lesGAhZ QdzmibZ/enH9RP1qdbkrd5rykY9DwugNpPbdOVkfkeptqx32YVp8jATVgNBJ2V6iTTFo RHzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TEQKB8S+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9si4168737edl.273.2019.11.21.21.56.21; Thu, 21 Nov 2019 21:56:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TEQKB8S+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728020AbfKVFyI (ORCPT + 99 others); Fri, 22 Nov 2019 00:54:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:59212 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728809AbfKVFxN (ORCPT ); Fri, 22 Nov 2019 00:53:13 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C76352072E; Fri, 22 Nov 2019 05:53:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574401993; bh=pfDGKXJw3nG4tZ0fJyMwmMdPCGBmkSkiDYf0U28/+5w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TEQKB8S+UPTX9SKUywy2aoKmBsgdPHIPDnK47g5Pn/UBjv1nqJfCsmpFdumwp2OTZ ugq3tPWvS0xp6b3bnnKbA9EzAMUk0anCIccCtyQMehd4gYckzASW1OTkO3BPoSzieI H47nARJX8Vd4F38xfFrXuuJ47UC6zNTRt9p+6mLA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Lijun Ou , Jason Gunthorpe , Sasha Levin , linux-rdma@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 211/219] RDMA/hns: Fix the bug with updating rq head pointer when flush cqe Date: Fri, 22 Nov 2019 00:49:02 -0500 Message-Id: <20191122054911.1750-203-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191122054911.1750-1-sashal@kernel.org> References: <20191122054911.1750-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lijun Ou [ Upstream commit 9c6ccc035c209dda07685e8dba829a203ba17499 ] When flush cqe with srq, the driver disable to update the rq head pointer into the hardware. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index cf878e1b71fc1..587db5cf3be15 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -3499,13 +3499,16 @@ static int hns_roce_v2_modify_qp(struct ib_qp *ibqp, roce_set_field(qpc_mask->byte_160_sq_ci_pi, V2_QPC_BYTE_160_SQ_PRODUCER_IDX_M, V2_QPC_BYTE_160_SQ_PRODUCER_IDX_S, 0); - roce_set_field(context->byte_84_rq_ci_pi, + + if (!ibqp->srq) { + roce_set_field(context->byte_84_rq_ci_pi, V2_QPC_BYTE_84_RQ_PRODUCER_IDX_M, V2_QPC_BYTE_84_RQ_PRODUCER_IDX_S, hr_qp->rq.head); - roce_set_field(qpc_mask->byte_84_rq_ci_pi, + roce_set_field(qpc_mask->byte_84_rq_ci_pi, V2_QPC_BYTE_84_RQ_PRODUCER_IDX_M, V2_QPC_BYTE_84_RQ_PRODUCER_IDX_S, 0); + } } if (attr_mask & IB_QP_AV) { @@ -3967,7 +3970,8 @@ static void hns_roce_set_qps_to_err(struct hns_roce_dev *hr_dev, u32 qpn) if (hr_qp->ibqp.uobject) { if (hr_qp->sdb_en == 1) { hr_qp->sq.head = *(int *)(hr_qp->sdb.virt_addr); - hr_qp->rq.head = *(int *)(hr_qp->rdb.virt_addr); + if (hr_qp->rdb_en == 1) + hr_qp->rq.head = *(int *)(hr_qp->rdb.virt_addr); } else { dev_warn(hr_dev->dev, "flush cqe is unsupported in userspace!\n"); return; -- 2.20.1