From patchwork Sun Apr 9 17:06:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 9671635 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D98BC601EA for ; Sun, 9 Apr 2017 17:07:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4BB82621F for ; Sun, 9 Apr 2017 17:07:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B96FB27F85; Sun, 9 Apr 2017 17:07:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID,URIBL_BLACK autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F98E2621F for ; Sun, 9 Apr 2017 17:07:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752376AbdDIRHA (ORCPT ); Sun, 9 Apr 2017 13:07:00 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:33967 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752270AbdDIRG7 (ORCPT ); Sun, 9 Apr 2017 13:06:59 -0400 Received: by mail-io0-f194.google.com with SMTP id n76so11780784ioe.1; Sun, 09 Apr 2017 10:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=0zcbecbOfvfXQRWkw0dmEfDThITlLXIquBfQzryw2CQ=; b=YrTGQ1VeC3DsBqFnee42uqbnuwKORJPD010mXI3ttHx4znNRMwIkTEja8wNiyg++zC pOqFWxBYA+MBJji8AEE+kzuufwou/NYY+62FlRld2nor+/49t0tkrwzanh0Cb8ZmjNlC PkIBFJtlQWSKHCY2LzRIbxSkb3w+5vjkwcU6UufEAHsIYGehEmXPGZd5ivbcdBCpa0Zh 4vMK0J6TYIcNv3iY5cNarzWOlVF7osaC1rV3qqDNhLIJdElNkt/HqbKfgja5iUhvNQPM Wu/BUeJva9TOuAUt5YECSHHWOHb6iUGDmJPVf2HThVsbGP8zPDEd5R1PDRBgdISjMQqN 6xpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:cc:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=0zcbecbOfvfXQRWkw0dmEfDThITlLXIquBfQzryw2CQ=; b=an4yJ38hqsxHJkk4ABnOfgx+v97TMJPJnoL5m4pzFFrApSOSG+0x1YkvRakRS4KYse daiYMej2H4md0TGXvMUsBXTf5hXsnD9TXrJ9Uy9hrigriinwIZERV3RZt2Vw1ZINsI9m S8b4FbwEeveq8ufgpxb43BLzr/b0tVHKbGK5TLksD9cUeDBKwm71lVg7Qc9Sd7Lx8BhY 8dvp4qTqiLXF8Ln9uc4Jh8BrY+TgE1lLs/IN4vJXke6XCzvhjwQqSbmYF4kTfSwZd683 wCrJglexfsixAhHl1FHtj+PTa8Hqf6uYDP3U0DebF0yZet2cbFK1Q0euh9YhSFggH4gi +8JA== X-Gm-Message-State: AN3rC/5+8KGqkWgeyc84WdK13gurnn9Y3OHvzQBvWS3ctoAgkOAA9o0K Vs74SfQ2M+3r2h2K X-Received: by 10.36.22.85 with SMTP id a82mr8564202ita.83.1491757618325; Sun, 09 Apr 2017 10:06:58 -0700 (PDT) Received: from klimt.1015granger.net (c-68-46-169-226.hsd1.mi.comcast.net. [68.46.169.226]) by smtp.gmail.com with ESMTPSA id m125sm5268199iom.38.2017.04.09.10.06.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Apr 2017 10:06:57 -0700 (PDT) Subject: [PATCH v3 11/14] svcrdma: Reduce size of sge array in struct svc_rdma_op_ctxt From: Chuck Lever To: bfields@fieldses.org Cc: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org Date: Sun, 09 Apr 2017 13:06:57 -0400 Message-ID: <20170409170657.15073.56765.stgit@klimt.1015granger.net> In-Reply-To: <20170409163820.15073.43257.stgit@klimt.1015granger.net> References: <20170409163820.15073.43257.stgit@klimt.1015granger.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The sge array in struct svc_rdma_op_ctxt is no longer used for sending RDMA Write WRs. It need only accommodate the construction of Send and Receive WRs. The maximum inline size is the largest payload it needs to handle now. Signed-off-by: Chuck Lever Reviewed-by: Sagi Grimberg --- include/linux/sunrpc/svc_rdma.h | 9 +++++++-- net/sunrpc/xprtrdma/svc_rdma.c | 6 +++--- 2 files changed, 10 insertions(+), 5 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/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h index 44d642b..e84b775 100644 --- a/include/linux/sunrpc/svc_rdma.h +++ b/include/linux/sunrpc/svc_rdma.h @@ -48,6 +48,12 @@ #include #define SVCRDMA_DEBUG +/* Default and maximum inline threshold sizes */ +enum { + RPCRDMA_DEF_INLINE_THRESH = 4096, + RPCRDMA_MAX_INLINE_THRESH = 65536 +}; + /* RPC/RDMA parameters and stats */ extern unsigned int svcrdma_ord; extern unsigned int svcrdma_max_requests; @@ -86,7 +92,7 @@ struct svc_rdma_op_ctxt { int count; unsigned int mapped_sges; struct ib_send_wr send_wr; - struct ib_sge sge[RPCSVC_MAXPAGES]; + struct ib_sge sge[1 + RPCRDMA_MAX_INLINE_THRESH / PAGE_SIZE]; struct page *pages[RPCSVC_MAXPAGES]; }; @@ -186,7 +192,6 @@ struct svcxprt_rdma { * page size of 4k, or 32k * 2 ops / 4k = 16 outstanding RDMA_READ. */ #define RPCRDMA_ORD (64/4) #define RPCRDMA_MAX_REQUESTS 32 -#define RPCRDMA_MAX_REQ_SIZE 4096 /* Typical ULP usage of BC requests is NFSv4.1 backchannel. Our * current NFSv4.1 implementation supports one backchannel slot. diff --git a/net/sunrpc/xprtrdma/svc_rdma.c b/net/sunrpc/xprtrdma/svc_rdma.c index 9124441..a4a8f69 100644 --- a/net/sunrpc/xprtrdma/svc_rdma.c +++ b/net/sunrpc/xprtrdma/svc_rdma.c @@ -58,9 +58,9 @@ unsigned int svcrdma_max_bc_requests = RPCRDMA_MAX_BC_REQUESTS; static unsigned int min_max_requests = 4; static unsigned int max_max_requests = 16384; -unsigned int svcrdma_max_req_size = RPCRDMA_MAX_REQ_SIZE; -static unsigned int min_max_inline = 4096; -static unsigned int max_max_inline = 65536; +unsigned int svcrdma_max_req_size = RPCRDMA_DEF_INLINE_THRESH; +static unsigned int min_max_inline = RPCRDMA_DEF_INLINE_THRESH; +static unsigned int max_max_inline = RPCRDMA_MAX_INLINE_THRESH; atomic_t rdma_stat_recv; atomic_t rdma_stat_read;