From: Alexey Kuznetsov Date: Fri, 30 Sep 2005 00:19:42 +0000 (-0700) Subject: [PATCH] Don't over-clamp window in tcp_clamp_window() X-Git-Tag: v2.6.13.3~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=27489ba07fb2336c9ce616f4e118a81afa78e550;p=karo-tx-linux.git [PATCH] Don't over-clamp window in tcp_clamp_window() Handle better the case where the sender sends full sized frames initially, then moves to a mode where it trickles out small amounts of data at a time. This known problem is even mentioned in the comments above tcp_grow_window() in tcp_input.c, specifically: ... * The scheme does not work when sender sends good segments opening * window and then starts to feed us spagetti. But it should work * in common situations. Otherwise, we have to rely on queue collapsing. ... When the sender gives full sized frames, the "struct sk_buff" overhead from each packet is small. So we'll advertize a larger window. If the sender moves to a mode where small segments are sent, this ratio becomes tilted to the other extreme and we start overrunning the socket buffer space. tcp_clamp_window() tries to address this, but it's clamping of tp->window_clamp is a wee bit too aggressive for this particular case. Fix confirmed by Ion Badulescu. Signed-off-by: "David S. Miller" Signed-off-by: Chris Wright --- diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 53a8a5399f1e..5557c338b56d 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -350,8 +350,6 @@ static void tcp_clamp_window(struct sock *sk, struct tcp_sock *tp) app_win -= tp->ack.rcv_mss; app_win = max(app_win, 2U*tp->advmss); - if (!ofo_win) - tp->window_clamp = min(tp->window_clamp, app_win); tp->rcv_ssthresh = min(tp->window_clamp, 2U*tp->advmss); } }