From patchwork Tue Oct 15 10:29:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Chia-Yu Chang (Nokia)" X-Patchwork-Id: 13836089 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2041.outbound.protection.outlook.com [40.107.22.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBFC41EF0A2 for ; Tue, 15 Oct 2024 10:30:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728988234; cv=fail; b=KHDwmPOKLWXHZcKa03gZtkJ85KEMEXlwtk8/mpQ1+4cdqBJG+n3wr7Lu4wp0Aw0nr5DBVS65ZgRrMg0o68+thuW0efIjT+jFgwGPcnQDvlQvlL7L5jbt6DTgClyVzO0u6XckDz4zxZUk79JFzvWjQCRpahRx3njUHmkBfIQSgZ4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728988234; c=relaxed/simple; bh=pUaHhC59Cj4Z0dvaLCB5XW/N+Y4wfCBDFoLnGSC8I1I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=fUBrb81TMJRbkMF14YcOkk1x3qvJoQrYO3oGgRcpe/SeGlB4AC6ZFmO7KWQw6toSbNARVTkmaN5WZHhslqU9lJ6CSCpJLqOa4TqOSP/lJdTq0w2xPi3JMdndpVLuCw8ZQx2JeP82gEXKx4mNEdgEKPK2foakDRWq5S+WFWOXLfI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nokia-bell-labs.com; spf=fail smtp.mailfrom=nokia-bell-labs.com; dkim=pass (2048-bit key) header.d=nokia-bell-labs.com header.i=@nokia-bell-labs.com header.b=a55IT0nX; arc=fail smtp.client-ip=40.107.22.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nokia-bell-labs.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nokia-bell-labs.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nokia-bell-labs.com header.i=@nokia-bell-labs.com header.b="a55IT0nX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dAMHAu3rcgq5NzHeY8rrhv/GYVJBkeg81yS2nFZ5RhSyG5Z65PE5xkZYfqJLIod0lZPMan2EAx0bi7ZXJhFpwht1DzjbXHuEzd7HZEfXIK5suvKUKVf03yNgvGzXhaKwyROZTZPMQZjiJEEatLOr2B6VLi8OZM4flep7HT6C99T6ptr7PqmG0yUUnmoegFIZUmD5nPKB9mrYRxqE521jGNxkNsepUTxa/3CfroFClTBRh9OXYDVPRMTvgNhR0iuegqYf3mF2ED399pKd1EZRFVMPRCq4j1+Rgh25uN+wFZUz81SFJ2IQEWopgsBa4Fd5JghwdvKJWj8vxrHiF8cTPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zDNh7T6Ap1f/pvurbbNlCmXyYPjaNfCvCL6bLAYthcs=; b=qk2tqRL8gL1V13RhLfXEKuYgA7LZUjoLit9y0+yvEREOxX8TGKla29W1MeVZOMj0JustxBKM+OHVVYioYcg5Yd9vHjImtiy9F0XFEDf6trLSHOjJqMxvM1Y0fqXo9i1zdYN/B/5DDI/ybLx1cIUOsydDSX1abyhl/Hd9Fcwo8s0vzet9rrF4fACmieKIJLn1X+t38QahB03PARK7N7aNuZX1qfsIe9UkH4FfmR6skEPv/XRaeAfakR/F9PuSLe9kYR2Bv/ueAKe5YIZfmnjvc239aCTqhMg+lW2sXKs2T/Jh1guzR5/L6rjhQxD2WBiCApSs/IfR85VT72SQoH3HzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 131.228.6.101) smtp.rcpttodomain=nokia-bell-labs.com smtp.mailfrom=nokia-bell-labs.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nokia-bell-labs.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia-bell-labs.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zDNh7T6Ap1f/pvurbbNlCmXyYPjaNfCvCL6bLAYthcs=; b=a55IT0nXVYxRVixe9Lu3gzH1B4xOPr2z/Z+IB1wRUhR6ao+UtBQuC1O2crFscCNEjyEB4FUkSw7+Ci+CCOArO1aQpXi1Ql9TYzqbxRWmRmEBnSk2RwIlj/CdZ6ybAIWut8YXYp9ERYj874aAXxgXGEsH8YD/BkmM0c+3FnLffAsSYF0cU4b00VH/DB08Na1KIH9SRZcIk/Odw9UnIQj+wXiMdhBRa5efT9bjrNkChEwZUw9lXA+GK5MUfPSuW9rtDFlFddGqV+q+79V2+lYbiyTh3p5uuCIYHoiYhwxg8YWWI49ZTnhVJxLVq1v3i7x6gHDn40ST/p484rO7crEGTA== Received: from DU2PR04CA0292.eurprd04.prod.outlook.com (2603:10a6:10:28c::27) by DB9PR07MB9391.eurprd07.prod.outlook.com (2603:10a6:10:461::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Tue, 15 Oct 2024 10:30:28 +0000 Received: from DB5PEPF00014B92.eurprd02.prod.outlook.com (2603:10a6:10:28c:cafe::3c) by DU2PR04CA0292.outlook.office365.com (2603:10a6:10:28c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27 via Frontend Transport; Tue, 15 Oct 2024 10:30:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 131.228.6.101) smtp.mailfrom=nokia-bell-labs.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nokia-bell-labs.com; Received-SPF: Pass (protection.outlook.com: domain of nokia-bell-labs.com designates 131.228.6.101 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.6.101; helo=fr712usmtp1.zeu.alcatel-lucent.com; pr=C Received: from fr712usmtp1.zeu.alcatel-lucent.com (131.228.6.101) by DB5PEPF00014B92.mail.protection.outlook.com (10.167.8.230) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17 via Frontend Transport; Tue, 15 Oct 2024 10:30:28 +0000 Received: from sarah.nbl.nsn-rdnet.net (sarah.nbl.nsn-rdnet.net [10.0.73.150]) by fr712usmtp1.zeu.alcatel-lucent.com (GMO) with ESMTP id 49FATtnV029578; Tue, 15 Oct 2024 10:30:27 GMT From: chia-yu.chang@nokia-bell-labs.com To: netdev@vger.kernel.org, ij@kernel.org, ncardwell@google.com, koen.de_schepper@nokia-bell-labs.com, g.white@CableLabs.com, ingemar.s.johansson@ericsson.com, mirja.kuehlewind@ericsson.com, cheshire@apple.com, rs.ietf@gmx.at, Jason_Livingood@comcast.com, vidhi_goel@apple.com Cc: Chia-Yu Chang Subject: [PATCH net-next 27/44] tcp: accecn: try to fit AccECN option with SACK Date: Tue, 15 Oct 2024 12:29:23 +0200 Message-Id: <20241015102940.26157-28-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015102940.26157-1-chia-yu.chang@nokia-bell-labs.com> References: <20241015102940.26157-1-chia-yu.chang@nokia-bell-labs.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB5PEPF00014B92:EE_|DB9PR07MB9391:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f3738c9-f5f9-4cd7-c429-08dced046379 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|82310400026|36860700013|1800799024|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?rjbwQP5Kid0uBZ30763roextQOb3cPM?= =?utf-8?q?2gxlyambFwio0Cx8shBIlHpT0MY8zRvJo5+dw2oUnrQ/lxLw5rvabmgDu3P6onjh5?= =?utf-8?q?QXIiBi7rgTZWmFSEV4csS3RsLfe96GwOBpU2dHzZ4c2ENPyFmNmyg1PQSFvZBN4IK?= =?utf-8?q?gL9BDjaSqycOnyj/29sv+BcrIRSUpEZ8utlmDPxvgOqSX65lX9XqW+aijf5jbYpBM?= =?utf-8?q?pAYpyqnwFcwCLiw/lbU/ihAvR23x8A6eXigANYjhjiHLfBiUZ5Gf5zm99YqSJw17v?= =?utf-8?q?QoWglKxg4pDTZORCrQjZ9GuZ0n559gVh8MfM7OAUmaLLPGXPyybPDUMZh+H27HF52?= =?utf-8?q?JsxEBFRt084HtcmJvJsLA27+DuhKgsuBFuqTbTU0s2R6LYaucyTy2Cpl/m5UQeWFI?= =?utf-8?q?0kfTRYPwJ7+7uGUYwK1gfRaOQ4WCSjBW0AkOh7CsBsDMcuFXNnzYstVh2ZvJpzruU?= =?utf-8?q?swcBl46bxyG+V4rRU7flM0KAuQ7k7d19DIKkJiGzdSxmx6jLPRPyK2BpFIqRVevyM?= =?utf-8?q?pw/+6cV9nub4xOqqwUIPcGvEABDmrN0R4onwPsgKkHofKpzLYLiR1dcRJaUEm7fzV?= =?utf-8?q?Gg9nNNT/EJfNdU+mQ4uYVcUQm2Krf2gTEM+4vT/YNBWdGAKQvHliqka5mzgvhxKZa?= =?utf-8?q?5omt5bgz2bYkTBomwafvY3ikiTpnXMy5TIob+NQjjbHHdjpcQSGh6RTIIc+TF3UKv?= =?utf-8?q?MsJ3E+hWIuqtxrgmBMZnCRByPQ1YoRaSNdvpj4aE3+t9yWMhLriR54jwlVAT28dGP?= =?utf-8?q?5DfhN7747on4JqV8hb6CMMC+00qkkv3Y+kk0Wxlw33n30oial2g3AsvZE3ou8Omri?= =?utf-8?q?JkI+7pCSo2lqHvZ0AMuMFz4RuW1LzevSdxSEcRkqD8mfsbWBuuuFMjUSov3WCLWjn?= =?utf-8?q?IOKS2omQkvaW0knNedOVRo24DsCKrXGlGXEaUk+/1TpyMbZgtpc7Trr9CJR/YjK08?= =?utf-8?q?wgCcZZhfKwpVxDB+srRPwqN4xCJUSJi4erkVIJgj1EiJnSyB2dzg9kSXTiD3AOrps?= =?utf-8?q?ZFHGuoApItOwxEtTqk8BL1rY1ECK42gyMk78P9wHYeHJ/BU3KEf3K+VxaBGv/V8FO?= =?utf-8?q?MfB3qFppl3CnMcjrqtpjx23hrMPRcx2i3wrDPq8h3BkwK1w0KlsyDfo+0cmLeV3XX?= =?utf-8?q?cjHIbS68qGfCV17Nv17VnaYLqS6pDxBUIK2/nWbhlob5dctl4SB+hx18N0dkVJQ+Y?= =?utf-8?q?VU2Hst4zrTRL0oa45zedbFtik8MAY5QXnl+Cznh8O85dnTYJK9LunJcuRsL2wHdwT?= =?utf-8?q?u4JxTZHE1Hv9LQ/1cvSmMq156ohweNBCYW4EzCkIMlC2J8YphSjQ9CY65WQTBqqJF?= =?utf-8?q?qlDczyYGKwRT?= X-Forefront-Antispam-Report: CIP:131.228.6.101;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr712usmtp1.zeu.alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(7416014)(376014)(82310400026)(36860700013)(1800799024)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 10:30:28.2625 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2f3738c9-f5f9-4cd7-c429-08dced046379 X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0;Ip=[131.228.6.101];Helo=[fr712usmtp1.zeu.alcatel-lucent.com] X-MS-Exchange-CrossTenant-AuthSource: DB5PEPF00014B92.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR07MB9391 X-Patchwork-Delegate: kuba@kernel.org From: Ilpo Järvinen As SACK blocks tend to eat all option space when there are many holes, it is useful to compromise on sending many SACK blocks in every ACK and try to fit AccECN option there by reduction the number of SACK blocks. But never go below two SACK blocks because of AccECN option. As AccECN option is often not put to every ACK, the space hijack is usually only temporary. Signed-off-by: Ilpo Järvinen Signed-off-by: Chia-Yu Chang --- net/ipv4/tcp_output.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index ee23b08bd750..663cdea1b87b 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -968,8 +968,20 @@ static int tcp_options_fit_accecn(struct tcp_out_options *opts, int required, opts->num_accecn_fields--; size -= TCPOLEN_ACCECN_PERFIELD; } - if (opts->num_accecn_fields < required) + if (opts->num_accecn_fields < required) { + if (opts->num_sack_blocks > 2) { + /* Try to fit the option by removing one SACK block */ + opts->num_sack_blocks--; + size = tcp_options_fit_accecn(opts, required, + remaining + TCPOLEN_SACK_PERBLOCK, + max_combine_saving); + if (opts->options & OPTION_ACCECN) + return size - TCPOLEN_SACK_PERBLOCK; + + opts->num_sack_blocks++; + } return 0; + } opts->options |= OPTION_ACCECN; return size;