Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1176077yba; Thu, 9 May 2019 12:01:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwIyI43lMJHsZ4hJwXq72j5d9eOttMZrrU08nDBzkI8ZkBexUrPsaroZw3r3q0gNIoQxpZp X-Received: by 2002:a63:2a89:: with SMTP id q131mr7595489pgq.359.1557428506500; Thu, 09 May 2019 12:01:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557428506; cv=none; d=google.com; s=arc-20160816; b=TF1G5900pUDmuhMTMeIbW6urcvUh71YAT3uOuCTsTtxtRrLhmXRvHzqh1BnomRfW/q AtlHs5W7zsj3Mq0gcaylPP7Lk6GJxS8xo4tBoH2BHfVD4/8+TBZEz7XNiXFXXrvDR4uV 86JyC76beKKhm/qvdCr3fmeJD9dm9Y+YuTQITlfU4Ugv+YG+JeO6fK7SY5R/xTrDNYyn kyfRx+MR9R6W8UDuuuBwltemnR+hHgp6fbWzk+ByErLdh9wq9XUc1zR0AmcCjcbsDOkx TaPPyDge7sBBRxUbUGGLRyvX5+bDD+dt1h70wPIs5j5WOMP6lJmOLq/Z9aKj7GX5ALgq najg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nsA7+F3rWgNf45h/fXUuThyjEA1ZQMazbsLvxz57uAY=; b=d8KbjQSQqrGuXpjgAlSX5R5a9fvrJC6ihDl4G/nxW0KACHrBvRGPTuI5f0+ZzisjFM AzG7cwnQwJnpOLq+ne3buATUmqBcf5erPu6vSyWAcif/G0OtKXY5RQt0N28qiltF/x0g WhOTBPdDC/4qfzRJDqbJHSKAAgEMq5vQaFGvytZo0ZQs1tPq7a2BL5OPH9e44ZWmWOKG 0hR13fqiTJkJLb1PQrDFpay21OlzrTawl/BjMbnkPwxeqV75J/9MeH7YCOsIw62gBVkE +a6VebircxthTeKwBDfNY+avH3s2/l4wO5HpZFj+quGHgIFkQ5FZqmhVJZo5PJ1MbXa6 tKXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rTZSz+99; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i7si3879495plt.332.2019.05.09.12.01.30; Thu, 09 May 2019 12:01:46 -0700 (PDT) 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=rTZSz+99; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728619AbfEISvw (ORCPT + 99 others); Thu, 9 May 2019 14:51:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:45658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728608AbfEISvs (ORCPT ); Thu, 9 May 2019 14:51:48 -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 E8D75217D7; Thu, 9 May 2019 18:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557427907; bh=Qt77VUw4ge7hsZmIDo7QKSC2ysPJBo4tHgWGfWn3O7c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rTZSz+99cQn4IcgjV2d+VvD7qleVdkONoXK4/MiAjVOCfXLew6P3aVUl0KhMeIq6+ FHs68FxSsobRnaZGFB8uYL5aSgafouFMxnMordDPxcBFtZk7RvppWC/1zoO2sueIEJ avQwSJADPH+90ESHgc7frmSJ1GpIDsX2O57AT6A8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Marciniszyn , Kaike Wan , Dennis Dalessandro , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.0 31/95] IB/hfi1: Eliminate opcode tests on mr deref Date: Thu, 9 May 2019 20:41:48 +0200 Message-Id: <20190509181311.480613377@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190509181309.180685671@linuxfoundation.org> References: <20190509181309.180685671@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit a8639a79e85c18c16c10089edd589c7948f19bbd ] When an old ack_queue entry is used to store an incoming request, it may need to clean up the old entry if it is still referencing the MR. Originally only RDMA READ request needed to reference MR on the responder side and therefore the opcode was tested when cleaning up the old entry. The introduction of tid rdma specific operations in the ack_queue makes the specific opcode tests wrong. Multiple opcodes (RDMA READ, TID RDMA READ, and TID RDMA WRITE) may need MR ref cleanup. Remove the opcode specific tests associated with the ack_queue. Fixes: f48ad614c100 ("IB/hfi1: Move driver out of staging") Signed-off-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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/rc.c b/drivers/infiniband/hw/hfi1/rc.c index be603f35d7e47..cfde43b1df960 100644 --- a/drivers/infiniband/hw/hfi1/rc.c +++ b/drivers/infiniband/hw/hfi1/rc.c @@ -2302,7 +2302,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet) update_ack_queue(qp, next); } e = &qp->s_ack_queue[qp->r_head_ack_queue]; - if (e->opcode == OP(RDMA_READ_REQUEST) && e->rdma_sge.mr) { + if (e->rdma_sge.mr) { rvt_put_mr(e->rdma_sge.mr); e->rdma_sge.mr = NULL; } @@ -2376,7 +2376,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet) update_ack_queue(qp, next); } e = &qp->s_ack_queue[qp->r_head_ack_queue]; - if (e->opcode == OP(RDMA_READ_REQUEST) && e->rdma_sge.mr) { + if (e->rdma_sge.mr) { rvt_put_mr(e->rdma_sge.mr); e->rdma_sge.mr = NULL; } -- 2.20.1