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=-8.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 DBE01C04AB3 for ; Thu, 9 May 2019 18:44:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B33C4217F9 for ; Thu, 9 May 2019 18:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557427490; bh=yYHa21ojdwKudFT6S38d3tz7aLJYodU4kGhvuKiqAHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=dWso9mp5XsIfW2ikS4wQg1lINnelnVF35rWCkKdBLdBrBlHCjLeYn1GU/Le6emhmH jrRfQN6w6BEByWvatUhCc4IHCtWw07BDypyigkBL3yihJPCPspsqvjocNunLSU3K0l fBYLaAj9i8tDouEjeQwyysgOptn5dKpVS0bWY7e8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727156AbfEISot (ORCPT ); Thu, 9 May 2019 14:44:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:36302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727089AbfEISor (ORCPT ); Thu, 9 May 2019 14:44:47 -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 18E82217F5; Thu, 9 May 2019 18:44:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557427486; bh=yYHa21ojdwKudFT6S38d3tz7aLJYodU4kGhvuKiqAHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SdTN3SI1qGn3d89ESSxcU3IJv6eaa8ntY6nreTBaGcNrd5/iqQ9OECNrnqix8qHHK fvUTwbmyRB6hpaOBKrsq/znJjvU6XstldGCWPB+lYywIByBQZGSbWqZZYmt1fmlokT UQL5e0VopjPRmVP/5KlhRaYe/WojPTJ3SMD5YqQs= 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 4.9 07/28] IB/hfi1: Eliminate opcode tests on mr deref Date: Thu, 9 May 2019 20:41:59 +0200 Message-Id: <20190509181251.841236459@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190509181247.647767531@linuxfoundation.org> References: <20190509181247.647767531@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 e8e0fa58cb713..b08786614c1b0 100644 --- a/drivers/infiniband/hw/hfi1/rc.c +++ b/drivers/infiniband/hw/hfi1/rc.c @@ -2394,7 +2394,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; } @@ -2469,7 +2469,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