From patchwork Fri Oct 18 23:20:06 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: 13842495 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2042.outbound.protection.outlook.com [40.107.247.42]) (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 A01731917E6 for ; Fri, 18 Oct 2024 23:20:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293631; cv=fail; b=BhHs9IBZPhn7splAX6LyaI5tDtBPR1puzRD+KUTks8x5NmY5mQ1qhZokpB778KBrIcKvZYf1sTGR3gUlYKSzQuop9JnewB5nusx/pdKp/tZfleOMaY8CTVBewtf4GoDA5zEuW+9MXPMAXzPL8qwCQ6kH2OrT1YY3sWkMSxuCFI8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293631; c=relaxed/simple; bh=VWfBnNyWjEH3XDaLA3UuMW35easf2rQkez0Pfq+GLhw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=pqyh5dWyRDBilncNJgy7mQooJJyJtQqr7T38ANFcSx16UIGlgKfGUbh3E/tgQRckfwNcJ0d8K96FUHtWY77nurT85ed082KlKYnZ5Q+vbmmBYpcFPdJY9yKni2alfouuk3PghxrFrbfrTwh4s4E5tdYb/hf8Kf1rYI5sIjspudM= 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=P4wCUGkG; arc=fail smtp.client-ip=40.107.247.42 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="P4wCUGkG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JfWENAFU+4zaujOsqFIOZ54pQx7xxbFAbCE8q8ompQFaJVES5ZHGqJJk8nAl9cueiAwufI7amtM3x4+wEFK+hRU6TmOdt8hqSgkHDMNwVKFc2fS/M1j+wOGffEGmKcW16OzBXum3+LcMb4YddApBXefWwjORRvVOt/EAHfV64KAw1f0Ip09QoDkQRDIPKcAaXCpfWBbr7YFmOoDI8z/cYqOpRZOPWmkmJAO6BET46kWvy5wQP71xgzqP2cQaQ+eI0S63KNIhfS+iCaau0xD8wkEdoeeHtsUfN3z+EBzVjTVvv6NQUo0ZsLdE52DdMEBN0vBrfF9PypTCj3cUS/XYFQ== 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=h6BP2DRoGg8neBEpSXHtOYbDwuYcPs8fOTyU/up/H/KzSilZTj2OGVYikDhTM/lCOwms8e3KRIHtMrNt30+nrk904juJqSUJLGt8+92CTdzwBq+zicLmgMYqWfwhcaUe49Kdn7M4RZvOHS5wMHdnoEczkKPDazm3SLerLwKeoQIrPJXsNZ93E97S7TzThIFXmKfZjQR50ERzMV3rcoYsQ3DCGGaYIHYl/G3ZSMZ5PJzM6U5I+AiYKGqHQutMDZxKg4Yu3jqP4rOmjY93Y+Vc3k1XpIilnk7sUh/iEsvRdCj6agh6EOGHyfPrJH5769S73rOEPd2zqOzVKdleMDZ7ig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 131.228.6.100) 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=MMx3u4H44x+CVsqgJMWoc4rn9lSzlzPywoG4I9GWyRA=; b=P4wCUGkGOcTzcdjPleHECwq6fZDtZ8YqdJ2EJCFd7wjrMwMVcl9tY63adOcwWz7aLrwiEam6KhkmsSmV0HNKfkRnQMaUjUg3oidbKFzkeVpVD8CSv/nj5caftOAbeKYH6hdjo5HTi1OxAxgCOyULpD1Bayk/XbcGqLAkSeukwKUZcqwzmZHm8q5yVqB/p+woXE56pe7TGRJua5eNwHmIINwkJWZmzEdaEt3aSAU6M7P2tffe7c4WMVBvKuV+BJOpS9rY/UL/0QLqAe8oKVGrnkJWFOFGLH9JRmFf4VDqoh6Qdw2Sm8AFUwaC2jqP7rMhmI5LCH/JBuEFJ+Far/tkFw== Received: from AM0PR02CA0217.eurprd02.prod.outlook.com (2603:10a6:20b:28f::24) by DU0PR07MB9316.eurprd07.prod.outlook.com (2603:10a6:10:44b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18; Fri, 18 Oct 2024 23:20:26 +0000 Received: from AM4PEPF00025F99.EURPRD83.prod.outlook.com (2603:10a6:20b:28f:cafe::b9) by AM0PR02CA0217.outlook.office365.com (2603:10a6:20b:28f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23 via Frontend Transport; Fri, 18 Oct 2024 23:20:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 131.228.6.100) 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.100 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.6.100; helo=fr711usmtp2.zeu.alcatel-lucent.com; pr=C Received: from fr711usmtp2.zeu.alcatel-lucent.com (131.228.6.100) by AM4PEPF00025F99.mail.protection.outlook.com (10.167.16.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.2 via Frontend Transport; Fri, 18 Oct 2024 23:20:26 +0000 Received: from sarah.nbl.nsn-rdnet.net (sarah.nbl.nsn-rdnet.net [10.0.73.150]) by fr711usmtp2.zeu.alcatel-lucent.com (GMO) with ESMTP id 49INKJJS010239; Fri, 18 Oct 2024 23:20:24 GMT From: chia-yu.chang@nokia-bell-labs.com To: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, dsahern@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 v3 net-next 03/14] tcp: use BIT() macro in include/net/tcp.h Date: Sat, 19 Oct 2024 01:20:06 +0200 Message-Id: <20241018232017.46833-4-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018232017.46833-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018232017.46833-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: AM4PEPF00025F99:EE_|DU0PR07MB9316:EE_ X-MS-Office365-Filtering-Correlation-Id: 08833ebe-b08e-4971-8124-08dcefcb72b7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|7416014|376014|36860700013|1800799024|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?xF9RxnLw/eyc4otD5upBLSBUKPGqjIo?= =?utf-8?q?t+e2uoY9AawYLvo5ogZ09eHG+9bp66v5A82kLpwnRSLzNFJmWyRa4FKsot5rjCvER?= =?utf-8?q?q/oglqQP/b8hHOKvb/cDYBzWCWW3EXcxz6tKgIHgRiyBlBUVzR5m/lhHly2DZH7J0?= =?utf-8?q?RrO4RVjHbgk7LJl4vfNueac2v8F/uWO5YOun+p39A7KGjibYswLEtj3pJH9CkckPO?= =?utf-8?q?c6ZE2nYRFZcXomVQ283Szip0xTwKabk6/L+32gXOYOI9XDCKWqUYdfr6CyrbNuyvm?= =?utf-8?q?y/D3CGCMqpEOkvnZC5AaYQHeq2yW7boWtQt6RKr8r8KGJ3/s8T1t8mWIPYIIBfEQ4?= =?utf-8?q?ijuwaCyyZXNXHRUV5UvUqlRQ6tSs/upOREJb6SomKLQmKlRQtc+e1KjI5kqVYglaH?= =?utf-8?q?ed8lU2E5Zc4WpI+D8ST+ructkD1ydaA02esmdadCS6dZMYxKL+WQ3/xcBGof2pChw?= =?utf-8?q?p+drhH5AtG9rJh9L5aQikkgB+e/HhZVhv2SpOy+d6UdwpzTg50QhAhMAKdw10m1zS?= =?utf-8?q?jkH2D0NXK62FaDwzhhc8OghCpsi1H1+bGcwBGIa4Ztm4z+CBwguOgPzhcn4E90ND2?= =?utf-8?q?TpSKx5MFYaBZh2X4s/VKWQYu/P2ovIdshifriPr+LU2dPjQmjRmNcBA+QBs3hJz3T?= =?utf-8?q?6Gged1ggPaDybWxI2WvBtHe65Datw/Uud0F/7rn40dSfe9XjcgGUGZFD96wPuXmzv?= =?utf-8?q?kVFumOf7DVJM1w1mGIKt37P6CvM49iR4AEg3LDJhk2fcFTHphHRe9NZayrPo7ry7/?= =?utf-8?q?8Mt3CsOdjJiZhhD13GJi/qllBpUwFOqWl/KWAGvyMKigbfzP0d1WXBDfPbEZmBVTD?= =?utf-8?q?rqpowbTv3nKjNaMkD+vlHOI3ZGHGFl8TWzAMotH7i1BqG4GPVAboFmbaac4cF5XvZ?= =?utf-8?q?oCegZ/hBGC7VFl8SNEWJCQqC4e6GAC4m1M7kImOxrcI43uKcwPgzwSIuDE41U7VGk?= =?utf-8?q?HpCupU07WpynEcT9RvWdPouyX/VyIc4wAUdftW37a7NoHu2H50Qibn8sRelmtXxsY?= =?utf-8?q?r72BRKiht0hxV/ThCqHMvH4lt1IrLMkBxbcYo0828QYC/2D5HHnuG15Edp7O1DLQI?= =?utf-8?q?FUzhW/JNMIic5aO/LlBgqZBVW7drXO699edIHPaj2v9FRxeT8ETK4HxMPr+r4JkBi?= =?utf-8?q?948el0574JgCTyYIxMmX4J576Uw3JjflYDayRHBQfrQu1c5M9yyIUAWdNg9GVpV9Z?= =?utf-8?q?zZC/7n9j4oBehvSPVuVqa5dIm367ASdvIQ8OaDi4VQOC3dpX5/acqBWutx1/sCg+S?= =?utf-8?q?W4CqeNjGiUGXZfWZv7Vo9Pv1eoEFQsUtJVIlh/7dTchs+jsEz5zhUnI6y+ZdMQYgX?= =?utf-8?q?fxl1+odLhujI?= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.zeu.alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(7416014)(376014)(36860700013)(1800799024)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 23:20:26.0702 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 08833ebe-b08e-4971-8124-08dcefcb72b7 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.100];Helo=[fr711usmtp2.zeu.alcatel-lucent.com] X-MS-Exchange-CrossTenant-AuthSource: AM4PEPF00025F99.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB9316 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;