Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5226127ybl; Tue, 27 Aug 2019 01:07:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZY239IJCn9YU3BX4p0xDe6Re6KrLAxc57wV5EtgNGeeo6zeIPrrLG3zDcWxCSAuwPw7K+ X-Received: by 2002:a63:d315:: with SMTP id b21mr20615416pgg.326.1566893222943; Tue, 27 Aug 2019 01:07:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566893222; cv=none; d=google.com; s=arc-20160816; b=uQiWoLswH7pNYP+of0bXpPKKZ/5icY49ZpGnKjHx6tkDLnmsoZ5b81Mn08r7b2n3dr Fh70f07w1nUpffJdE9dpXJgA//MdL8GJ8I0zDqzGHUxJNAFasZQQ4omuWrgUEcIHdAQh 6WNkp3exjd+5mSwx6xsCIdI/cahQY7W3gXTwX7a+rPXwvQHzKJXZuCzlnkdLI0ilSHHK kzoepuvbzpNK9uFt5qz2lDPdBJUc7AUOmoAHTaRctY6Jkstc+u7BU4soKAUmTSaibZGp oUw41Cg+BL8hMsuCWvktnNwKqx799n1GpsoRmbgEVgi80he55ZTkRkAwm9PlQUoNG210 iRdg== 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=VS5KhwXmXvIBRnOmXd+6y9OqAUqTulnLt7YHpXVjeBo=; b=Yds7IFGYHbRK9sHtUrxofvj3osW5R0rgviws98UWs9iKuuETVY7JFfdA1umYfc9o9t yWUsxWgz4et+Qj4fbfZSwivD8SqfejhFUQqPTIz1zkWRKWyfTm0WQ1kcnBBUx/quBHCD 3tFqz9K7IPNw6N75+1U3QRO7R08p9RIp3oBdJPl7uT0467gtoDZd/dhni816sf5LIE63 fSLztFp96jQiJKmbWtp7QiptUlwsvAWssbspH2f1LLbqyc6ypeEpC6y0kZH2j5yoBfVC 7gYGRr1h4TyqlahhtKCBRUxmcSGt+zXcyNiCl8EYnpXoDGZkuByLzfLpaErkaDGXDKkB oihw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fkeOek4E; 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 l184si11135586pge.286.2019.08.27.01.06.47; Tue, 27 Aug 2019 01:07:02 -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=fkeOek4E; 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 S1732862AbfH0IFm (ORCPT + 99 others); Tue, 27 Aug 2019 04:05:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:35538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732435AbfH0IFk (ORCPT ); Tue, 27 Aug 2019 04:05:40 -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 45B102173E; Tue, 27 Aug 2019 08:05:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566893139; bh=csSfjwxSUvEH7WsttKF+LGRqTSc7mgMPIgBk3UMBVcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fkeOek4E+B8n5IVtPyCpVxq/9Vsnps0YkCyUKC9mpRJA5l/9MC/t6EsXL8ojFaNbf vk4dngMxEGJSKHeoYWOFljXjUpCqx4JzCEtdv7CqCKzSa5Ez3BedVb/xFyCFdvAUnU /PyoydVy34XLkZp2Bnv8ovEKrAA5gl8mJOjFrMmo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Marciniszyn , Kaike Wan , Dennis Dalessandro , Doug Ledford Subject: [PATCH 5.2 133/162] IB/hfi1: Drop stale TID RDMA packets that cause TIDErr Date: Tue, 27 Aug 2019 09:51:01 +0200 Message-Id: <20190827072743.191279632@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190827072738.093683223@linuxfoundation.org> References: <20190827072738.093683223@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 From: Kaike Wan commit d9d1f5e7bb82415591e8b62b222cbb88c4797ef3 upstream. In a congested fabric with adaptive routing enabled, traces show that packets could be delivered out of order. A stale TID RDMA data packet could lead to TidErr if the TID entries have been released by duplicate data packets generated from retries, and subsequently erroneously force the qp into error state in the current implementation. Since the payload has already been dropped by hardware, the packet can be simply dropped and it is no longer necessary to put the qp into error state. Fixes: 9905bf06e890 ("IB/hfi1: Add functions to receive TID RDMA READ response") Cc: Reviewed-by: Mike Marciniszyn Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Link: https://lore.kernel.org/r/20190815192058.105923.72324.stgit@awfm-01.aw.intel.com Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/hfi1/tid_rdma.c | 47 ++-------------------------------- 1 file changed, 3 insertions(+), 44 deletions(-) --- a/drivers/infiniband/hw/hfi1/tid_rdma.c +++ b/drivers/infiniband/hw/hfi1/tid_rdma.c @@ -2576,18 +2576,9 @@ void hfi1_kern_read_tid_flow_free(struct hfi1_kern_clear_hw_flow(priv->rcd, qp); } -static bool tid_rdma_tid_err(struct hfi1_ctxtdata *rcd, - struct hfi1_packet *packet, u8 rcv_type, - u8 opcode) +static bool tid_rdma_tid_err(struct hfi1_packet *packet, u8 rcv_type) { struct rvt_qp *qp = packet->qp; - struct hfi1_qp_priv *qpriv = qp->priv; - u32 ipsn; - struct ib_other_headers *ohdr = packet->ohdr; - struct rvt_ack_entry *e; - struct tid_rdma_request *req; - struct rvt_dev_info *rdi = ib_to_rvt(qp->ibqp.device); - u32 i; if (rcv_type >= RHF_RCV_TYPE_IB) goto done; @@ -2604,41 +2595,9 @@ static bool tid_rdma_tid_err(struct hfi1 if (rcv_type == RHF_RCV_TYPE_EAGER) { hfi1_restart_rc(qp, qp->s_last_psn + 1, 1); hfi1_schedule_send(qp); - goto done_unlock; - } - - /* - * For TID READ response, error out QP after freeing the tid - * resources. - */ - if (opcode == TID_OP(READ_RESP)) { - ipsn = mask_psn(be32_to_cpu(ohdr->u.tid_rdma.r_rsp.verbs_psn)); - if (cmp_psn(ipsn, qp->s_last_psn) > 0 && - cmp_psn(ipsn, qp->s_psn) < 0) { - hfi1_kern_read_tid_flow_free(qp); - spin_unlock(&qp->s_lock); - rvt_rc_error(qp, IB_WC_LOC_QP_OP_ERR); - goto done; - } - goto done_unlock; } - /* - * Error out the qp for TID RDMA WRITE - */ - hfi1_kern_clear_hw_flow(qpriv->rcd, qp); - for (i = 0; i < rvt_max_atomic(rdi); i++) { - e = &qp->s_ack_queue[i]; - if (e->opcode == TID_OP(WRITE_REQ)) { - req = ack_to_tid_req(e); - hfi1_kern_exp_rcv_clear_all(req); - } - } - spin_unlock(&qp->s_lock); - rvt_rc_error(qp, IB_WC_LOC_LEN_ERR); - goto done; - -done_unlock: + /* Since no payload is delivered, just drop the packet */ spin_unlock(&qp->s_lock); done: return true; @@ -2927,7 +2886,7 @@ bool hfi1_handle_kdeth_eflags(struct hfi if (lnh == HFI1_LRH_GRH) goto r_unlock; - if (tid_rdma_tid_err(rcd, packet, rcv_type, opcode)) + if (tid_rdma_tid_err(packet, rcv_type)) goto r_unlock; }