Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2655822pxa; Mon, 17 Aug 2020 15:40:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJym/JtooTqzU8wkzvdA/X1I39o2d/QHSPKkgLKBqqArousC7tu8vehrthJcDisVYY5xa0lj X-Received: by 2002:a50:8d01:: with SMTP id s1mr8443910eds.225.1597704020947; Mon, 17 Aug 2020 15:40:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704020; cv=none; d=google.com; s=arc-20160816; b=hVVxD6eQbHxSFJ7JUobwdLIbAQZj0EUpFMCuqlKyvBvM77Xl8MceBYmed7Jbk/1dj8 6ZtrhSPM3lbU5WVXWtrLzXJz3Jnmw++QMZtOOvM4Jeqz2866ynAxntt70MpV3AgSbo4+ 04ig3c2bqPne2aqyFZpv8ON62E5iAfFiDykJ2vptppDzwJH5WwCIUcxGo2aYmobs2XLC limTxFWAb+yU3wchx9EpnrLp3c4l9cU5GeX17nudLb3A+QvzypwW3A+TUA3e0BAM0KJg v4LVW83zOn9WqBb4SZO2+G9MBGg96Hmyi6DyJSKHt6R+OIdFP2pD7OfgYivot3zTK7VB eIIA== 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=lQOMIxiKk1nEtzwhQj2O/9zmY6bYgWP157OEzStN1Ao=; b=pxYCAlkZpm7yBRq8cF5SU/C1XrLF2bnvzqQamVDjiJreM6wqT7bI+T5apPNTLB+URq LMQC2EjOdBAc1lt5tpuObU4bIXc9M6STzLyLfF4gbQpcTDdgR4lqefeg2m77D6aznH3x 0aPvgPXW5CtMrDpJ0tiOmIq6HLp4XB/rsdRWG/1j6a3Rci0LECgfxQuBrNOVw4E9pU2y bm/dKyZZQCOS7tMSRNy56kqjpy0P5Cun7o+0BlbIf8x7310e/j1cT2OCkjMraGC2K9Sm ao3tLJ0CxFZ96HEGSPuKuSvBMcB9gffCBRxm+5JsnjWxBG/ZLyMLD7DLEC4NBHWOGljU C92g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZrelS+3I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y102si7928822ede.258.2020.08.17.15.39.57; Mon, 17 Aug 2020 15:40:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZrelS+3I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390603AbgHQSO7 (ORCPT + 99 others); Mon, 17 Aug 2020 14:14:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:53176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731052AbgHQQGY (ORCPT ); Mon, 17 Aug 2020 12:06:24 -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 19D8A2063A; Mon, 17 Aug 2020 16:06:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680371; bh=kw06jVtb/jIPSntCZK3WXF6KXsRzue6VWinIXA0xhaw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZrelS+3IGmFZm/PLrTsQm7IVasR+9s8ig51bfFJgf3OyLMsePTCuMy0Mq+P5z+bo0 lrhVHb+H7+s3z0vj/t3PMkQyLbNbBLUajG4V3n8lcygogjDMQC2lsUDYXmAFo4xi4R EwC+gVC7j7ryMGpfLlImk4lZw6L7YTtZFgITdfTk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhu Yanjun , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.4 130/270] RDMA/rxe: Skip dgid check in loopback mode Date: Mon, 17 Aug 2020 17:15:31 +0200 Message-Id: <20200817143802.262314210@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143755.807583758@linuxfoundation.org> References: <20200817143755.807583758@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: Zhu Yanjun [ Upstream commit 5c99274be8864519328aa74bc550ba410095bc1c ] In the loopback tests, the following call trace occurs. Call Trace: __rxe_do_task+0x1a/0x30 [rdma_rxe] rxe_qp_destroy+0x61/0xa0 [rdma_rxe] rxe_destroy_qp+0x20/0x60 [rdma_rxe] ib_destroy_qp_user+0xcc/0x220 [ib_core] uverbs_free_qp+0x3c/0xc0 [ib_uverbs] destroy_hw_idr_uobject+0x24/0x70 [ib_uverbs] uverbs_destroy_uobject+0x43/0x1b0 [ib_uverbs] uobj_destroy+0x41/0x70 [ib_uverbs] __uobj_get_destroy+0x39/0x70 [ib_uverbs] ib_uverbs_destroy_qp+0x88/0xc0 [ib_uverbs] ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0xb9/0xf0 [ib_uverbs] ib_uverbs_cmd_verbs+0xb16/0xc30 [ib_uverbs] The root cause is that the actual RDMA connection is not created in the loopback tests and the rxe_match_dgid will fail randomly. To fix this call trace which appear in the loopback tests, skip check of the dgid. Fixes: 8700e3e7c485 ("Soft RoCE driver") Link: https://lore.kernel.org/r/20200630123605.446959-1-leon@kernel.org Signed-off-by: Zhu Yanjun Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/sw/rxe/rxe_recv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c b/drivers/infiniband/sw/rxe/rxe_recv.c index 831ad578a7b29..46e111c218fd4 100644 --- a/drivers/infiniband/sw/rxe/rxe_recv.c +++ b/drivers/infiniband/sw/rxe/rxe_recv.c @@ -330,10 +330,14 @@ static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct sk_buff *skb) static int rxe_match_dgid(struct rxe_dev *rxe, struct sk_buff *skb) { + struct rxe_pkt_info *pkt = SKB_TO_PKT(skb); const struct ib_gid_attr *gid_attr; union ib_gid dgid; union ib_gid *pdgid; + if (pkt->mask & RXE_LOOPBACK_MASK) + return 0; + if (skb->protocol == htons(ETH_P_IP)) { ipv6_addr_set_v4mapped(ip_hdr(skb)->daddr, (struct in6_addr *)&dgid); @@ -366,7 +370,7 @@ void rxe_rcv(struct sk_buff *skb) if (unlikely(skb->len < pkt->offset + RXE_BTH_BYTES)) goto drop; - if (unlikely(rxe_match_dgid(rxe, skb) < 0)) { + if (rxe_match_dgid(rxe, skb) < 0) { pr_warn_ratelimited("failed matching dgid\n"); goto drop; } -- 2.25.1