diff mbox

tcp: fix tcp_grow_window() for large incoming frames

Message ID 1334654887.2472.28.camel@edumazet-glaptop
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Eric Dumazet April 17, 2012, 9:28 a.m. UTC
From: Eric Dumazet <edumazet@google.com>

tcp_grow_window() has to grow rcv_ssthresh up to window_clamp, allowing
sender to increase its window.

tcp_grow_window() still assumes a tcp frame is under MSS, but its no
longer true with LRO/GRO.

This patch fixes one of the performance issue we noticed with GRO on.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Tom Herbert <therbert@google.com>
---
Sorry for the delay, this was discussed a long time ago.

 net/ipv4/tcp_input.c |    1 +
 1 file changed, 1 insertion(+)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Neal Cardwell April 17, 2012, 12:40 p.m. UTC | #1
On Tue, Apr 17, 2012 at 5:28 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> tcp_grow_window() has to grow rcv_ssthresh up to window_clamp, allowing
> sender to increase its window.
>
> tcp_grow_window() still assumes a tcp frame is under MSS, but its no
> longer true with LRO/GRO.
>
> This patch fixes one of the performance issue we noticed with GRO on.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Neal Cardwell <ncardwell@google.com>
> Cc: Tom Herbert <therbert@google.com>
> ---
> Sorry for the delay, this was discussed a long time ago.
>
>  net/ipv4/tcp_input.c |    1 +
>  1 file changed, 1 insertion(+)

Acked-by: Neal Cardwell <ncardwell@google.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller April 18, 2012, 2:33 a.m. UTC | #2
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 17 Apr 2012 11:28:07 +0200

> From: Eric Dumazet <edumazet@google.com>
> 
> tcp_grow_window() has to grow rcv_ssthresh up to window_clamp, allowing
> sender to increase its window.
> 
> tcp_grow_window() still assumes a tcp frame is under MSS, but its no
> longer true with LRO/GRO.
> 
> This patch fixes one of the performance issue we noticed with GRO on.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 9944c1d..3ff36406 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -335,6 +335,7 @@  static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb)
 			incr = __tcp_grow_window(sk, skb);
 
 		if (incr) {
+			incr = max_t(int, incr, 2 * skb->len);
 			tp->rcv_ssthresh = min(tp->rcv_ssthresh + incr,
 					       tp->window_clamp);
 			inet_csk(sk)->icsk_ack.quick |= 1;