]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
tcp: deferring in middle of queue makes very little sense
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Sat, 28 Feb 2009 04:44:29 +0000 (04:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Mar 2009 11:00:10 +0000 (03:00 -0800)
If skb can be sent right away, we certainly should do that
if it's in the middle of the queue because it won't get
more data into it.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_output.c

index 2471cd4f66db7f99a1855e7837f94b9cb4a3ed3c..fa3c81aa4e6af23203892d60ad40ebe7be3a5100 100644 (file)
@@ -1356,6 +1356,10 @@ static int tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb)
        if (limit >= sk->sk_gso_max_size)
                goto send_now;
 
+       /* Middle in queue won't get any more data, full sendable already? */
+       if ((skb != tcp_write_queue_tail(sk)) && (limit >= skb->len))
+               goto send_now;
+
        if (sysctl_tcp_tso_win_divisor) {
                u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache);