From patchwork Tue Aug 13 23:25:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinicius Peixoto X-Patchwork-Id: 1972141 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wk6vk1lSXz1ygB for ; Wed, 14 Aug 2024 09:26:09 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1se0tv-00018M-Gj; Tue, 13 Aug 2024 23:26:03 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1se0tt-00017Y-OF for kernel-team@lists.ubuntu.com; Tue, 13 Aug 2024 23:26:01 +0000 Received: from mail-oa1-f71.google.com (mail-oa1-f71.google.com [209.85.160.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 88B8F3F1EE for ; Tue, 13 Aug 2024 23:26:01 +0000 (UTC) Received: by mail-oa1-f71.google.com with SMTP id 586e51a60fabf-2692799e98eso5307970fac.0 for ; Tue, 13 Aug 2024 16:26:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723591559; x=1724196359; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oDoHcpkHn9PYiUUvyaoN5RHHzXWvNOjnOBvZONjXFN4=; b=PFRaG1yxuD6b35uey50OfDQiHX4thU27PbGW3uN8MM6YL/FC9Lr0Kgxy5vqw7RW0lH Kgo3IeIFqlyWL3urcDL1a9bmBscI9flwpqR+iS7XvMUhPTu79uk4DAZOnhwMpUPzg7U2 4CZ7e0kPcak/+9TPpq2XAxDwT5FKgD0ZayZcGL7k2HFGaDkFRvGHKwF7TPVG9CxsIBlI OvSGGty7L6Bw7LxQxialbbpcSKqSzhdKbgBD9aEj4+JXMGhNXsu7bJ+nPZxvRPfmHobA Dobunm3Ye5p5tf69bZaPsDlQhOYDg5bbzDsedCshAZoW7TtVGnI2Ka6RNCBZZC9G+seI ULbA== X-Gm-Message-State: AOJu0YyTXafrmHrxkt7iO8KDmMpvoDn3MyYiMtgAHxuLhh/HTLArkNnZ qvYrfLxO6lOaxDaSnHrhiCDkbnoaS98m1g6GofNhZUcxAvmIRFsLUzDA9LxmeEGl/lmfj9Tlufb AAw6VORh2DLYS3tIxI3Tn5/QOrdHyXThazrD3CAHDMQE/71Jwwes1J8F0hy8NhKmLuth4cAtpJ5 lFhMC0Doh+aw== X-Received: by 2002:a05:6870:d29e:b0:25e:118e:ce89 with SMTP id 586e51a60fabf-26fe5a41ac4mr1398950fac.11.1723591559288; Tue, 13 Aug 2024 16:25:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4ujvuC4CGKGGlKdv79J34iNyPqMzcIsDUIsQV9PPY5fYYmdp//x2kBVn61m20H08D6LKbxQ== X-Received: by 2002:a05:6870:d29e:b0:25e:118e:ce89 with SMTP id 586e51a60fabf-26fe5a41ac4mr1398931fac.11.1723591558872; Tue, 13 Aug 2024 16:25:58 -0700 (PDT) Received: from canonical.com ([2804:1b3:a700:3d2c:2581:40a7:e5dc:ac36]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710e5a43953sm6219798b3a.127.2024.08.13.16.25.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 16:25:58 -0700 (PDT) From: Vinicius Peixoto To: kernel-team@lists.ubuntu.com Subject: [SRU][noble:linux-gcp][PATCH 1/2] tcp: derive delack_max with tcp_rto_min helper Date: Tue, 13 Aug 2024 20:25:39 -0300 Message-ID: <20240813232540.408387-2-vinicius.peixoto@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240813232540.408387-1-vinicius.peixoto@canonical.com> References: <20240813232540.408387-1-vinicius.peixoto@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Kevin Yang Rto_min now has multiple sources, ordered by preprecedence high to low: ip route option rto_min, icsk->icsk_rto_min. When derive delack_max from rto_min, we should not only use ip route option, but should use tcp_rto_min helper to get the correct rto_min. Signed-off-by: Kevin Yang Reviewed-by: Neal Cardwell Reviewed-by: Yuchung Cheng Reviewed-by: Eric Dumazet Reviewed-by: Tony Lu Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller (cherry-picked from commit 5258da376f3c51332f917087361caf4c76e9e84f) Signed-off-by: Vinicius Peixoto --- net/ipv4/tcp_output.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 02caeb7bcf63..4ea34079acfe 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -4124,16 +4124,9 @@ EXPORT_SYMBOL(tcp_connect); u32 tcp_delack_max(const struct sock *sk) { - const struct dst_entry *dst = __sk_dst_get(sk); - u32 delack_max = inet_csk(sk)->icsk_delack_max; - - if (dst && dst_metric_locked(dst, RTAX_RTO_MIN)) { - u32 rto_min = dst_metric_rtt(dst, RTAX_RTO_MIN); - u32 delack_from_rto_min = max_t(int, 1, rto_min - 1); + u32 delack_from_rto_min = max(tcp_rto_min(sk), 2) - 1; - delack_max = min_t(u32, delack_max, delack_from_rto_min); - } - return delack_max; + return min(inet_csk(sk)->icsk_delack_max, delack_from_rto_min); } /* Send out a delayed ack, the caller does the policy checking