From patchwork Fri Mar 16 17:51:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousuk Seung X-Patchwork-Id: 887067 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@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="Vh1GXXdS"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 402tLz5ffdz9sNq for ; Sat, 17 Mar 2018 04:51:55 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751372AbeCPRvx (ORCPT ); Fri, 16 Mar 2018 13:51:53 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:39722 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750757AbeCPRvw (ORCPT ); Fri, 16 Mar 2018 13:51:52 -0400 Received: by mail-pf0-f193.google.com with SMTP id u5so4429087pfh.6 for ; Fri, 16 Mar 2018 10:51:52 -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; bh=KocyQX15I9VQ1Ed0+jSpERRQ+q/EPWPnz9BOQWqYfMI=; b=Vh1GXXdSg16dlMQrQXzCaXGosW+EgKJkPpKOHnOxNMjgqQ/o/XICdnM1uop2zvWnYK G90IXwHrAf5DRDRocgfBeU/9G1Ww3rqZl27+TS79EDB5epc9U1DOqsQegm4fYe/3+lot a9Fg6qeD+sDbsoT7ww2CmAax8gg7jNBOcuyziiq8DtvCzS5uXW8r5fS2P+SOZarBR+SA FfFIeqlUmmP49Ig0gVLFQpOlmFP+JqqL2obIRpmUD0IycTqIV1FSiMoStBxcDazgVFL1 0g+u1S1kIzEWx7YpoEQPotjbWGFhHVDhNAwwy0jsefPKlL0XWGSO5ZkpCwfOmh2ifoIQ SYTA== 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; bh=KocyQX15I9VQ1Ed0+jSpERRQ+q/EPWPnz9BOQWqYfMI=; b=JSsGp5e1M65hbxccWC4iR9ON52k+CqCU9wjBGvlTc/JUdBiTnKl7kwNZuM8QjBDzoC 4EOgNDSvQR5fEOMr1REqdM0x8COf8UpSO7PuKTHrbYu51S/yK1a9rl6bnNN4e6mvxxFU TgOTs5jgkpbDW6Vubvgi9+OIJGCASSQRikv06P4zJHAOshhLxULqGGZ+fmfD7NjboWAa DhNSij/K4P2hpvPMBwFctGb2AyzK0jmQ6kZsCtuFHFtm5z4FhiHjE7QHpmahjtwZzjRb s30aTsy3byQSA00QpGVjMD/QUiZPFZk6dNFkUcXURW9MrZBdhnJtxn9fMcL4Al4alQl4 A0fg== X-Gm-Message-State: AElRT7EzQ+DPlMtj+kvdGmg49yY9PC+vfPfjMMxpHGLUhzEWg9BFW5w7 j0Ti5zeX4a5+kC0J3u7dvVLfXA== X-Google-Smtp-Source: AG47ELu9wDqhdczC2xNSiOStHnQa6dBX9PqdTXp8jghTucUBzT7Sv2NnCM4qL+QTnpC1Anfyq7dCJA== X-Received: by 10.101.97.139 with SMTP id c11mr2104949pgv.443.1521222712037; Fri, 16 Mar 2018 10:51:52 -0700 (PDT) Received: from ysseung.svl.corp.google.com ([2620:15c:2c4:201:47c8:2bc4:30f4:c8]) by smtp.gmail.com with ESMTPSA id u27sm16611018pfk.172.2018.03.16.10.51.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Mar 2018 10:51:51 -0700 (PDT) From: Yousuk Seung To: David Miller Cc: netdev@vger.kernel.org, Yousuk Seung , Neal Cardwell , Priyaranjan Jha , Soheil Hassas Yeganeh , Yuchung Cheng Subject: [PATCH net-next 2/2] net-tcp_bbr: set tp->snd_ssthresh to BDP upon STARTUP exit Date: Fri, 16 Mar 2018 10:51:49 -0700 Message-Id: <20180316175149.224421-1-ysseung@google.com> X-Mailer: git-send-email 2.16.2.804.g6dcf76e118-goog Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Set tp->snd_ssthresh to BDP upon STARTUP exit. This allows us to check if a BBR flow exited STARTUP and the BDP at the time of STARTUP exit with SCM_TIMESTAMPING_OPT_STATS. Since BBR does not use snd_ssthresh this fix has no impact on BBR's behavior. Signed-off-by: Yousuk Seung Signed-off-by: Neal Cardwell Signed-off-by: Priyaranjan Jha Signed-off-by: Soheil Hassas Yeganeh Signed-off-by: Yuchung Cheng Reviewed-by: Eric Dumazet --- net/ipv4/tcp_bbr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c index c92014cb1e16..158d105e76da 100644 --- a/net/ipv4/tcp_bbr.c +++ b/net/ipv4/tcp_bbr.c @@ -731,6 +731,8 @@ static void bbr_check_drain(struct sock *sk, const struct rate_sample *rs) bbr->mode = BBR_DRAIN; /* drain queue we created */ bbr->pacing_gain = bbr_drain_gain; /* pace slow to drain */ bbr->cwnd_gain = bbr_high_gain; /* maintain cwnd */ + tcp_sk(sk)->snd_ssthresh = + bbr_target_cwnd(sk, bbr_max_bw(sk), BBR_UNIT); } /* fall through to check if in-flight is already small: */ if (bbr->mode == BBR_DRAIN && tcp_packets_in_flight(tcp_sk(sk)) <= @@ -834,6 +836,7 @@ static void bbr_init(struct sock *sk) struct bbr *bbr = inet_csk_ca(sk); bbr->prior_cwnd = 0; + tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; bbr->rtt_cnt = 0; bbr->next_rtt_delivered = 0; bbr->prev_ca_state = TCP_CA_Open; @@ -886,7 +889,7 @@ static u32 bbr_undo_cwnd(struct sock *sk) static u32 bbr_ssthresh(struct sock *sk) { bbr_save_cwnd(sk); - return TCP_INFINITE_SSTHRESH; /* BBR does not use ssthresh */ + return tcp_sk(sk)->snd_ssthresh; } static size_t bbr_get_info(struct sock *sk, u32 ext, int *attr,