From: Chuck Lever <chuck.lever@oracle.com>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 09/10] SUNRPC: Ensure that we read all available tcp data
Date: Wed, 27 Feb 2008 10:21:34 -0800 [thread overview]
Message-ID: <47C5AA2E.8020408@oracle.com> (raw)
In-Reply-To: <20080226172308.10383.82368.stgit-KPEdlmqt5P7XOazzY/2fV4TcuzvYVacciM950cveMlzk1uMJSBkQmQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1341 bytes --]
Trond Myklebust wrote:
> Don't stop until we run out of data, or we hit an error.
I don't understand how this patch is related to the others.
> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> ---
>
> net/sunrpc/xprtsock.c | 7 +++++--
> 1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
> index 30e7ac2..8bd3b0f 100644
> --- a/net/sunrpc/xprtsock.c
> +++ b/net/sunrpc/xprtsock.c
> @@ -1073,6 +1073,7 @@ static void xs_tcp_data_ready(struct sock *sk, int bytes)
> {
> struct rpc_xprt *xprt;
> read_descriptor_t rd_desc;
> + int read;
>
> dprintk("RPC: xs_tcp_data_ready...\n");
>
> @@ -1084,8 +1085,10 @@ static void xs_tcp_data_ready(struct sock *sk, int bytes)
>
> /* We use rd_desc to pass struct xprt to xs_tcp_data_recv */
> rd_desc.arg.data = xprt;
> - rd_desc.count = 65536;
> - tcp_read_sock(sk, &rd_desc, xs_tcp_data_recv);
> + do {
> + rd_desc.count = 65536;
> + read = tcp_read_sock(sk, &rd_desc, xs_tcp_data_recv);
> + } while (read > 0);
Why are we looping instead of simply setting rd_desc.count to a larger
value (say, a megabyte)?
(If we keep this, it would be nice to replace the "65536" with a macro,
and to add a comment explaining the need for the loop).
> out:
> read_unlock(&sk->sk_callback_lock);
> }
[-- Attachment #2: chuck_lever.vcf --]
[-- Type: text/x-vcard, Size: 270 bytes --]
begin:vcard
fn:Chuck Lever
n:Lever;Chuck
org:Oracle Corporation;Corporate Architecture: Linux Projects Group
adr:;;1015 Granger Avenue;Ann Arbor;MI;48104;USA
title:Principal Member of Staff
tel;work:+1 248 614 5091
x-mozilla-html:FALSE
version:2.1
end:vcard
next prev parent reply other threads:[~2008-02-27 18:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080226172308.10383.49081.stgit@c-69-242-210-120.hsd1.mi.comcast.net>
[not found] ` <20080226172308.10383.49081.stgit-KPEdlmqt5P7XOazzY/2fV4TcuzvYVacciM950cveMlzk1uMJSBkQmQ@public.gmane.org>
2008-02-26 17:23 ` [PATCH 06/10] SUNRPC: Add a timer function to wait queues Trond Myklebust
2008-02-26 17:23 ` [PATCH 09/10] SUNRPC: Ensure that we read all available tcp data Trond Myklebust
[not found] ` <20080226172308.10383.82368.stgit-KPEdlmqt5P7XOazzY/2fV4TcuzvYVacciM950cveMlzk1uMJSBkQmQ@public.gmane.org>
2008-02-27 18:21 ` Chuck Lever [this message]
2008-02-26 17:23 ` [PATCH 01/10] SUNRPC: Clean up rpc_run_timer() Trond Myklebust
2008-02-26 17:23 ` [PATCH 07/10] SUNRPC: Switch tasks to using the rpc_waitqueue's timer function Trond Myklebust
2008-02-26 17:23 ` [PATCH 05/10] SUNRPC: Add a (empty for the moment) destructor for rpc_wait_queues Trond Myklebust
2008-02-26 17:23 ` [PATCH 02/10] SUNRPC: Add a new helper rpc_wake_up_queued_task() Trond Myklebust
2008-02-26 17:23 ` [PATCH 08/10] SUNRPC: Eliminate the now-redundant rpc_start_wakeup() Trond Myklebust
2008-02-26 17:23 ` [PATCH 03/10] SUNRPC: Convert users of rpc_wake_up_task to use rpc_wake_up_queued_task Trond Myklebust
2008-02-26 17:23 ` [PATCH 04/10] SUNRPC: Run rpc timeout functions as callbacks instead of in softirqs Trond Myklebust
2008-02-26 17:23 ` [PATCH 10/10] SUNRPC: Remove now-redundant RCU-safe rpc_task free path Trond Myklebust
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=47C5AA2E.8020408@oracle.com \
--to=chuck.lever@oracle.com \
--cc=Trond.Myklebust@netapp.com \
--cc=linux-nfs@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