From patchwork Tue Jul 29 21:24:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 4642971 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EB0E1C033A for ; Tue, 29 Jul 2014 21:24:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3328D2012B for ; Tue, 29 Jul 2014 21:24:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 53B8520145 for ; Tue, 29 Jul 2014 21:24:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754275AbaG2VYF (ORCPT ); Tue, 29 Jul 2014 17:24:05 -0400 Received: from mail-ie0-f180.google.com ([209.85.223.180]:35467 "EHLO mail-ie0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754272AbaG2VYE (ORCPT ); Tue, 29 Jul 2014 17:24:04 -0400 Received: by mail-ie0-f180.google.com with SMTP id at20so281520iec.39 for ; Tue, 29 Jul 2014 14:24:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=2K+5SxOXa3cqOeoHoyEGSkQFQIS2VTzeKcqjYHHq9FE=; b=l7jRCrxLZudQOFKXu12uhfOf/jSCPEJ0v0tK+sEYhSZkDmh7zYqATowEOoctT8LGiV CZL8GV8Xw1rOiN0uwbb4zHfqXOQgpyIrOuiBAbUanQAmUbACtxvVtI/HWEzb0KTGogFo qf5GsbhfrWdrlC6qPiWWU/CXly1ck7d0Tk66ztNknl3TcnUr02x7OhLNiq0VDeylw6kj 9+Ah/oVg0uOTXtq8awLdT26vlTEQUzWyLjNng9YQYB1+G11EkwW357RKwM4WBv78HQCO rSEMKQg6WX08lPDK8Yy89Z/YPPq5+yTgaB2MnoVLsP4Mfv0keUIpgU8kDZ4SIpppLvB8 vYMg== X-Received: by 10.42.40.144 with SMTP id l16mr8589767ice.27.1406669042707; Tue, 29 Jul 2014 14:24:02 -0700 (PDT) Received: from manet.1015granger.net ([2604:8800:100:81fc:82ee:73ff:fe43:d64f]) by mx.google.com with ESMTPSA id cy13sm1602140igc.9.2014.07.29.14.24.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jul 2014 14:24:02 -0700 (PDT) Subject: [PATCH v5 06/21] xprtrdma: Don't invalidate FRMRs if registration fails From: Chuck Lever To: Anna.Schumaker@netapp.com Cc: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org Date: Tue, 29 Jul 2014 17:24:01 -0400 Message-ID: <20140729212400.2812.65211.stgit@manet.1015granger.net> In-Reply-To: <20140729211534.2812.3128.stgit@manet.1015granger.net> References: <20140729211534.2812.3128.stgit@manet.1015granger.net> User-Agent: StGit/0.17.1-3-g7d0f MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If FRMR registration fails, it's likely to transition the QP to the error state. Or, registration may have failed because the QP is _already_ in ERROR. Thus calling rpcrdma_deregister_external() in rpcrdma_create_chunks() is useless in FRMR mode: the LOCAL_INVs just get flushed. It is safe to leave existing registrations: when FRMR registration is tried again, rpcrdma_register_frmr_external() checks if each FRMR is already/still VALID, and knocks it down first if it is. Signed-off-by: Chuck Lever Tested-by: Steve Wise Tested-by: Shirley Ma Tested-by: Devesh Sharma --- net/sunrpc/xprtrdma/rpc_rdma.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c index 54422f7..6166c98 100644 --- a/net/sunrpc/xprtrdma/rpc_rdma.c +++ b/net/sunrpc/xprtrdma/rpc_rdma.c @@ -271,9 +271,11 @@ rpcrdma_create_chunks(struct rpc_rqst *rqst, struct xdr_buf *target, return (unsigned char *)iptr - (unsigned char *)headerp; out: - for (pos = 0; nchunks--;) - pos += rpcrdma_deregister_external( - &req->rl_segments[pos], r_xprt); + if (r_xprt->rx_ia.ri_memreg_strategy != RPCRDMA_FRMR) { + for (pos = 0; nchunks--;) + pos += rpcrdma_deregister_external( + &req->rl_segments[pos], r_xprt); + } return n; }