From patchwork Tue Oct 15 10:29:00 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: 13836065 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2072.outbound.protection.outlook.com [40.107.105.72]) (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 DE57D4683 for ; Tue, 15 Oct 2024 10:30:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728988220; cv=fail; b=cKdNT8bj3iprq48R95eCH3FYqUejxpa9sxsgWcrGJJRA9skcOChrTmTDeKfMVLHAfQtWJRMgr75HNWSMtBH7Dke+yOETCUZ9jAms5vrtS9iroqsm/tyEifiKfAAly7npaFh7JuS9s1YBrNKBd+fXppxTaGEu4dlQCWEsZcKu9og= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728988220; c=relaxed/simple; bh=VWfBnNyWjEH3XDaLA3UuMW35easf2rQkez0Pfq+GLhw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=GG1Tm9/2DWtHxkynIMffDxHbE7eWYMh2IT8lcfVapItFdlXkjHc0vjN//J/GqU7ip05Y3VZFZmDCmlfR9iUOlQLqNrCYtJGh3WyqwvfSLfU9c1+SWiXenVK4DWeJBCVugg0A+rQTAvlSadobwhMaAJVVC1oRrlhZF9yaUJigW54= 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=H7MqK/eM; arc=fail smtp.client-ip=40.107.105.72 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="H7MqK/eM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tioMl8G5R8I2BOoZnIR8JZPuOaQnZEgfj9pwLYcjakZICkzVKL4TAg67ZJ2EBqtjoB4/HBiXsi2k1ISLBMv8mVPg+rin6jncMus4gpB00lSs1Jj8s75Ds319m7b/S7CEHB4hOpFGCM1m/U49xJKGUPWT7r0vaDGhvtFB//Ed8eWtCv5PmKYOgWbVyhAHpuvcNzRZFKfoHvavJIWVEnmJlvoaOsGY6Ldi5bdfxx7nkrqNd9kqObYyihwt/S+mkZeYhf/iJI5VuWl3HSdH/n61JFm+50PyDubhSmHZZ7Oq85+cQjf4fTIfOeL2Yc96R1f8XIuvS026MFFCOkh+gupaRQ== 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=MMx3u4H44x+CVsqgJMWoc4rn9lSzlzPywoG4I9GWyRA=; b=Y7c/Bs6nPks2yyMIvGEI66nga+dE0UvO/2v62O7FPYOXmIACjtD8HYyAIm1oWLyRO5N1GieuUI6ebb9yjpnKgNAb+bnsYdKycNrP4bUVCUaO5bpX+KqxwVXyWbx168hZb7Bw6IW0LG2FnKnD7o/M5gtdD5mGLZbbZrFzOOErFazd/xxvY2D05r+2R5RRCxp5Hi17o5SAPURPw88b/lTHDi9s+84Jt5n/T0hHZF+/TkKnau6z+4bv5ewvWRzSBSI7q1NirbqhVHiIPa+2yNAIh77tKZkrHcCpFFzCqtxi0FK/8jY38bLKh3EzSwgGEKKeNXb6qIbmAueHGmqKPbNy5Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 131.228.6.101) smtp.rcpttodomain=nokia-bell-labs.com smtp.mailfrom=nokia-bell-labs.com; dmarc=temperror 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=MMx3u4H44x+CVsqgJMWoc4rn9lSzlzPywoG4I9GWyRA=; b=H7MqK/eMRuSVCwH04zrbO8PUNka/r2PE1bPEDM9rSHM8keJY5s3/DeoWY62VWYCFB5QMor+4gi2qquSFRGiTBkhkncQpSLZfE+5R3zkkMfAHCYgDzo0bMXSgLPft1kjDWoAQ81q0JJJxzeGRcYPJ+f2S9Z1HPhgwotwvmXUPlKeJgH32nHuhWmXCovt4gfDNCW5MX3gZGE7LgBnH41LEPTP13C2qt3l12bq3KfDmCrLGK2XROBw2y4RFIRHzm2y40MtBKcREu/3ZkBg/wI1XN1KxIQQg/VaRLo6jhVxNOE2PoSfekDYXda7GS9ZGnyM5qYbufHLBz4fucp0OH7pCUQ== Received: from AM6P194CA0080.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:8f::21) by AS8PR07MB8054.eurprd07.prod.outlook.com (2603:10a6:20b:359::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17; Tue, 15 Oct 2024 10:30:16 +0000 Received: from AMS0EPF0000019F.eurprd05.prod.outlook.com (2603:10a6:209:8f:cafe::e1) by AM6P194CA0080.outlook.office365.com (2603:10a6:209:8f::21) 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:16 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 131.228.6.101) smtp.mailfrom=nokia-bell-labs.com; dkim=none (message not signed) header.d=none;dmarc=temperror action=none header.from=nokia-bell-labs.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of nokia-bell-labs.com: DNS Timeout) Received: from fr712usmtp1.zeu.alcatel-lucent.com (131.228.6.101) by AMS0EPF0000019F.mail.protection.outlook.com (10.167.16.251) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 15 Oct 2024 10:30:14 +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 49FATtn8029578; Tue, 15 Oct 2024 10:30:14 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 04/44] tcp: use BIT() macro in include/net/tcp.h Date: Tue, 15 Oct 2024 12:29:00 +0200 Message-Id: <20241015102940.26157-5-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: AMS0EPF0000019F:EE_|AS8PR07MB8054:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c649344-a8e7-4aed-7d74-08dced045b81 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|7416014|376014|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?etNTthu6ZWHHCkXkmaL8gbGVCB4HzNK?= =?utf-8?q?lgHwl6ALy0cawBobs92Z2qcNOjEdPwg0t2/FpRu/xOqN7Ykcptvqi0SUeslsp7Idj?= =?utf-8?q?u22DZb0J1pqndTOf6dgzPo/qTxPnakP9kTNdRZI3eNSsW16weyR8UUWR9WQDki+ek?= =?utf-8?q?aItkPFZVG7ynbW0dOkt/zSH3IDwAsodum0yfsPxTblsMjiX69TdxDwGbY0cZFdfHJ?= =?utf-8?q?chdqvMD+8Jky4ljaGPjT9+wzcbE7VH52spVtQLhxnrHVZzFwMOaaYCg516hVCHIZ2?= =?utf-8?q?kmik2YWmje013uG1f/L5vf0BmJ8arESJSLf/aBd85Thns7sIwKHn/Xc+OKb6YNF7j?= =?utf-8?q?d0r+oS9PM5MxzM+1MtZs/9AO10qDKuaYF5c2lqrRSPrZkbhh9kzIwcNgS85YW8+AJ?= =?utf-8?q?31DvAJAppXcaT9GggPYdHYSJ7UuR/GutWlAuf+eDQcSA5DwwahYhHXETqGeFA638r?= =?utf-8?q?Ibs/LZvpbVIuqHJZBHwsfc9jzRdfUFoqw9K6MT0h+k9gj5WU7KIUrTHIklVziLNy4?= =?utf-8?q?OCw48yma7/M3xdwyzlLtdYmSN9tYH+DHVML4a9wx/5qXlQW1lk3ny8RZ5i0HvoXn2?= =?utf-8?q?OxaY2g7EDzLF/aWBRLF99OGd8BJDz7n0fi/qMc0fzeS7mFG37db1xfzfswHovo4vS?= =?utf-8?q?mh2QlS2K891dSDpTkE2ew24HiBgsv++0wb96OBCW2w0UU3LLbN+aOMT1tKna2j+Yt?= =?utf-8?q?G2v91m08zgOB6FP13KGAxqpxiZCqv2dO+fhnjNPMX+49rxhKh0qnDmwsimm+fJLVY?= =?utf-8?q?JbvqHVLmi0oLAOojTtyJEnkaZi+TrmK2x6OPV3xRqx15bAwykaauZMmpzC+iIpftu?= =?utf-8?q?mLcHALC9QB4FMtRg1oESSyHpeGL1LEPmA6t8ZqW0yI0RoYXK055lYrmI4QGflxk21?= =?utf-8?q?3iXjvBSk3riahTOI4hPTQzEolT7YP4hbtaY+7Z7HXl/wOKP8gXXSH9lEt2OMCHOcY?= =?utf-8?q?pOofOaARr8ysd0tNwrxpkG6F9Dj9Q1by+aTpU56ByvKlxU1mHGfn6LHw0NHrvcZkT?= =?utf-8?q?afTZDA4bVQRFkOa68F+VeJRzFHDFwXPE++0aSWldp6KiSfJx+TVCm3tniI30kaAbH?= =?utf-8?q?RDV/+cQc7bgTDMBaAoecNs22ymxtwC1iTgp/nts6NEvFsowrjx2suhY5IbdzRA3DC?= =?utf-8?q?/Gw5mHLws51Kd4km8HMtswlxjz3CsN8Pz+pQhqrc2ZHcu5+jrDhp31u0SNapvAKUl?= =?utf-8?q?dB/JxzFqX9a7Nl/y7OUAVw4V+IAF9q1e2G0Zm0033O2jSiEd3P64bTRuJwS1EjC/f?= =?utf-8?q?EhCwiWg8AqTH12rik9Iw4qdaDgsmhkTAr0LrYAohHZY25utTQLkZN1cLlc7CrsWIN?= =?utf-8?q?j5b+33bg3jXp?= 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)(36860700013)(1800799024)(7416014)(376014)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 10:30:14.9539 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c649344-a8e7-4aed-7d74-08dced045b81 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: AMS0EPF0000019F.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB8054 X-Patchwork-Delegate: kuba@kernel.org From: Chia-Yu Chang Use BIT() macro for TCP flags field and TCP congestion control flags that will be used by the congestion control algorithm. No functional changes. Signed-off-by: Chia-Yu Chang Reviewed-by: Ilpo Järvinen --- include/net/tcp.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index 739a9fb83d0c..bc34b450929c 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -911,14 +912,14 @@ static inline u32 tcp_rsk_tsval(const struct tcp_request_sock *treq) #define tcp_flag_byte(th) (((u_int8_t *)th)[13]) -#define TCPHDR_FIN 0x01 -#define TCPHDR_SYN 0x02 -#define TCPHDR_RST 0x04 -#define TCPHDR_PSH 0x08 -#define TCPHDR_ACK 0x10 -#define TCPHDR_URG 0x20 -#define TCPHDR_ECE 0x40 -#define TCPHDR_CWR 0x80 +#define TCPHDR_FIN BIT(0) +#define TCPHDR_SYN BIT(1) +#define TCPHDR_RST BIT(2) +#define TCPHDR_PSH BIT(3) +#define TCPHDR_ACK BIT(4) +#define TCPHDR_URG BIT(5) +#define TCPHDR_ECE BIT(6) +#define TCPHDR_CWR BIT(7) #define TCPHDR_SYN_ECN (TCPHDR_SYN | TCPHDR_ECE | TCPHDR_CWR) @@ -1107,9 +1108,9 @@ enum tcp_ca_ack_event_flags { #define TCP_CA_UNSPEC 0 /* Algorithm can be set on socket without CAP_NET_ADMIN privileges */ -#define TCP_CONG_NON_RESTRICTED 0x1 +#define TCP_CONG_NON_RESTRICTED BIT(0) /* Requires ECN/ECT set on all packets */ -#define TCP_CONG_NEEDS_ECN 0x2 +#define TCP_CONG_NEEDS_ECN BIT(1) #define TCP_CONG_MASK (TCP_CONG_NON_RESTRICTED | TCP_CONG_NEEDS_ECN) union tcp_cc_info;