public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Neal Cardwell <ncardwell@google.com>
Cc: alekcejk@googlemail.com, netdev@vger.kernel.org
Subject: Re: Re: Re: Re: limited network bandwidth with 3.2.x kernels
Date: Tue, 21 Feb 2012 19:41:23 +0100	[thread overview]
Message-ID: <1329849683.18384.41.camel@edumazet-laptop> (raw)
In-Reply-To: <CADVnQynNEzJQvWdFeSDadPA7uZsraC64m=kNwe8M8sDsCyBD1Q@mail.gmail.com>

Le vendredi 17 février 2012 à 11:41 -0500, Neal Cardwell a écrit :
> On Thu, Feb 16, 2012 at 5:35 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > An incoming skb is considered as "good citizen" in term of memory usage
> > if its truesize is no more than
> > len + len/4   (if adv_win_scale == 2)
> >
> > That was true when truesize was 1500+NET_SKB_PAD+sizeof(sk_buff),
> > but not true anymore when truesize is 2048+sizeof(sk_buff), or even more
> > when its 4096+sizeof(sk_buff)
> >
> > So receiver doesnt increase rcv_ssthresh and cannot open its window.
> >
> > tcp_grow_window() should be tweaked to :
> >
> > 1) Relax the requirements
> > 2) Allow bigger increase in case of super packets (LRO/GRO)
> 
> That sounds great. Is this something you're planning on tackling?
> 

Hmm, I thought about following (untested) patch :

Idea is to increase rcv_sshthresh by 2*len * (len/truesize), instead of
2*mss.



diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 53c8ce4..3fcea17 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -327,11 +327,17 @@ static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb)
 		/* Check #2. Increase window, if skb with such overhead
 		 * will fit to rcvbuf in future.
 		 */
-		if (tcp_win_from_space(skb->truesize) <= skb->len)
-			incr = 2 * tp->advmss;
-		else
-			incr = __tcp_grow_window(sk, skb);
+		if (tp->rx_opt.rcv_wscale) {
+			u64 scaled = (u64)skb->len * skb->len;
 
+			do_div(scaled, skb->truesize >> 1);
+			incr = (int)scaled;
+		} else {
+			if (tcp_win_from_space(skb->truesize) <= skb->len)
+				incr = 2 * tp->advmss;
+			else
+				incr = __tcp_grow_window(sk, skb);
+		}
 		if (incr) {
 			tp->rcv_ssthresh = min(tp->rcv_ssthresh + incr,
 					       tp->window_clamp);

  reply	other threads:[~2012-02-21 18:41 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-13 20:04 limited network bandwidth with 3.2.x kernels alekcejk
2012-02-13 20:18 ` Eric Dumazet
2012-02-13 21:13   ` Eric Dumazet
2012-02-13 21:58     ` alekcejk
2012-02-13 22:44       ` Eric Dumazet
2012-02-13 22:51         ` Neal Cardwell
2012-02-13 23:09           ` alekcejk
2012-02-13 23:14             ` Eric Dumazet
2012-02-13 23:24               ` alekcejk
2012-02-13 23:49         ` alekcejk
2012-02-14  3:06           ` Neal Cardwell
2012-02-14  3:26             ` alekcejk
2012-02-14  5:55           ` Eric Dumazet
2012-02-14 14:09             ` alekcejk
2012-02-13 21:16   ` alekcejk
2012-02-21  4:21   ` alekcejk
2012-02-21 16:45     ` Eric Dumazet
2012-02-21 17:19       ` alekcejk
2012-02-21 17:31         ` Eric Dumazet
2012-02-21 18:53           ` alekcejk
2012-02-22  1:26           ` alekcejk
     [not found] ` <1920135.kl3o7Tt79c@localhost.localdomain>
     [not found]   ` <1329228798.4818.0.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
2012-02-14 14:28     ` alekcejk
2012-02-14 16:00       ` Eric Dumazet
2012-02-14 16:43         ` alekcejk
2012-02-15  4:43           ` Eric Dumazet
2012-02-15  6:03             ` Neal Cardwell
2012-02-15  6:06               ` Eric Dumazet
2012-02-15  7:52                 ` Bill Fink
2012-02-15  8:00                   ` Eric Dumazet
2012-02-15  8:18                     ` Bill Fink
2012-02-15  8:31                       ` Eric Dumazet
2012-02-15 13:44                   ` alekcejk
2012-02-15 13:43               ` Re: Re: Re: Re: " alekcejk
2012-02-15 13:44             ` alekcejk
2012-02-15 13:49               ` Eric Dumazet
2012-02-15 13:53                 ` Eric Dumazet
2012-02-15 14:11                 ` alekcejk
2012-02-15 14:49                   ` Neal Cardwell
2012-02-15 14:56                     ` Eric Dumazet
2012-02-15 15:05                     ` alekcejk
2012-02-15 15:08                   ` Eric Dumazet
2012-02-15 19:44                     ` Neal Cardwell
2012-02-16  7:29                       ` Eric Dumazet
2012-02-16 13:40                         ` Eric Dumazet
2012-02-16 13:51                           ` Ben Hutchings
2012-02-16 15:09                             ` Eric Dumazet
2012-02-16 16:37                               ` Ben Hutchings
2012-02-16 17:01                               ` David Miller
2012-02-16 17:22                                 ` Neal Cardwell
2012-02-16 17:54                                   ` alekcejk
2012-02-16 18:19                                     ` Neal Cardwell
2012-02-16 21:49                                       ` alekcejk
2012-02-16 21:59                                         ` Eric Dumazet
2012-02-16 22:08                                           ` alekcejk
2012-02-16 22:35                                             ` Eric Dumazet
2012-02-17 16:41                                               ` Neal Cardwell
2012-02-21 18:41                                                 ` Eric Dumazet [this message]
2012-02-21 19:11                                                   ` David Miller
2012-02-22  5:51                                                   ` Neal Cardwell
2012-02-22  7:36                                                     ` Eric Dumazet
2012-02-23 18:39                                                       ` Neal Cardwell
2012-02-23 18:49                                                         ` Eric Dumazet
2012-02-27 19:39                                                         ` David Miller
2012-02-17 16:55                                           ` Re: " Neal Cardwell
2012-02-16 18:22                                   ` Eric Dumazet
2012-02-16 19:44                                     ` Eric Dumazet

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=1329849683.18384.41.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=alekcejk@googlemail.com \
    --cc=ncardwell@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox