Skip to content

Commit b0de0cf

Browse files
edumazetkuba-moo
authored andcommitted
tcp: autocork: take MSG_EOR hint into consideration
tcp_should_autocork() is evaluating if it makes senses to not immediately send current skb, hoping that user space will add more payload on it by the time TCP stack reacts to upcoming TX completions. If current skb got MSG_EOR mark, then we know that no further data will be added, it is therefore futile to wait. SOF_TIMESTAMPING_TX_ACK will become a bit more accurate, if prior packets are still in qdisc/device queues. Signed-off-by: Eric Dumazet <[email protected]> Cc: Martin KaFai Lau <[email protected]> Cc: Willem de Bruijn <[email protected]> Acked-by: Soheil Hassas Yeganeh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 30c5601 commit b0de0cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv4/tcp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,8 @@ static bool tcp_should_autocork(struct sock *sk, struct sk_buff *skb,
688688
return skb->len < size_goal &&
689689
sock_net(sk)->ipv4.sysctl_tcp_autocorking &&
690690
!tcp_rtx_queue_empty(sk) &&
691-
refcount_read(&sk->sk_wmem_alloc) > skb->truesize;
691+
refcount_read(&sk->sk_wmem_alloc) > skb->truesize &&
692+
tcp_skb_can_collapse_to(skb);
692693
}
693694

694695
void tcp_push(struct sock *sk, int flags, int mss_now,

0 commit comments

Comments
 (0)