RE: [PATCH v6 net-next 03/14] net: update commnets for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN

Chia-Yu Chang (Nokia)
2025-11-26T08:48:26Z

> -----Original Message-----
> From: Chia-Yu Chang (Nokia)
> Sent: Wednesday, November 19, 2025 12:22 PM
> To: 'Paolo Abeni' <pabeni@redhat.com>; edumazet@google.com; parav@nvidia.com; linux-doc@vger.kernel.org; corbet@lwn.net; horms@kernel.org; dsahern@kernel.org; kuniyu@google.com; bpf@vger.kernel.org; netdev@vger.kernel.org; dave.taht@gmail.com; jhs@mojatatu.com; kuba@kernel.org; stephen@networkplumber.org; xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; 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) <koen.de_schepper@nokia-bell-labs.com>; g.white@cablelabs.com; ingemar.s.johansson@ericsson.com; mirja.kuehlewind@ericsson.com; cheshire <cheshire@apple.com>; rs.ietf@gmx.at; Jason_Livingood@comcast.com; Vidhi Goel <vidhi_goel@apple.com>
> Subject: RE: [PATCH v6 net-next 03/14] net: update commnets for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN
>
> > -----Original Message-----
> > From: Paolo Abeni <pabeni@redhat.com>
> > Sent: Wednesday, November 19, 2025 11:40 AM
> > To: Chia-Yu Chang (Nokia) <chia-yu.chang@nokia-bell-labs.com>; edumazet@google.com; parav@nvidia.com; linux-doc@vger.kernel.org; corbet@lwn.net; horms@kernel.org; dsahern@kernel.org; kuniyu@google.com; bpf@vger.kernel.org; netdev@vger.kernel.org; dave.taht@gmail.com; jhs@mojatatu.com; kuba@kernel.org; stephen@networkplumber.org; xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; 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) <koen.de_schepper@nokia-bell-labs.com>; g.white@cablelabs.com; ingemar.s.johansson@ericsson.com; mirja.kuehlewind@ericsson.com; cheshire <cheshire@apple.com>; rs.ietf@gmx.at; Jason_Livingood@comcast.com; Vidhi Goel <vidhi_goel@apple.com>
> > Subject: Re: [PATCH v6 net-next 03/14] net: update commnets for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN
> >
> >
> > CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
> >
> >
> >
> > On 11/19/25 11:24 AM, Chia-Yu Chang (Nokia) wrote:
> > > I was thinking to totally remove ECN from Rx path,
> >
> > ??? do you mean you intend to remove the existing virtio_net ECN support? I guess/hope I misread the above.
> >
> > Note that removing features from virtio_net is an extreme pain at best, and more probably simply impossible - see the UFO removal history.
> >
> > Please clarify, thanks!
> >
> > Paolo
>
> This ECN flag on RX path shall not be used in Rx path for forwarding scenario. But it can still be used on Tx path in virtio_net.
>
> And on RX path, new ACCECN flag shall be used to avoid breaking CWR flag for latter GSO Tx in forwarding scenario.
>
> Let me borrow an example from Ilpo:
>
> SKB_GSO_TCP_ECN will not replicate the same TCP header flags in a forwarding scenario:
> Segment 1 CWR set
> Segment 2 CWR set
>
> GRO rx and GSO tx with SKB_GSO_TCP_ECN, after forwarding outputs these segments:
> Segment 1 CWR set
> Segment 2 CWR cleared
>
> Thus, the ACE field in Segment 2 no longer contains the same value as it was sent with.
>
>
> So, maybe a table below better represent this?
> +===============+======================+===========================+
> | | SKB_GSO_TCP_ECN | SKB_GSO_TCP_ACCECN |
> +===============+======================+===========================+
> | | The 1st TCP segment | The TCP segment uses |
> | Tx path | has CWR set and | the CWR flag as part of |
> | | suqsequent segments | ACE signal, and the CWR |
> | | have CWR cleared. | flag is not modified. |
> +---------------+----------------------+---------------------------+
> | Rx path | Shall not be used to | Used to indicate latter |
> | of forwarding | avoid potential ACE | GSO Tx NOT to clear CWR |
> | scenario | signal corruption. | flag from the 2nd segment |
> +===============+======================+===========================+
>
>
> Chia-Yu

Hi Paolo,

I was thinking to move this patch to a latter series in which we would like to add ACCECN flags for virtio_net and replace some existing SKB_GSO_TCP_ECN of RX path.

Hope this is ok for you.

For instance , in mlx5e_shampo_update_ipv4_tcp_hdr() of drivers/net/ethernet/mellanox/mlx5/core/en_rx.c, SKB_GSO_TCP_ECN is still being used for RX now.

But this needs to be either changed into SKB_GSO_TCP_ACCECN or totally removed to avoid potential CWR corruption.

For virtio_net RX path, our planned change is to check wither ACCECN is being set first and then translate from VIRTIO_NET_HDR_GSO_ACCECN to SKB_GSO_TCP_ACCECN.

And if VIRTIO_NET_HDR_GSO_ACCECN is not set but VIRTIO_NET_HDR_GSO_ECN is set, then VIRTIO_NET_HDR_GSO_ECN will be translated into SKB_GSO_TCP_ECN.

Chia-Yu