Skip to content

Commit d8ed257

Browse files
Eric Dumazetdavem330
authored andcommitted
tcp: handle EOR and FIN conditions the same in tcp_tso_should_defer()
In commit f9bfe4e ("tcp: lack of available data can also cause TSO defer") we moved the test in tcp_tso_should_defer() for packets with a FIN flag, and we mentioned that the same would be done later for EOR flag. Both flags should be handled at the same time, after all other heuristics have been considered. They both mean that no more bytes can be added to this skb by an application. Signed-off-by: Eric Dumazet <[email protected]> Acked-by: Soheil Hassas Yeganeh <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c535293 commit d8ed257

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

net/ipv4/tcp_output.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,10 +1947,6 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb,
19471947
if ((skb != tcp_write_queue_tail(sk)) && (limit >= skb->len))
19481948
goto send_now;
19491949

1950-
/* If this packet won't get more data, do not wait. */
1951-
if (TCP_SKB_CB(skb)->eor)
1952-
goto send_now;
1953-
19541950
win_divisor = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_tso_win_divisor);
19551951
if (win_divisor) {
19561952
u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache);
@@ -1999,7 +1995,8 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb,
19991995
}
20001996

20011997
/* If this packet won't get more data, do not wait. */
2002-
if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)
1998+
if ((TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN) ||
1999+
TCP_SKB_CB(skb)->eor)
20032000
goto send_now;
20042001

20052002
return true;

0 commit comments

Comments
 (0)