Thread (45 messages) 45 messages, 6 authors, 2012-02-27

Re: Re: Re: Re: limited network bandwidth with 3.2.x kernels

From: Eric Dumazet <hidden>
Date: 2012-02-21 18:41:27
Subsystem: networking [general], networking [tcp], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Neal Cardwell, Linus Torvalds

Possibly related (same subject, not in this thread)

Le vendredi 17 février 2012 à 11:41 -0500, Neal Cardwell a écrit :
On Thu, Feb 16, 2012 at 5:35 PM, Eric Dumazet [off-list ref] wrote:
quoted
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);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help