All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Heffner <jheffner@psc.edu>
To: Alex Sidorenko <alexandre.sidorenko@hp.com>
Cc: netdev@vger.kernel.org
Subject: Re: SWS for rcvbuf < MTU
Date: Fri, 02 Mar 2007 13:54:45 -0500	[thread overview]
Message-ID: <45E872F5.2030102@psc.edu> (raw)
In-Reply-To: <200703021128.29208.alexandre.sidorenko@hp.com>

[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]

Alex Sidorenko wrote:
[snip]
> --- net/ipv4/tcp_output.c.orig  Wed May  3 20:40:43 2006
> +++ net/ipv4/tcp_output.c       Tue Jan 30 14:24:56 2007
> @@ -641,6 +641,7 @@
>   * Note, we don't "adjust" for TIMESTAMP or SACK option bytes.
>   * Regular options like TIMESTAMP are taken into account.
>   */
> +static const char *SWS_id_string="@#SWS-fix-2";
>  u32 __tcp_select_window(struct sock *sk)
>  {
>         struct tcp_opt *tp = &sk->tp_pinfo.af_tcp;
> @@ -682,6 +683,9 @@
>         window = tp->rcv_wnd;
>         if (window <= free_space - mss || window > free_space)
>                 window = (free_space/mss)*mss;
> +        /* A fix for small rcvbuf asid@hp.com */
> +       else if (mss == full_space && window < full_space/2)
> +               window = full_space/2;
> 
>         return window;
>  }

Good analysis of the problem, but the patch does not look quite right. 
In particular, you can't ever announce a zero window. :)

I think this attached patch does the correct SWS avoidance.

Thanks,
   -John


[-- Attachment #2: r-sws.patch --]
[-- Type: text/plain, Size: 912 bytes --]

Do receiver-side SWS avoidance for rcvbuf < MSS.

Signed-off-by: John Heffner <jheffner@psc.edu>

---
commit 38d33181c93a28cf7fb2f9f3377305a04636c054
tree 503f8a9de6e78694bae9fc2eb1c9dd5d26a0b5ed
parent 562aa1d4c6a874373f9a48ac184f662fbbb06a04
author John Heffner <jheffner@psc.edu> Fri, 02 Mar 2007 13:47:44 -0500
committer John Heffner <jheffner@psc.edu> Fri, 02 Mar 2007 13:47:44 -0500

 net/ipv4/tcp_output.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index dc15113..688b955 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1607,6 +1607,9 @@ u32 __tcp_select_window(struct sock *sk)
 		 */
 		if (window <= free_space - mss || window > free_space)
 			window = (free_space/mss)*mss;
+		else if (mss == full_space &&
+		         free_space > window + full_space/2)
+			window = free_space;
 	}
 
 	return window;

  reply	other threads:[~2007-03-02 18:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-02 16:28 SWS for rcvbuf < MTU Alex Sidorenko
2007-03-02 18:54 ` John Heffner [this message]
2007-03-02 20:29   ` Alex Sidorenko
2007-03-02 19:25 ` David Miller
2007-03-02 20:21   ` Alex Sidorenko
2007-03-02 20:33     ` David Miller
2007-03-02 21:16       ` John Heffner
2007-03-02 21:38         ` David Miller
2007-03-03 23:40           ` John Heffner
2007-03-05 16:52             ` Alex Sidorenko
2007-03-13 19:01               ` John Heffner
2007-03-14 16:18                 ` Alex Sidorenko
2007-04-02 20:01                   ` Alex Sidorenko
2007-04-02 20:21                     ` David Miller

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=45E872F5.2030102@psc.edu \
    --to=jheffner@psc.edu \
    --cc=alexandre.sidorenko@hp.com \
    --cc=netdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.