Skip to content

Commit 843925f

Browse files
herbertxdavem330
authored andcommitted
tcp: Do not apply TSO segment limit to non-TSO packets
Thomas Jarosch reported IPsec TCP stalls when a PMTU event occurs. In fact the problem was completely unrelated to IPsec. The bug is also reproducible if you just disable TSO/GSO. The problem is that when the MSS goes down, existing queued packet on the TX queue that have not been transmitted yet all look like TSO packets and get treated as such. This then triggers a bug where tcp_mss_split_point tells us to generate a zero-sized packet on the TX queue. Once that happens we're screwed because the zero-sized packet can never be removed by ACKs. Fixes: 1485348 ("tcp: Apply device TSO segment limit earlier") Reported-by: Thomas Jarosch <thomas.jarosch@intra2net.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Cheers, Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c484994 commit 843925f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎net/ipv4/tcp_output.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,7 +2019,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
20192019
if (unlikely(!tcp_snd_wnd_test(tp, skb, mss_now)))
20202020
break;
20212021

2022-
if (tso_segs == 1) {
2022+
if (tso_segs == 1 || !max_segs) {
20232023
if (unlikely(!tcp_nagle_test(tp, skb, mss_now,
20242024
(tcp_skb_is_last(sk, skb) ?
20252025
nonagle : TCP_NAGLE_PUSH))))
@@ -2032,7 +2032,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
20322032
}
20332033

20342034
limit = mss_now;
2035-
if (tso_segs > 1 && !tcp_urg_mode(tp))
2035+
if (tso_segs > 1 && max_segs && !tcp_urg_mode(tp))
20362036
limit = tcp_mss_split_point(sk, skb, mss_now,
20372037
min_t(unsigned int,
20382038
cwnd_quota,

0 commit comments

Comments
 (0)