From patchwork Thu Aug 9 16:38:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuchung Cheng X-Patchwork-Id: 955729 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="qvBEVvN+"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41mYpp4xV3z9s1x for ; Fri, 10 Aug 2018 02:38:26 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732558AbeHITEF (ORCPT ); Thu, 9 Aug 2018 15:04:05 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:46658 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732458AbeHITEE (ORCPT ); Thu, 9 Aug 2018 15:04:04 -0400 Received: by mail-pf1-f193.google.com with SMTP id u24-v6so3084844pfn.13 for ; Thu, 09 Aug 2018 09:38:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=quS0Aksvvy/mnO9yPh7a1IKvoVSzlJMgKZgTs2TU9js=; b=qvBEVvN+htTNNAwpiOXv2ww6GFI7feLybaaeMlWVW5dNPRtn9J72ewxjAXUT5LQME6 Ee3f49sb4/bT0F8dDNUbGf9wgi1dAiaPX88EfgHDNFUQ87vaG9H5Vyuheq6MibOJOxlp pRWKB9brs/joya/gt0b2wglutBvaf++dSeFsx8dEQ0AC5WDeGL1te4QYdXBVSfP2Udea 9mOPFc7OMP1Yra3zzOtd9Hw4JfzuotC7wo+YYqR0X4Qwt1Wq3An2iFXyxvZ3dAM4ZK1K aK9/sMSnO63P95M2WO1mzNiA9FwOR3W54rJRb1s8DcJFMSx0/S0OlCuiiXKt/T0bXKi6 nbQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=quS0Aksvvy/mnO9yPh7a1IKvoVSzlJMgKZgTs2TU9js=; b=XCcurAY96KuQ28a1Ddr0ybig/gCUceLtQLEC+9nVLLoVIGvLopRc0GgIwXgZn/Mqii vBMN5hTAqV1XfVFeGb+9ehdBkFaNgyIUdwMSFZMXOVL5cr1LwBk/dZvidkrjLEdjSjbQ ASRhA7PWJ1Qhjx91fC5iXgqOCG3tkF5fRd73YlZakZloUPgGKLbhtA/0vGU7z7jv2g0s aRYimX0Ev0El6yle06Z9KNdiel39k1Oe5WGLZnN/XzRa8K30jBjySsSfJqkEzZprcGKA tT/8A9BoqQY1nqNAWGfIz7Iki2uXZw9EJgFJjDr+shGTUm3MNUBkocXph6DLjqds7zMm 9oSw== X-Gm-Message-State: AOUpUlHF9oNCdSf9gvcoTfl5WOucMYLj+AcMY9IeuCzUxie414wKsi4r MPTT6ADn7kw68Zc9hQJ5r+hoeQ== X-Google-Smtp-Source: AA+uWPza1yNMtNDmI2ZPFW9Ky5iOf2YAIdzGqCtgZBuzPeYoVK7XVCR0wnjDTXiWs/H0TNF3bDzrOA== X-Received: by 2002:a63:b605:: with SMTP id j5-v6mr2874261pgf.437.1533832703737; Thu, 09 Aug 2018 09:38:23 -0700 (PDT) Received: from ycheng2.svl.corp.google.com ([2620:15c:2c4:201:d660:6c0b:8a4f:4c77]) by smtp.gmail.com with ESMTPSA id m30-v6sm9741556pff.121.2018.08.09.09.38.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Aug 2018 09:38:21 -0700 (PDT) From: Yuchung Cheng To: davem@davemloft.net, edumazet@google.com Cc: netdev@vger.kernel.org, ncardwell@google.com, brakmo@fb.com, weiwan@google.com, Yuchung Cheng Subject: [PATCH net-next 3/4] tcp: always ACK immediately on hole repairs Date: Thu, 9 Aug 2018 09:38:11 -0700 Message-Id: <20180809163812.58365-4-ycheng@google.com> X-Mailer: git-send-email 2.18.0.597.ga71716f1ad-goog In-Reply-To: <20180809163812.58365-1-ycheng@google.com> References: <20180809163812.58365-1-ycheng@google.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org RFC 5681 sec 4.2: To provide feedback to senders recovering from losses, the receiver SHOULD send an immediate ACK when it receives a data segment that fills in all or part of a gap in the sequence space. When a gap is partially filled, __tcp_ack_snd_check already checks the out-of-order queue and correctly send an immediate ACK. However when a gap is fully filled, the previous implementation only resets pingpong mode which does not guarantee an immediate ACK because the quick ACK counter may be zero. This patch addresses this issue by marking the one-time immediate ACK flag instead. Signed-off-by: Yuchung Cheng Signed-off-by: Neal Cardwell Signed-off-by: Wei Wang Signed-off-by: Eric Dumazet --- net/ipv4/tcp_input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index b8849588c440..9a09ff3afef2 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -4735,11 +4735,11 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) if (!RB_EMPTY_ROOT(&tp->out_of_order_queue)) { tcp_ofo_queue(sk); - /* RFC2581. 4.2. SHOULD send immediate ACK, when + /* RFC5681. 4.2. SHOULD send immediate ACK, when * gap in queue is filled. */ if (RB_EMPTY_ROOT(&tp->out_of_order_queue)) - inet_csk(sk)->icsk_ack.pingpong = 0; + inet_csk(sk)->icsk_ack.pending |= ICSK_ACK_NOW; } if (tp->rx_opt.num_sacks)