From patchwork Wed Jul 9 16:57:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 4518381 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 B54D0BEECB for ; Wed, 9 Jul 2014 16:57:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E92D52037D for ; Wed, 9 Jul 2014 16:57:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1D96B2037F for ; Wed, 9 Jul 2014 16:57:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754910AbaGIQ5Z (ORCPT ); Wed, 9 Jul 2014 12:57:25 -0400 Received: from mail-ig0-f177.google.com ([209.85.213.177]:62454 "EHLO mail-ig0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754748AbaGIQ5Y (ORCPT ); Wed, 9 Jul 2014 12:57:24 -0400 Received: by mail-ig0-f177.google.com with SMTP id r10so2098907igi.10 for ; Wed, 09 Jul 2014 09:57:23 -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=Da1Wvu1K78qO0t/+p1U9QEyy7R/YI6/IwYmSg7DeHrk=; b=v5MdZte7Q0PzdF7n3tSlbuNKIP1er6EAa67BNrjtThO/ezVKWOjZJy7O7ewAY01CCA 1598eNAr0oOJrqd6Op9lOcOlbV+9z4N4JCur/yRktOSQG2v0n6cgfMNgfCvmneiQr+oR 1Xh6pQ/Nhjh4/ZWS1V4w9qG5GZMSvzyyNNp4O/vWkd2r1VcvUt60Vm9jhAfnCFc1+SJz z+XDG0jSHTeJj4adOvwOHUUWdimdBZ9UEQWSRE77R4F5pGE6E3ngwCJ1LZe8XHBIhEii EXpx0GAcW8GD2vyS80w9FyPmFbAyJRLSX9p684t97xGekwo0OdtVyND3BVhLsk5LnDcQ 3eBg== X-Received: by 10.42.37.13 with SMTP id w13mr41653367icd.13.1404925043535; Wed, 09 Jul 2014 09:57:23 -0700 (PDT) Received: from manet.1015granger.net ([2604:8800:100:81fc:82ee:73ff:fe43:d64f]) by mx.google.com with ESMTPSA id n17sm16897727igk.19.2014.07.09.09.57.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jul 2014 09:57:23 -0700 (PDT) Subject: [PATCH v2 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: Wed, 09 Jul 2014 12:57:22 -0400 Message-ID: <20140709165722.3496.93133.stgit@manet.1015granger.net> In-Reply-To: <20140709163326.3496.37893.stgit@manet.1015granger.net> References: <20140709163326.3496.37893.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.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 --- 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; }