From: Paolo Abeni <pabeni@redhat.com>
To: chia-yu.chang@nokia-bell-labs.com, netdev@vger.kernel.org,
dsahern@gmail.com, davem@davemloft.net, edumazet@google.com,
dsahern@kernel.org, joel.granados@kernel.org, kuba@kernel.org,
andrew+netdev@lunn.ch, horms@kernel.org, pablo@netfilter.org,
kadlec@netfilter.org, netfilter-devel@vger.kernel.org,
coreteam@netfilter.org, kory.maincent@bootlin.com,
bpf@vger.kernel.org, kuniyu@amazon.com, andrew@lunn.ch,
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
Subject: Re: [PATCH v7 net-next 09/12] gro: prevent ACE field corruption & better AccECN handling
Date: Tue, 11 Mar 2025 13:09:57 +0100 [thread overview]
Message-ID: <62ae486d-621c-4b72-b9fa-d582f80cccd4@redhat.com> (raw)
In-Reply-To: <20250305223852.85839-10-chia-yu.chang@nokia-bell-labs.com>
On 3/5/25 11:38 PM, chia-yu.chang@nokia-bell-labs.com wrote:
> From: Ilpo Järvinen <ij@kernel.org>
>
> There are important differences in how the CWR field behaves
> in RFC3168 and AccECN. With AccECN, CWR flag is part of the
> ACE counter and its changes are important so adjust the flags
> changed mask accordingly.
>
> Also, if CWR is there, set the Accurate ECN GSO flag to avoid
> corrupting CWR flag somewhere.
>
> Signed-off-by: Ilpo Järvinen <ij@kernel.org>
> Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> ---
> net/ipv4/tcp_offload.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c
> index a4cea85288ff..ef12aee5deb4 100644
> --- a/net/ipv4/tcp_offload.c
> +++ b/net/ipv4/tcp_offload.c
> @@ -329,7 +329,7 @@ struct sk_buff *tcp_gro_receive(struct list_head *head, struct sk_buff *skb,
> th2 = tcp_hdr(p);
> flush = (__force int)(flags & TCP_FLAG_CWR);
> flush |= (__force int)((flags ^ tcp_flag_word(th2)) &
> - ~(TCP_FLAG_CWR | TCP_FLAG_FIN | TCP_FLAG_PSH));
> + ~(TCP_FLAG_FIN | TCP_FLAG_PSH));
> flush |= (__force int)(th->ack_seq ^ th2->ack_seq);
> for (i = sizeof(*th); i < thlen; i += 4)
> flush |= *(u32 *)((u8 *)th + i) ^
> @@ -405,7 +405,7 @@ void tcp_gro_complete(struct sk_buff *skb)
> shinfo->gso_segs = NAPI_GRO_CB(skb)->count;
>
> if (th->cwr)
> - shinfo->gso_type |= SKB_GSO_TCP_ECN;
> + shinfo->gso_type |= SKB_GSO_TCP_ACCECN;
> }
> EXPORT_SYMBOL(tcp_gro_complete);
To recap: when an host implementing the above will receive a GSO_TCP_ECN
train transmitted by a RFC3168 endpoint, it will re-assemble it in 2
packets: a GSO one with !th->cwr and a non GSO one with th->cwr set.
When receiving a GSO train with constant CWR set on all the wire
packets, it will assemble it in a single SKB_GSO_TCP_ACCECN packet.
I think should work correctly.
Side note: the SKB_GSO_TCP_ACCECN flag is required: NETIF_F_TSO_ECN
enabled driver will likely unconditionally apply RFC3168-like TSO to any
GSO packet carrying the CWR flag, regardless of the skb gso_type.
@Eric: are you ok with this change?
Thanks,
Paolo
next prev parent reply other threads:[~2025-03-11 12:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-05 22:38 [PATCH v7 net-next 00/12] AccECN protocol preparation patch series chia-yu.chang
2025-03-05 22:38 ` [PATCH v7 net-next 01/12] tcp: reorganize tcp_in_ack_event() and tcp_count_delivered() chia-yu.chang
2025-03-05 22:38 ` [PATCH v7 net-next 02/12] tcp: create FLAG_TS_PROGRESS chia-yu.chang
2025-03-05 22:38 ` [PATCH v7 net-next 03/12] tcp: use BIT() macro in include/net/tcp.h chia-yu.chang
2025-03-05 22:38 ` [PATCH v7 net-next 04/12] tcp: extend TCP flags to allow AE bit/ACE field chia-yu.chang
2025-03-05 22:38 ` [PATCH v7 net-next 05/12] tcp: reorganize SYN ECN code chia-yu.chang
2025-03-05 22:38 ` [PATCH v7 net-next 06/12] tcp: rework {__,}tcp_ecn_check_ce() -> tcp_data_ecn_check() chia-yu.chang
2025-03-05 22:38 ` [PATCH v7 net-next 07/12] tcp: helpers for ECN mode handling chia-yu.chang
2025-03-05 22:38 ` [PATCH v7 net-next 08/12] gso: AccECN support chia-yu.chang
2025-03-05 22:38 ` [PATCH v7 net-next 09/12] gro: prevent ACE field corruption & better AccECN handling chia-yu.chang
2025-03-11 12:09 ` Paolo Abeni [this message]
2025-03-05 22:38 ` [PATCH v7 net-next 10/12] tcp: AccECN support to tcp_add_backlog chia-yu.chang
2025-03-05 22:38 ` [PATCH v7 net-next 11/12] tcp: add new TCP_TW_ACK_OOW state and allow ECN bits in TOS chia-yu.chang
2025-03-05 22:38 ` [PATCH v7 net-next 12/12] tcp: Pass flags to __tcp_send_ack chia-yu.chang
2025-03-17 15:50 ` [PATCH v7 net-next 00/12] AccECN protocol preparation patch series patchwork-bot+netdevbpf
2025-03-17 16:44 ` Chia-Yu Chang (Nokia)
2025-03-17 21:04 ` Paolo Abeni
2025-03-18 0:25 ` Chia-Yu Chang (Nokia)
-- strict thread matches above, loose matches on Subject: below --
2025-03-04 15:15 chia-yu.chang
2025-03-04 15:16 ` [PATCH v7 net-next 09/12] gro: prevent ACE field corruption & better AccECN handling chia-yu.chang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=62ae486d-621c-4b72-b9fa-d582f80cccd4@redhat.com \
--to=pabeni@redhat.com \
--cc=Jason_Livingood@comcast.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=bpf@vger.kernel.org \
--cc=cheshire@apple.com \
--cc=chia-yu.chang@nokia-bell-labs.com \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=g.white@CableLabs.com \
--cc=horms@kernel.org \
--cc=ij@kernel.org \
--cc=ingemar.s.johansson@ericsson.com \
--cc=joel.granados@kernel.org \
--cc=kadlec@netfilter.org \
--cc=koen.de_schepper@nokia-bell-labs.com \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=kuniyu@amazon.com \
--cc=mirja.kuehlewind@ericsson.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=rs.ietf@gmx.at \
--cc=vidhi_goel@apple.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).