Skip to content

Commit 1c09f7d

Browse files
Eric Dumazetdavem330
authored andcommitted
tcp: do not try to defer skbs with eor mark (MSG_EOR)
Applications using MSG_EOR are giving a strong hint to TCP stack : Subsequent sendmsg() can not append more bytes to skbs having the EOR mark. Do not try to TSO defer suchs skbs, there is really no hope. Signed-off-by: Eric Dumazet <[email protected]> Acked-by: Soheil Hassas Yeganeh <[email protected]> Acked-by: Neal Cardwell <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5e13a0d commit 1c09f7d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/ipv4/tcp_output.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,6 +1944,10 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb,
19441944
if ((skb != tcp_write_queue_tail(sk)) && (limit >= skb->len))
19451945
goto send_now;
19461946

1947+
/* If this packet won't get more data, do not wait. */
1948+
if (TCP_SKB_CB(skb)->eor)
1949+
goto send_now;
1950+
19471951
win_divisor = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_tso_win_divisor);
19481952
if (win_divisor) {
19491953
u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache);

0 commit comments

Comments
 (0)