From patchwork Fri Jul 14 21:49:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neal Cardwell X-Patchwork-Id: 788819 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3x8RDq2hSvz9sNd for ; Sat, 15 Jul 2017 07:50:03 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="Qx85A1sO"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751185AbdGNVtt (ORCPT ); Fri, 14 Jul 2017 17:49:49 -0400 Received: from mail-qk0-f182.google.com ([209.85.220.182]:33471 "EHLO mail-qk0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751124AbdGNVtr (ORCPT ); Fri, 14 Jul 2017 17:49:47 -0400 Received: by mail-qk0-f182.google.com with SMTP id a66so71982990qkb.0 for ; Fri, 14 Jul 2017 14:49:47 -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; bh=HPVn3cN+gEBotR3660Ph62f7qpayIOqw/oz2nt5J63o=; b=Qx85A1sOhNlvx7R5enxK0fE31lDWrOsgQAWh/pKB7Ze6iEFrKHgjnk+5ZpQGmD8QZR OhxxPPj5BwxKYJpygSFCscqGEG/olhox+mlwO041U5za6mcybcT92mQuOcTnnWfkSiae CEdiHFzQNk1V9lxphKBRnssM0hw660rDdROLfBJpm7xkg6Mm8EfSa/vGnCjYJcXvI/zw NNfJXzTVqpiz500tCM1Gs/4shbWdKGdCpDpPLYm7Cyxl66M3rbwsnvy3dFEc3lxZGIxo 6J4Ot2Kg6RVqwizA0iobkHIzC4cOWN+qIn6wzqwcuo0uMVZwXHSFOC7rNDNAqzMvmChg h8ng== 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; bh=HPVn3cN+gEBotR3660Ph62f7qpayIOqw/oz2nt5J63o=; b=De1HJhReLnnn9d13+YzA/ghFUpd3wq1m1kNrbJWDbt6+4ljxtIvParbGY+qhbdzU/O dVuBXvIMK7M3hOObOPFRWHTpjZ+7wiU+b/rebCev0PDH5gtXISBN5TxBUHfH6sTsNTM3 pYd5A3tfePdQzmlFG+MWLQTHMOD1Jemtd/1P/THrsKrx0yEuK4+WLIVul5rNrZf0pvYU 0rAMM5qXQ86wBzhSxyublqp9DqGWKkiFSO6OK/XgWNcwlWKBxylDJOrPi7ZNV61S7SCF 7D+TSxbGgomh3TdX4OFoyiv51hD/LFamIq71Im+JbCX+mG86wtUqB518IH9i3p9Si1cr HqHQ== X-Gm-Message-State: AIVw1114rhp1FL7sIJG+qVyqA25mtSLXTbAf1+2zLq+3YnYUUXgmWFqD 2cNyeYNx1aKujnAx X-Received: by 10.55.123.131 with SMTP id w125mr14364531qkc.177.1500068986411; Fri, 14 Jul 2017 14:49:46 -0700 (PDT) Received: from joy.nyc.corp.google.com ([100.101.212.71]) by smtp.gmail.com with ESMTPSA id f124sm6940655qkj.57.2017.07.14.14.49.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Jul 2017 14:49:45 -0700 (PDT) From: Neal Cardwell To: David Miller Cc: netdev@vger.kernel.org, Neal Cardwell , Yuchung Cheng , Soheil Hassas Yeganeh Subject: [PATCH net 4/5] tcp_bbr: remove sk_pacing_rate=0 transient during init Date: Fri, 14 Jul 2017 17:49:24 -0400 Message-Id: <20170714214925.30720-4-ncardwell@google.com> X-Mailer: git-send-email 2.13.2.932.g7449e964c-goog In-Reply-To: <20170714214925.30720-1-ncardwell@google.com> References: <20170714214925.30720-1-ncardwell@google.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fix a corner case noticed by Eric Dumazet, where BBR's setting sk->sk_pacing_rate to 0 during initialization could theoretically cause packets in the sending host to hang if there were packets "in flight" in the pacing infrastructure at the time the BBR congestion control state is initialized. This could occur if the pacing infrastructure happened to race with bbr_init() in a way such that the pacer read the 0 rather than the immediately following non-zero pacing rate. Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control") Reported-by: Eric Dumazet Signed-off-by: Neal Cardwell Signed-off-by: Yuchung Cheng Signed-off-by: Soheil Hassas Yeganeh --- net/ipv4/tcp_bbr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c index 3276140c2506..42e0017f2ebc 100644 --- a/net/ipv4/tcp_bbr.c +++ b/net/ipv4/tcp_bbr.c @@ -837,7 +837,6 @@ static void bbr_init(struct sock *sk) minmax_reset(&bbr->bw, bbr->rtt_cnt, 0); /* init max bw to 0 */ - sk->sk_pacing_rate = 0; /* force an update of sk_pacing_rate */ bbr_init_pacing_rate_from_rtt(sk); bbr->restore_cwnd = 0;