diff mbox

[net-next] tcp: TSO packets automatic sizing

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

Commit Message

Eric Dumazet Aug. 26, 2013, 2:22 a.m. UTC
On Sun, 2013-08-25 at 17:37 -0700, Eric Dumazet wrote:
> On Sun, 2013-08-25 at 15:01 -0700, Yuchung Cheng wrote:
> 
> > Any idea to get rid of this undesirable extra RTT delay?
> 
> Its probably a bug in the push code.

For exact write/send of a multiple of MSS, I think following patch
should fix the bug.

If we filled a packet, we must send it.

For the other problem, I think its related to Nagle.



--
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

Eric Dumazet Aug. 26, 2013, 3:58 a.m. UTC | #1
On Sun, 2013-08-25 at 19:22 -0700, Eric Dumazet wrote:
> On Sun, 2013-08-25 at 17:37 -0700, Eric Dumazet wrote:
> > On Sun, 2013-08-25 at 15:01 -0700, Yuchung Cheng wrote:
> > 
> > > Any idea to get rid of this undesirable extra RTT delay?
> > 
> > Its probably a bug in the push code.
> 
> For exact write/send of a multiple of MSS, I think following patch
> should fix the bug.
> 
> If we filled a packet, we must send it.
> 
> For the other problem, I think its related to Nagle.

Oh well, thats the tcp_tso_should_defer() again.

        /* If a full-sized TSO skb can be sent, do it. */
        if (limit >= min_t(unsigned int, sk->sk_gso_max_size,
                           sk->sk_gso_max_segs * tp->mss_cache))
                goto send_now;

I'll send a V2 of the patch


--
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.c b/net/ipv4/tcp.c
index ab64eea..dd326f4 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1187,7 +1187,8 @@  new_segment:
 
 			from += copy;
 			copied += copy;
-			if ((seglen -= copy) == 0 && iovlen == 0)
+			seglen -= copy;
+			if (seglen == 0 && iovlen == 0 && skb->len < max)
 				goto out;
 
 			if (skb->len < max || (flags & MSG_OOB) || unlikely(tp->repair))