]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: tsq: fix nonagle handling
authorJohn Ogness <john.ogness@linutronix.de>
Mon, 10 Feb 2014 02:40:11 +0000 (18:40 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Feb 2014 23:23:39 +0000 (15:23 -0800)
commit73fc4008895a06e2d9e51fbc757fc16a8fe22e98
treea6526d9291de28a71ffdf85940968399d0c4768d
parent4fedcf6acce704f038a0267a179b418365f6c56c
tcp: tsq: fix nonagle handling

Commit 684db463d695 ("tcp: TCP Small Queues") introduced a possible
regression for applications using TCP_NODELAY.

If TCP session is throttled because of tsq, we should consult
tp->nonagle when TX completion is done and allow us to send additional
segment, especially if this segment is not a full MSS.
Otherwise this segment is sent after an RTO.

[edumazet] : Cooked the changelog, added another fix about testing
sk_wmem_alloc twice because TX completion can happen right before
setting TSQ_THROTTLED bit.

This problem is particularly visible with recent auto corking,
but might also be triggered with low tcp_limit_output_bytes
values or NIC drivers delaying TX completion by hundred of usec,
and very low rtt.

Thomas Glanzmann for example reported an iscsi regression, caused
by tcp auto corking making this bug quite visible.

Fixes: 684db463d695 ("tcp: TCP Small Queues")
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Thomas Glanzmann <thomas@glanzmann.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_output.c