From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: [PATCH net-next 1/3] tcp: do not try to defer skbs with eor mark (MSG_EOR) Date: Sun, 11 Nov 2018 06:41:29 -0800 Message-ID: <20181111144131.156754-2-edumazet@google.com> References: <20181111144131.156754-1-edumazet@google.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: netdev , Eric Dumazet , Soheil Hassas Yeganeh , Eric Dumazet To: "David S . Miller" Return-path: Received: from mail-pf1-f193.google.com ([209.85.210.193]:43402 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728307AbeKLAaY (ORCPT ); Sun, 11 Nov 2018 19:30:24 -0500 Received: by mail-pf1-f193.google.com with SMTP id g7-v6so3041922pfo.10 for ; Sun, 11 Nov 2018 06:41:40 -0800 (PST) In-Reply-To: <20181111144131.156754-1-edumazet@google.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 Acked-by: Soheil Hassas Yeganeh --- net/ipv4/tcp_output.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 9c34b97d365d719ff76250bc9fe7fa20495a3ed2..35feadf480300cd061411d65257f06ee658daa3c 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -1944,6 +1944,10 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb, if ((skb != tcp_write_queue_tail(sk)) && (limit >= skb->len)) goto send_now; + /* If this packet won't get more data, do not wait. */ + if (TCP_SKB_CB(skb)->eor) + goto send_now; + win_divisor = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_tso_win_divisor); if (win_divisor) { u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache); -- 2.19.1.930.g4563a0d9d0-goog