Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3705887imu; Mon, 28 Jan 2019 09:21:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN4Ok+MQrVX8U699rRedNU5ZLa5X76ZtRoBV5E6eR6a5rQcIYdthlWLVUkf+FNJd2xEB2MA5 X-Received: by 2002:a17:902:b20e:: with SMTP id t14mr22687291plr.128.1548696063663; Mon, 28 Jan 2019 09:21:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548696063; cv=none; d=google.com; s=arc-20160816; b=ErEimoGyQn9gsp3qsivyolPDbQE1AhMxix9fE/bqsYUI/FF26KHu0YUYg2lQFmeVwf iAWGvqHQGJfCMKId1qtN4YsoJL6V5X1bx73Y4WQsHNljGoXyole1g6MuRIl+F1XierZI XcwGtSLfRS3wM9Xx8pjy/MCqhEpWanRBcx8nHCDdLHRvgoEwFuUZM+YK8p5Pu5lNkRFT 5318p7DrKrZZg1eW7H5hrLj2Z05MaT/xbpx0XKngiD0VkLyBHKRsamVLHSZw8InGx8/r MvvUfUE9HjU6Lzrpyo4uUesjrb+oH8pwK/Ht/W7tOBjQnRJKeUfeBzpzLlEKCQ78SOzc MAzQ== 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=ALzJSf+rhqoBvv3G1oPSNLtshPxiNkJq1MFHf6skyYc=; b=n8Ykx3ZCOAT9vf/CSX4nB6DR7YNO7qOE3X5SLct2MWmda5l3/6IjQGTv+EzFi/M+Ey dHknjauhRmwm2W4I2due63Rh2+tf+Q8fwVuKipS+CF4U/Lt05G1/XEX+Ju+hX3YxMjEI dvmoDdMznbuMyUBbyh+M6OeaI0OTNo4Lxcb76i/BH19vgTbs+Jwwul0ovPOcB6JMvjVt Jdgu35DH+jkLYCerY0GDBZ84wMZa+0uE85FKPsFhn3q/1DFIW+zi9zlD3YZYYyqRWukB Saq0vK8bXYXMiRw/ZpzKt8epHRkSLItkLyEcF+cLaLliBKDc7pUcp+tEzke/wVMo4s6Y clTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IzsIOQfd; 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 z61si34140668plb.49.2019.01.28.09.20.47; Mon, 28 Jan 2019 09:21:03 -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=IzsIOQfd; 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 S1731861AbfA1RTZ (ORCPT + 99 others); Mon, 28 Jan 2019 12:19:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:50816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731053AbfA1QEv (ORCPT ); Mon, 28 Jan 2019 11:04:51 -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 EC48D2147A; Mon, 28 Jan 2019 16:04:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691491; bh=dC+vVnH2Zgbw7ltjxFU0UuMH6kqXA+QnBRKAMIgsueQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IzsIOQfdkxftBqOGTUHfE8KiI8sQaTePRWDM6Bh9ZGjJQZ312KWf3lA2TY40yhVAU AJmfJ50rnfIc1Xp8KD0xdKL9FpBpQiBR9d28SIVybGTtlEYQU2l522H/GP/C9W14lC cu9xdmoCLrDT3WSMBBdZvX86P85Tq0mTeRU63i/o= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Kaike Wan , Dennis Dalessandro , Jason Gunthorpe , Sasha Levin , linux-rdma@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 113/258] IB/hfi1: Unreserve a reserved request when it is completed Date: Mon, 28 Jan 2019 10:56:59 -0500 Message-Id: <20190128155924.51521-113-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 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: Kaike Wan [ Upstream commit ca95f802ef5139722acc8d30aeaab6fe5bbe939e ] Currently, When a reserved operation is completed, its entry in the send queue will not be unreserved, which leads to the miscalculation of qp->s_avail and thus the triggering of a WARN_ON call trace. This patch fixes the problem by unreserving the reserved operation when it is completed. Fixes: 856cc4c237ad ("IB/hfi1: Add the capability for reserved operations") Reviewed-by: Mike Marciniszyn Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hfi1/rc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/hw/hfi1/rc.c b/drivers/infiniband/hw/hfi1/rc.c index 9bd63abb2dfe..6f013a565353 100644 --- a/drivers/infiniband/hw/hfi1/rc.c +++ b/drivers/infiniband/hw/hfi1/rc.c @@ -1157,6 +1157,7 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct hfi1_opa_header *opah) if (cmp_psn(wqe->lpsn, qp->s_sending_psn) >= 0 && cmp_psn(qp->s_sending_psn, qp->s_sending_hpsn) <= 0) break; + rvt_qp_wqe_unreserve(qp, wqe); s_last = qp->s_last; trace_hfi1_qp_send_completion(qp, wqe, s_last); if (++s_last >= qp->s_size) @@ -1209,6 +1210,7 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp, u32 s_last; rvt_put_swqe(wqe); + rvt_qp_wqe_unreserve(qp, wqe); s_last = qp->s_last; trace_hfi1_qp_send_completion(qp, wqe, s_last); if (++s_last >= qp->s_size) -- 2.19.1