linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: bfields@fieldses.org
Cc: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: [PATCH v1 1/4] svcrdma: Reduce max_send_sges
Date: Mon, 01 Oct 2018 14:15:56 -0400	[thread overview]
Message-ID: <20181001181556.2305.66320.stgit@klimt.1015granger.net> (raw)
In-Reply-To: <20181001181414.2305.94635.stgit@klimt.1015granger.net>

There's no need to request a large number of send SGEs because the
inline threshold already constrains the number of SGEs per Send.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 net/sunrpc/xprtrdma/svc_rdma_transport.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
index 2848caf..2f7ec89 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -475,10 +475,12 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
 
 	/* Qualify the transport resource defaults with the
 	 * capabilities of this particular device */
-	newxprt->sc_max_send_sges = dev->attrs.max_send_sge;
-	/* transport hdr, head iovec, one page list entry, tail iovec */
-	if (newxprt->sc_max_send_sges < 4) {
-		pr_err("svcrdma: too few Send SGEs available (%d)\n",
+	/* Transport header, head iovec, tail iovec */
+	newxprt->sc_max_send_sges = 3;
+	/* Add one SGE per page list entry */
+	newxprt->sc_max_send_sges += svcrdma_max_req_size / PAGE_SIZE;
+	if (newxprt->sc_max_send_sges > dev->attrs.max_send_sge) {
+		pr_err("svcrdma: too few Send SGEs available (%d needed)\n",
 		       newxprt->sc_max_send_sges);
 		goto errout;
 	}

  reply	other threads:[~2018-10-02  0:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 18:15 [PATCH v1 0/4] NFS/RDMA server patches for v4.20 Chuck Lever
2018-10-01 18:15 ` Chuck Lever [this message]
2018-10-01 22:28   ` [PATCH v1 1/4] svcrdma: Reduce max_send_sges Sagi Grimberg
2018-10-01 18:16 ` [PATCH v1 2/4] svcrdma: Remove ->release_rqst call in bc reply handler Chuck Lever
2018-10-01 22:28   ` Sagi Grimberg
2018-10-01 18:16 ` [PATCH v1 3/4] svcrdma: Remove try_module_get from backchannel Chuck Lever
2018-10-01 22:31   ` Sagi Grimberg
2018-10-01 22:35     ` Sagi Grimberg
2018-10-01 18:16 ` [PATCH v1 4/4] svcrdma: Increase the default connection credit limit Chuck Lever
2018-10-01 22:33   ` Sagi Grimberg
2018-10-02 14:34     ` Chuck Lever
2018-10-04  1:01 ` [PATCH v1 0/4] NFS/RDMA server patches for v4.20 J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181001181556.2305.66320.stgit@klimt.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).