From patchwork Tue Mar 18 00:26:59 2025 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: 14020092 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2089.outbound.protection.outlook.com [40.107.22.89]) (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 68474381AF; Tue, 18 Mar 2025 00:27:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742257677; cv=fail; b=jwbS/7pNVGF+mCEbEItgtKiHG5eYic5Zq3iDFAq6nSnvsS2zN4G5LuPOFLdO5v1RP8mC5c7gYV89ZAJ8jwzJuLMbz/gmKnKhZgGWoHlShQ5sn3zTOVlOac9MVzjwQddqIrLc0ZOXAhX4uqJMRp1ecIMRve/LjM5wRvFIoOVbZU4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742257677; c=relaxed/simple; bh=pSlO/wT+zwQpxMsveSgD5QpwZqxSJPoTbBK9fdRZmes=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=We1vBSeLuxSVkBkE5mJf3vxzMk21TGVFbCny3W7DzWTDxsIXyJntdav0Df6Ponqaw0XO9IwSYCJJ9+EYyWuCfMns6xOxs06QJOzu63nSkUpXTEh1Dsn90S8RGTnBnFyh0TxsUAm4BHD0yHnc5kROy6EkDGeoFMjuYh8rORpn7fQ= 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=lITJo6gP; arc=fail smtp.client-ip=40.107.22.89 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="lITJo6gP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YgoZ1FVSPBuJnwXcpEpyArI6Z8nf0Yw6R/KwPgp23FeLRnjoONfhJNf6McWmAWsK/oq25jzMRraACkreTOaw5EXg+zbkDx0bm2NmqgrXmHCZ0fg11sluayrZIa0KFRl6hVLthzjOEzMCKS3C2tJGrgis03hyyNjL/Np6EiGDWnFBDLeh+EK3ict8qJY5D+CbywX2daJdePV5JksQHHkQnj5AYTmKrkP2CU6lTvu9XpFOn0sg5FdoFmeJBDcNZ+dUuBf/lLTHPicsqHN+ID08IvjuP3rLe40Ck3EbdCclr9kjZ4Am+e92D9BHGdUfQ+Ht70c0KfIkyzYo8Fkv9ODtkg== 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=jbF9Z5AttEUa36DqFVoF0RSc0xJM23wjMzYufsdhZiM=; b=yliVPJn4Zt0YcYjf8R4ZXxjTni8194uHf32snAh3slonZ9XgduW77AR3GKeof23Ivl/B7OdQOORjYIfCLrcJnM3sUVDzC+P6VqcHcI7kMhu60cYLan9MYjzyvliq0VUI/2KIp4Pi6oWv7rYHlqxrSlvzZxSTVnCqpYYmo+WRuoWJqmnl63Ddg6NJWvHUPdwIfkh3/hSI3poE+atJfXSG02o6bLtgmWyXFuEA6ulXMtGTfA4Ob5fIcpIuwfd/5TlCwJE2mKTbmvp2u/socGxVWokjFuwxxB8oMCmtBDhqq9gGiyxofTmfJ6iCaCvB91Sv28JldFKFED16dGAfAMGTOw== 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=jbF9Z5AttEUa36DqFVoF0RSc0xJM23wjMzYufsdhZiM=; b=lITJo6gPLYcfE7f5fPAaws50eJFkOqEb6abeTKonG+S/w7o2z4nCN/3xeslQuGIDHBMvd5ppqEHN3tk/bwyV+sXGcd1txBfhVPOS/4V3uYSD987cmImQP4N+aIngSY3w0kYic4f746Kk8xHsM0gN6MW4qVdQ2utxq7CYGpXRnLPvbDN+v6R22vGeZpiCsSEsZ8j1Ver/1877Exso5xLGN5KTEtFGrC6xO+n94A/BolKVjc09ZF4TIheSJkjTg0lUJPA1Bz1sqCiH9KsYQHWXfBY+QnG/qIn/Rvs6mmMuLIzLcbQXPrWySGDsqfSHJunGNmtLvqtG9l64Hy1pUbVKQw== Received: from AS4P189CA0012.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5d7::15) by AS5PR07MB10131.eurprd07.prod.outlook.com (2603:10a6:20b:680::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.33; Tue, 18 Mar 2025 00:27:50 +0000 Received: from AM1PEPF000252DE.eurprd07.prod.outlook.com (2603:10a6:20b:5d7:cafe::2e) by AS4P189CA0012.outlook.office365.com (2603:10a6:20b:5d7::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8534.33 via Frontend Transport; Tue, 18 Mar 2025 00:27:50 +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 AM1PEPF000252DE.mail.protection.outlook.com (10.167.16.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.20 via Frontend Transport; Tue, 18 Mar 2025 00:27:50 +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 52I0RNBk024935; Tue, 18 Mar 2025 00:27:57 GMT From: chia-yu.chang@nokia-bell-labs.com To: netdev@vger.kernel.org, dave.taht@gmail.com, pabeni@redhat.com, jhs@mojatatu.com, kuba@kernel.org, stephen@networkplumber.org, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, edumazet@google.com, horms@kernel.org, andrew+netdev@lunn.ch, donald.hunter@gmail.com, ast@fiberby.net, liuhangbin@gmail.com, shuah@kernel.org, linux-kselftest@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 v2 net-next 04/15] tcp: accecn: add AccECN rx byte counters Date: Tue, 18 Mar 2025 01:26:59 +0100 Message-Id: <20250318002710.29483-5-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250318002710.29483-1-chia-yu.chang@nokia-bell-labs.com> References: <20250318002710.29483-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: AM1PEPF000252DE:EE_|AS5PR07MB10131:EE_ X-MS-Office365-Filtering-Correlation-Id: ef0b5210-2277-4811-b02c-08dd65b3b71e X-LD-Processed: 5d471751-9675-428d-917b-70f44f9630b0,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|376014|7416014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?yvw6tLhA5VDacoNebjwd9bLBfAy3Rnk?= =?utf-8?q?Z/sTKnAmZJlfmxvgzpbuVGSFTxLN79QX7jfnP56P63T1oyove26XC5wOFNFVYZVdi?= =?utf-8?q?zOaRLoQ4R4Ml6EhoVT8L1vl0Ibaryjqd4D3DIdgp72GbbwmzlfOBhluLOPFsuL2ns?= =?utf-8?q?f3bHTy/IxkzmWakofIkNlqWtLTr7UU33ePl/4GML95yZKPSApXeJNGHriAk14tNpU?= =?utf-8?q?m5M2RTUOryvcwYljbMD4IbzPMFj+zfdo4Pmyl93Mdp5dCL1pepa9/TRQLOpfqcLOt?= =?utf-8?q?EGVb3Ugony5vpg6EXkQjrNlelsf2+M1qdsEDhgDF3+8/85Rad8EJo13B9rDqGEzVu?= =?utf-8?q?SWDM495Mis3E6uGG1V1wwL8Z57C5zwqMAVpZ11W6VnHkkupxkdcXYCA+VaXLGTuX7?= =?utf-8?q?GoZ8Sgx4bncRWi0sT0vuNsP2hGYHistjIS/TpgQ4AJ6NazUbtYdMiaqeM16U6jMWT?= =?utf-8?q?JwgSOd6jjrGf69utFdLknTg5nA1UyxkKILg/4ayPlBiqnEwcZ6BjlhfwFkt+qXjQN?= =?utf-8?q?a38k4MlATGEeyEm8q8gjv82ul7zZDA+3Cbv7hRbN880Xr5PpgjjpfVODAvC7BhYNx?= =?utf-8?q?lBXShFzHGVxRsnci5ULZj9b4HS+8VYGEGhwrWqaxH8/F8qZH+CfKth3k+KGvpy2Tr?= =?utf-8?q?RQhLMVM/ceMXExUlPZsiQsg0XnIcQ0jnnWO59XNfMxMOTHUGWnGno3VUBvi0Uxr0T?= =?utf-8?q?17yC5bkaj49V41LMcqhlB6Phlk9s8TEjygaFWFXtfG3EKUgbBineCP4psx/r9bt54?= =?utf-8?q?QkMLEDHZxXjJ0b7cFZNmgxhcjeDxtwHw1zv+NNW3diIdtdq3RL1AzJ9u7U7tusiq8?= =?utf-8?q?X4xV8NeS0coXTaYYzxFjw3tND5OQNZmCx9f70Py9LPhVwSI1el8r9UsRlHWBMKsBW?= =?utf-8?q?R018jsI+OlIkKOR3QD6ThM4ekKO4dZ6mXClVg/nis2Z69AuLaNoM845F8AWK8N+lz?= =?utf-8?q?LddtA0eGcJK62BZEowBkKz0RaHdpc0g5BtTPnoZEXQ7QsL6Ch+bPsRtE9exP9ofoc?= =?utf-8?q?eH6AXeToXHC8huJOsRJQmVd5HZDYzGkRIJRXxoS1GHM4oY0n5QvTDGAxBEXSGPfZl?= =?utf-8?q?Ah2fgs9QLd1dam48Z3oTMDkcIi7pNhXe0W8+3pc5eJfQ2owwj2By/pK4o0cEweN6x?= =?utf-8?q?dDj9chtNtlH/pClfLTUhF6JMVYnOUR1TpZZPv/U14GO9GQFUQMeyNUFeTvtfFtGeC?= =?utf-8?q?8zJCui0tncM0bYDub4f/WAcoVpqMD34LBQU2TNkva95humOqQK7TuuddRoRflK8Ym?= =?utf-8?q?iwf04XkmZQx8ZAiXTuNcnGaaBLy3hxZ0oVSxmHl6/9+1GUmuyFKvUP5WVK2+3WSNm?= =?utf-8?q?GaXH53PswSyC1NMFVirGst2LQrfT9smhuIJOP7qVTEkHs729FxswozClveTLzL6ri?= =?utf-8?q?Ksybqbr6uQG7wKSbDw+nuabc67aan3br2XmzNfK+ixObg+y/haAaNhS4tpSTYHCLm?= =?utf-8?q?dMuhwP/HiG?= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.zeu.alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(1800799024)(376014)(7416014)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2025 00:27:50.1490 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef0b5210-2277-4811-b02c-08dd65b3b71e 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: AM1PEPF000252DE.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR07MB10131 X-Patchwork-Delegate: kuba@kernel.org From: Ilpo Järvinen These counters track IP ECN field payload byte sums for all arriving (acceptable) packets. The AccECN option (added by a later patch in the series) echoes these counters back to sender side. Signed-off-by: Ilpo Järvinen Signed-off-by: Neal Cardwell Signed-off-by: Chia-Yu Chang --- include/linux/tcp.h | 1 + include/net/tcp.h | 18 +++++++++++++++++- net/ipv4/tcp.c | 3 ++- net/ipv4/tcp_input.c | 13 +++++++++---- net/ipv4/tcp_minisocks.c | 3 ++- 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 2ddc9076235b..9de5090fadfb 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -300,6 +300,7 @@ struct tcp_sock { u32 delivered; /* Total data packets delivered incl. rexmits */ u32 delivered_ce; /* Like the above but only ECE marked packets */ u32 received_ce; /* Like the above but for rcvd CE marked pkts */ + u32 received_ecn_bytes[3]; u8 received_ce_pending:4, /* Not yet transmit cnt of received_ce */ unused2:4; u32 app_limited; /* limited until "delivered" reaches this val */ diff --git a/include/net/tcp.h b/include/net/tcp.h index 93fffeb59a15..aff31ba1dea9 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -467,7 +467,8 @@ static inline int tcp_accecn_extract_syn_ect(u8 ace) bool tcp_accecn_validate_syn_feedback(struct sock *sk, u8 ace, u8 sent_ect); void tcp_accecn_third_ack(struct sock *sk, const struct sk_buff *skb, u8 syn_ect_snt); -void tcp_ecn_received_counters(struct sock *sk, const struct sk_buff *skb); +void tcp_ecn_received_counters(struct sock *sk, const struct sk_buff *skb, + u32 payload_len); enum tcp_tw_status { TCP_TW_SUCCESS = 0, @@ -1034,11 +1035,26 @@ static inline u32 tcp_rsk_tsval(const struct tcp_request_sock *treq) * See draft-ietf-tcpm-accurate-ecn for the latest values. */ #define TCP_ACCECN_CEP_INIT_OFFSET 5 +#define TCP_ACCECN_E1B_INIT_OFFSET 1 +#define TCP_ACCECN_E0B_INIT_OFFSET 1 +#define TCP_ACCECN_CEB_INIT_OFFSET 0 + +static inline void __tcp_accecn_init_bytes_counters(int *counter_array) +{ + BUILD_BUG_ON(INET_ECN_ECT_1 != 0x1); + BUILD_BUG_ON(INET_ECN_ECT_0 != 0x2); + BUILD_BUG_ON(INET_ECN_CE != 0x3); + + counter_array[INET_ECN_ECT_1 - 1] = 0; + counter_array[INET_ECN_ECT_0 - 1] = 0; + counter_array[INET_ECN_CE - 1] = 0; +} static inline void tcp_accecn_init_counters(struct tcp_sock *tp) { tp->received_ce = 0; tp->received_ce_pending = 0; + __tcp_accecn_init_bytes_counters(tp->received_ecn_bytes); } /* State flags for sacked in struct tcp_skb_cb */ diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 3c8894de5495..49289b5243e3 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -5063,6 +5063,7 @@ static void __init tcp_struct_check(void) CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_write_txrx, delivered); CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_write_txrx, delivered_ce); CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_write_txrx, received_ce); + CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_write_txrx, received_ecn_bytes); CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_write_txrx, app_limited); CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_write_txrx, rcv_wnd); CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_write_txrx, rx_opt); @@ -5070,7 +5071,7 @@ static void __init tcp_struct_check(void) /* 32bit arches with 8byte alignment on u64 fields might need padding * before tcp_clock_cache. */ - CACHELINE_ASSERT_GROUP_SIZE(struct tcp_sock, tcp_sock_write_txrx, 97 + 7); + CACHELINE_ASSERT_GROUP_SIZE(struct tcp_sock, tcp_sock_write_txrx, 109 + 3); /* RX read-write hotpath cache lines */ CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_write_rx, bytes_received); diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 47da42707738..57e3cdb44a51 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -6107,7 +6107,8 @@ static void tcp_urg(struct sock *sk, struct sk_buff *skb, const struct tcphdr *t } /* Updates Accurate ECN received counters from the received IP ECN field */ -void tcp_ecn_received_counters(struct sock *sk, const struct sk_buff *skb) +void tcp_ecn_received_counters(struct sock *sk, const struct sk_buff *skb, + u32 payload_len) { u8 ecnfield = TCP_SKB_CB(skb)->ip_dsfield & INET_ECN_MASK; u8 is_ce = INET_ECN_is_ce(ecnfield); @@ -6122,6 +6123,9 @@ void tcp_ecn_received_counters(struct sock *sk, const struct sk_buff *skb) tp->received_ce += pcount; tp->received_ce_pending = min(tp->received_ce_pending + pcount, 0xfU); + + if (payload_len > 0) + tp->received_ecn_bytes[ecnfield - 1] += payload_len; } } @@ -6399,7 +6403,7 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb) flag |= __tcp_replace_ts_recent(tp, delta); - tcp_ecn_received_counters(sk, skb); + tcp_ecn_received_counters(sk, skb, 0); /* We know that such packets are checksummed * on entry. @@ -6445,7 +6449,8 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb) /* Bulk data transfer: receiver */ tcp_cleanup_skb(skb); __skb_pull(skb, tcp_header_len); - tcp_ecn_received_counters(sk, skb); + tcp_ecn_received_counters(sk, skb, + len - tcp_header_len); eaten = tcp_queue_rcv(sk, skb, &fragstolen); tcp_event_data_recv(sk, skb); @@ -6492,7 +6497,7 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb) tcp_accecn_third_ack(sk, skb, tp->syn_ect_snt); tcp_fast_path_on(tp); } - tcp_ecn_received_counters(sk, skb); + tcp_ecn_received_counters(sk, skb, len - th->doff * 4); reason = tcp_ack(sk, skb, FLAG_SLOWPATH | FLAG_UPDATE_TS_RECENT); if ((int)reason < 0) { diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 0e63f691a387..550c2d9d08b7 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -494,10 +494,11 @@ static void tcp_ecn_openreq_child(struct sock *sk, struct tcp_sock *tp = tcp_sk(sk); if (treq->accecn_ok) { + const struct tcphdr *th = (const struct tcphdr *)skb->data; tcp_ecn_mode_set(tp, TCP_ECN_MODE_ACCECN); tp->syn_ect_snt = treq->syn_ect_snt; tcp_accecn_third_ack(sk, skb, treq->syn_ect_snt); - tcp_ecn_received_counters(sk, skb); + tcp_ecn_received_counters(sk, skb, skb->len - th->doff * 4); } else { tcp_ecn_mode_set(tp, inet_rsk(req)->ecn_ok ? TCP_ECN_MODE_RFC3168 :