Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp505642pxb; Wed, 3 Feb 2021 10:21:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwosYxZFMuFzC1iYPNlyoozUA4WXw5QL4vlfddpJvuMLTpYpMrPpeEWtABQ1m7a9vy0w4to X-Received: by 2002:a17:906:4e0c:: with SMTP id z12mr4387121eju.370.1612376460997; Wed, 03 Feb 2021 10:21:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612376460; cv=none; d=google.com; s=arc-20160816; b=M3pEmio/B6G5wECijaTfGpVu7VMDbAq+ntg87+74nHWblYNVQ5xX7SB1rzmk0AzY5U aTCYYj1FeNC6dYo+Mx9bN9o/lHtwp0j0dGf5kiqg1S2uAC/SaFsxUx35ydgiVfKGVSmp HAZyhpxBxlwa7uQoYwnG1SYL4HhNjgog2tAFrOj+RbNMFPnQ/oGczNMM8DCrC9czQAZS e1HFM4w3t/4HdtxGr42sowIqlVmTll36w4b6GZGwKR7DSwnliRX9ihRcZJraHiaChgN+ RtvSZjFM58FE20yFJlZoxtSnlwvuBFh9Z29+921GtWEamyNNtKFOKgIiozYVDkexx7El s9Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject; bh=nRFByrVbZ/S4yPbCDfLGwlHs2SCvm3+sF8l0VFr/TRA=; b=qCZg7MDtIWbh4d/HLAEPwTrPApBKdXWxww1xbO9P/NVNb22KPv4Wrou2jAEBHzmkOO 9qWOvzr+pDaxLZ/yBRoq2nhxXxl1Xfd8DMj6ggFlcJiQBMwDT0xOjJTKIjyZodNi+FQw FI9IidCFz7xRuOb7lie8RzzwRH7doZZFBadLmjPOYS6OsEMdT7GQrziIQgfgSseHyIoW k0lYycPAY7Q5LizDphTUYWsBWFBHCRWEXKqr7K6kvbFBsJe7dMXbZ92SzAUtYR7E/Gsi RkCUy7GL+hEWV/ZGI9FOV/dxJ6jS8TPSHVmZyt0IE7CIQzLJNmu0QOIKHcSP7LSQQziC nFaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z15si639451ejr.273.2021.02.03.10.20.34; Wed, 03 Feb 2021 10:21:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232718AbhBCSRx (ORCPT + 99 others); Wed, 3 Feb 2021 13:17:53 -0500 Received: from p3plsmtpa11-08.prod.phx3.secureserver.net ([68.178.252.109]:56269 "EHLO p3plsmtpa11-08.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231591AbhBCSOs (ORCPT ); Wed, 3 Feb 2021 13:14:48 -0500 Received: from [192.168.0.116] ([71.184.94.153]) by :SMTPAUTH: with ESMTPSA id 7Mf9l2VeRK9xx7Mf9l6ahy; Wed, 03 Feb 2021 11:13:59 -0700 X-CMAE-Analysis: v=2.4 cv=K9/nowaI c=1 sm=1 tr=0 ts=601ae7e7 a=vbvdVb1zh1xTTaY8rfQfKQ==:117 a=vbvdVb1zh1xTTaY8rfQfKQ==:17 a=IkcTkHD0fZMA:10 a=SEc3moZ4AAAA:8 a=JDjsHSkAAAAA:8 a=yPCof4ZbAAAA:8 a=O4n9R6YOxJqAsZlgij0A:9 a=QEXdDO2ut3YA:10 a=5oRCH6oROnRZc2VpWJZ3:22 a=dseMxAR1CDlncBZeV_se:22 X-SECURESERVER-ACCT: tom@talpey.com Subject: Re: [PATCH v2 5/6] xprtrdma: Pad optimization, revisited To: Chuck Lever , linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org References: <161236925476.1030487.10407536259816633879.stgit@manet.1015granger.net> <161236945965.1030487.13894327853038566730.stgit@manet.1015granger.net> From: Tom Talpey Message-ID: Date: Wed, 3 Feb 2021 13:13:59 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <161236945965.1030487.13894327853038566730.stgit@manet.1015granger.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfLjTiY8FLn2E+ubZUE3/OAQbH7UoR55Hy9rcXEErYfHtTYtSUncCP83keR+3oCzoZCAnQKf1SIgdHEktOigCQVRtK+ArIQ7gw3WaYLVPm3MwoPUyOYGP YCWSuDIoZEoWIt3Dd9er/Vc7msFC31ZucyWsxOSm+N1b9Q4d1/vJUqs3JFrB2jmKBDW7csDotrSMVM1J7nunzQOsw1yigjX49lRcZv6jCtxLFZdL2ofU1H6L ZK6rWyJh5+fDE604RHwZNCGAuUr9SEXO3LcGixd8TyA= Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org This is a safe and obviously warranted processing revision. The changelog is quite an eyeful for a one-liner, and maybe only makes sense to the truly dedicated reader. But... Reviewed-By: Tom Talpey On 2/3/2021 11:24 AM, Chuck Lever wrote: > The NetApp Linux team discovered that with NFS/RDMA servers that do > not support RFC 8797, the Linux client is forming NFSv4.x WRITE > requests incorrectly. > > In this case, the Linux NFS client disables implicit chunk round-up > for odd-length Read and Write chunks. The goal was to support old > servers that needed that padding to be sent explicitly by clients. > > In that case the Linux NFS included the tail kvec in the Read chunk, > since the tail contains any needed padding. That meant a separate > memory registration is needed for the tail kvec, adding to the cost > of forming such requests. To avoid that cost for a mere 3 bytes of > zeroes that are always ignored by receivers, we try to use implicit > roundup when possible. > > For NFSv4.x, the tail kvec also sometimes contains a trailing > GETATTR operation. The Linux NFS clients is unintentionally > including that GETATTR operation in the Read chunk as well as > inline. Fortunately, servers ignore this craziness and go about > their normal business. > > The fix is simply to /never/ include the tail kvec when forming a > data payload Read chunk. > > Note that since commit 9ed5af268e88 ("SUNRPC: Clean up the handling > of page padding in rpc_prepare_reply_pages()") the NFS client passes > payload data to the transport with the padding in xdr->pages instead > of in the send buffer's tail kvec. So now the Linux NFS client > appends XDR padding to all odd-sized Read chunks. This shouldn't be > a problem because: > > - RFC 8166-compliant servers are supposed to work with or without > that XDR padding in Read chunks. > > - Since the padding is now in the same memory region as the data > payload, a separate memory registration is not needed. In > addition, the link layer extends data in RDMA Read responses to > 4-byte boundaries anyway. Thus there is now no savings when the > padding is not included. > > Because older kernels include the payload's XDR padding in the > tail kvec, a fix there will be more complicated. Thus backporting > this patch is not recommended. > > Reported by: Olga Kornievskaia > Signed-off-by: Chuck Lever > --- > net/sunrpc/xprtrdma/rpc_rdma.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c > index f0af89a43efd..f1b52f9ab242 100644 > --- a/net/sunrpc/xprtrdma/rpc_rdma.c > +++ b/net/sunrpc/xprtrdma/rpc_rdma.c > @@ -257,10 +257,7 @@ rpcrdma_convert_iovs(struct rpcrdma_xprt *r_xprt, struct xdr_buf *xdrbuf, > page_base = 0; > } > > - /* When encoding a Read chunk, the tail iovec contains an > - * XDR pad and may be omitted. > - */ > - if (type == rpcrdma_readch && r_xprt->rx_ep->re_implicit_roundup) > + if (type == rpcrdma_readch) > goto out; > > /* When encoding a Write chunk, some servers need to see an > > >