From patchwork Tue Jul 15 14:21:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 4554081 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 39B939F3BC for ; Tue, 15 Jul 2014 14:21:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF1042011E for ; Tue, 15 Jul 2014 14:21:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C0B6420145 for ; Tue, 15 Jul 2014 14:21:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752853AbaGOOVH (ORCPT ); Tue, 15 Jul 2014 10:21:07 -0400 Received: from mail-ig0-f177.google.com ([209.85.213.177]:42646 "EHLO mail-ig0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752809AbaGOOVG (ORCPT ); Tue, 15 Jul 2014 10:21:06 -0400 Received: by mail-ig0-f177.google.com with SMTP id hn18so2905683igb.4 for ; Tue, 15 Jul 2014 07:21:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:from:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=mWGET8JxT3ytECv96ntCQKFc4bXyOtkVfM9l/OWegxk=; b=cIJn49aZD85c77rSxw30Wnqtz/G4S/l5+UgsECs5NyaQvqvXQhHF55Xd/B789bWtKF 2fOW1Hy6kXPtKAjFvDBtUGETqSdq2k1Yu0G7p462aIG1c2oUzIAfh3bs7PsuA45yFaOU p6h0iOEFIHh1dBNKpU5ol+h7X9+jJUkSG9QKwrmpowKX7umsFntzzNmGwDghBvaswyUR 18TqrO8jrkamc9F1TV4KY9cTAErhZ/ABr1nzYWTsqiK4pAH/HJbuYouE2/oTSDGsK+f2 IwlyU57B2mJYQq+yaQRfGM9NQEqP1o9IStHu7UKciu64TVl/mp+Qvn7zTdRUexP0rFnv EWxA== X-Received: by 10.43.118.67 with SMTP id fp3mr30762313icc.40.1405434066038; Tue, 15 Jul 2014 07:21:06 -0700 (PDT) Received: from manet.1015granger.net ([2604:8800:100:81fc:82ee:73ff:fe43:d64f]) by mx.google.com with ESMTPSA id tp2sm35236650igb.7.2014.07.15.07.21.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jul 2014 07:21:05 -0700 (PDT) Subject: [PATCH v3 06/21] xprtrdma: Don't invalidate FRMRs if registration fails From: Chuck Lever To: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org Date: Tue, 15 Jul 2014 10:21:04 -0400 Message-ID: <20140715142104.8908.98112.stgit@manet.1015granger.net> In-Reply-To: <20140715142020.8908.80969.stgit@manet.1015granger.net> References: <20140715142020.8908.80969.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=-6.8 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 --- 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; }