Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2611060rwp; Fri, 14 Jul 2023 08:37:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlHu8FLG93F8aaGePVn8JBTYuKDyu6DL4DXNcB//GkJ9GFEO2x0fs7X987KWi1totaoppejn X-Received: by 2002:a05:6a00:2788:b0:668:93e7:6800 with SMTP id bd8-20020a056a00278800b0066893e76800mr3506839pfb.14.1689349027354; Fri, 14 Jul 2023 08:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689349027; cv=none; d=google.com; s=arc-20160816; b=R1nOHL8urUf8FdhkvWvcSTTwv7CQVAod+MFmYIYkPYS2EauMdprHPf50tlP7y6x0MW oELja6Kv5Oaq4SYNkN/Lw5FnnHtegx933aGMvXP+m/jzYWqiDSSRL23OR8pfAzcIJ9MX 0f+6NYKJcReWnD2nwyaQTvD4BvyxcGMrSZZpmgkcRyA/yfVGEgGMiy5MNtvsRLywglaT l+7CNhWfmrThqCjaFoE9+olrh41mdJjUhrXp1onq+bbxVOe3oVTD0Jo6YbE3hxTIuNvF Ikd7r4LzVsCA+eJhyLzfFcE8NhdbNEHkK/9T0nED2CmkbPGNxtLbhcezhBAB2GdLHvCj H46g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:dkim-signature; bh=pT/8In8p7vr2I8Z0hYRAwK28ySiGBlkPvTgLI5TqmKQ=; fh=WlEGqo3CQYfOssP5LATBlcRIgDds31wyV1RwRIj6whQ=; b=EJFqUztIECRnMe71t4h809MWkuhoPMc2ixOZJVkZG5Oezw1DIQjrMZ9q+tLnGi1IUE te/ywf/Lul8ocGgP5Bcd1uKSeXs/wpbyzxr36EmSoTCwpZKKrICVMAi8zk5pnXDfml66 pN8u+5ClWvMkYZIMs/lTuueNcOfb1yNF016gAdXrIZIfnjlf2QR7m+yDtLiGxATu6Rjh EcMun984IzcuXePPAh7scuW54ewbHrlTALZ5ALB94f4gflsza7fbHXRUB2+4d70TLKQi zOpOm/lkMH9vtUsHCtJhCzNpuNmwXj/ixgcOpGmqy3MHv033ndf2XHERXWACSxm4kAj4 Zjyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Sk3NHpAT; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u4-20020a63ef04000000b0055bc1aaa7e0si1139833pgh.618.2023.07.14.08.36.54; Fri, 14 Jul 2023 08:37:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Sk3NHpAT; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-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 S235268AbjGNPOB (ORCPT + 99 others); Fri, 14 Jul 2023 11:14:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235611AbjGNPOA (ORCPT ); Fri, 14 Jul 2023 11:14:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C7F72708; Fri, 14 Jul 2023 08:13:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1197661D45; Fri, 14 Jul 2023 15:13:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E576C433C8; Fri, 14 Jul 2023 15:13:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689347638; bh=AjVTiZGxGBSrlBE9CQQLTcrSS2ZLHDUVxtNcNgrghTs=; h=Subject:From:To:Cc:Date:From; b=Sk3NHpATkvI6p0L4o0QETvAL6ovz9R9/463BjESUzCTQVjm7cL/IQ7Qxkxh1jTKy/ NDqifVByRjcxwewBtJN8BxHF9AX21s99lyCZ/Ys8D0ArFR2VehhvFR1o0piMH3Dk30 KdCZUEI2r6lwx/6MyFJHHQBR5dQWbG7XarnrxAZ4eJlWiTjRssK5k5Yyg7/WQmfKY0 0h4wl8FKfW/7U7MXlUkEVMNJYWZNDW7LWmbVYthJKE6+hquDz96kpuQzNWJIyR8q4x KcYPUw6p/XAW9C7dLWuahxp+w6hc/81wBtEouuldDBOFPAQIHt6TW02ke5O0X0m3mh IJ+UN0ZC3xgeQ== Subject: [PATCH] xprtrdma: Remap Receive buffers after a reconnect From: Chuck Lever To: anna.schumaker@netapp.com Cc: Chuck Lever , linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org, tom@talpey.com, kolga@netapp.com Date: Fri, 14 Jul 2023 11:13:56 -0400 Message-ID: <168934757954.2781502.4228890662497418497.stgit@morisot.1015granger.net> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Chuck Lever On server-initiated disconnect, rpcrdma_xprt_disconnect() DMA-unmaps the transport's Receive buffers, but rpcrdma_post_recvs() neglected to remap them after a new connection had been established. The result is immediate failure of the new connection with the Receives flushing with LOCAL_PROT_ERR. Fixes: 671c450b6fe0 ("xprtrdma: Fix oops in Receive handler after device removal") Signed-off-by: Chuck Lever --- net/sunrpc/xprtrdma/verbs.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) Hi Anna- Can you apply this for 6.5-rc ? diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index b098fde373ab..28c0771c4e8c 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c @@ -935,9 +935,6 @@ struct rpcrdma_rep *rpcrdma_rep_create(struct rpcrdma_xprt *r_xprt, if (!rep->rr_rdmabuf) goto out_free; - if (!rpcrdma_regbuf_dma_map(r_xprt, rep->rr_rdmabuf)) - goto out_free_regbuf; - rep->rr_cid.ci_completion_id = atomic_inc_return(&r_xprt->rx_ep->re_completion_ids); @@ -956,8 +953,6 @@ struct rpcrdma_rep *rpcrdma_rep_create(struct rpcrdma_xprt *r_xprt, spin_unlock(&buf->rb_lock); return rep; -out_free_regbuf: - rpcrdma_regbuf_free(rep->rr_rdmabuf); out_free: kfree(rep); out: @@ -1363,6 +1358,10 @@ void rpcrdma_post_recvs(struct rpcrdma_xprt *r_xprt, int needed, bool temp) rep = rpcrdma_rep_create(r_xprt, temp); if (!rep) break; + if (!rpcrdma_regbuf_dma_map(r_xprt, rep->rr_rdmabuf)) { + rpcrdma_rep_put(buf, rep); + break; + } rep->rr_cid.ci_queue_id = ep->re_attr.recv_cq->res.id; trace_xprtrdma_post_recv(rep);