From patchwork Fri Oct 16 13:30:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 7415381 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 55BC09F36A for ; Fri, 16 Oct 2015 13:30:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1C73620742 for ; Fri, 16 Oct 2015 13:30:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D41A20600 for ; Fri, 16 Oct 2015 13:30:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752233AbbJPNaS (ORCPT ); Fri, 16 Oct 2015 09:30:18 -0400 Received: from mail-qg0-f52.google.com ([209.85.192.52]:33770 "EHLO mail-qg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751509AbbJPNaR (ORCPT ); Fri, 16 Oct 2015 09:30:17 -0400 Received: by qgeo38 with SMTP id o38so55256540qge.0; Fri, 16 Oct 2015 06:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:subject:to:date:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=ap1ZpXS1T65jRSqigRXnhiZZbKo/grOwgoUlQKHuqS4=; b=dwpIoZGCYIpF0h8SJ2F0HxP5hHLn0yiNNWDd16CQ4xQcAYi6adG7wEA9WiQplHdYhr ewZlTrcykZWP6fRNJDG73Jr4siJ0DEx3oROmNdW8yEHIF7AG8xFGrXPQF1e8bJw907vP +1ftWC4TtmyaRYLRo/T51cBOolnSAdsxN0FNl8iIbfXJ2xcLG2qstIbLkZnO0jRMNOJs sTfQPGFjwPQOafFETYNw6b7wx0Ey4jYLBdghLL1++Jf+nkXk/InOk73C/mn60c5VLEwn rPwas2DHZewEV3u1174m3df37MJLto5fLYBC8QekeUR8Ql4eMM9BlApmaua25ajdqXtQ xR4g== X-Received: by 10.140.39.168 with SMTP id v37mr18830153qgv.24.1445002217000; Fri, 16 Oct 2015 06:30:17 -0700 (PDT) Received: from oracle-120.nfsv4bat.org (nat-pool-rdu-u.redhat.com. [66.187.233.203]) by smtp.gmail.com with ESMTPSA id 187sm7675849qhf.16.2015.10.16.06.30.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Oct 2015 06:30:16 -0700 (PDT) From: Chuck Lever Subject: [PATCH] svcrdma: Do not send XDR roundup bytes for a write chunk To: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Date: Fri, 16 Oct 2015 09:30:15 -0400 Message-ID: <20151016132938.8597.65237.stgit@oracle-120.nfsv4bat.org> User-Agent: StGIT/0.14.3 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,T_DKIM_INVALID,T_RP_MATCHES_RCVD,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 Minor optimization: when dealing with write chunk XDR roundup, do not post a Write WR for the zero bytes in the pad. Simply update the write segment in the RPC-over-RDMA header to reflect the extra pad bytes. The Reply chunk is also a write chunk, but the server does not use send_write_chunks() to send the Reply chunk. That's OK in this case: the server Upper Layer typically marshals the Reply chunk contents in a single contiguous buffer, without a separate tail for the XDR pad. The comments and the variable naming refer to "chunks" but what is really meant is "segments." The existing code sends only one xdr_write_chunk per RPC reply. The fix assumes this as well. When the XDR pad in the first write chunk is reached, the assumption is the Write list is complete and send_write_chunks() returns. That will remain a valid assumption until the server Upper Layer can support multiple bulk payload results per RPC. Signed-off-by: Chuck Lever --- net/sunrpc/xprtrdma/svc_rdma_sendto.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 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/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index 1dfae83..6c48901 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c @@ -342,6 +342,13 @@ static int send_write_chunks(struct svcxprt_rdma *xprt, arg_ch->rs_handle, arg_ch->rs_offset, write_len); + + /* Do not send XDR pad bytes */ + if (chunk_no && write_len < 4) { + chunk_no++; + break; + } + chunk_off = 0; while (write_len) { ret = send_write(xprt, rqstp,