RE: [PATCH v10 1/2] virtio-net: Fix ECN feature descriptions

Parav Pandit <[email protected]>
Newsgroups dev.linux.lists.virtio-comment
Message-ID <CY8PR12MB719523226B3E785B8433C823DCE6A@CY8PR12MB7195.namprd12.prod.outlook.com>

> From: Chia-Yu Chang (Nokia) <[email protected]>
> 
> > -----Original Message-----
> > From: Parav Pandit <[email protected]>
> > Sent: Tuesday, September 30, 2025 6:15 AM
> > To: Chia-Yu Chang (Nokia) <[email protected]>;
> > [email protected]; [email protected]; [email protected];
> > [email protected]; [email protected];
> [email protected];
> > [email protected]; [email protected]; [email protected]; Koen De
> > Schepper (Nokia) <[email protected]>;
> > [email protected]; [email protected];
> > [email protected]; [email protected]
> > Subject: Re: [PATCH v10 1/2] virtio-net: Fix ECN feature descriptions
> >
> >
> > 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 29-09-2025 11:14 pm, Chia-Yu Chang (Nokia) wrote:
> > >> -----Original Message-----
> > >> From: Parav Pandit <[email protected]>
> > >> Sent: Monday, September 29, 2025 9:48 AM
> > >> To: Chia-Yu Chang (Nokia) <[email protected]>;
> > >> [email protected]; [email protected]; [email protected];
> > >> [email protected]; [email protected];
> > >> [email protected]; [email protected]; [email protected];
> > >> [email protected]; Koen De Schepper (Nokia)
> > >> <[email protected]>;
> > >> [email protected]; [email protected];
> > >> [email protected]; [email protected]
> > >> Subject: RE: [PATCH v10 1/2] virtio-net: Fix ECN feature
> > >> descriptions
> > >>
> > >>
> > >> 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.
> > >>
> > >>
> > >>
> > >> Hi,
> > >>
> > >>> From: [email protected] <chia-yu.chang@nokia-bell-
> > >>> labs.com>
> > >>>
> > >>> From: Chia-Yu Chang <[email protected]>
> > >>>
> > >>> Clarify that the VIRTIO_NET_HDR_GSO_ECN gso_type flag does not
> > >>> mean that TCP has IP-ECN set; instead, it identifies that the TCP
> > >>> CWR flag is set and will be cleared from the second segment of an
> aggregated segment.
> > >>>
> > >> Above text is seems to be clarified only in commit message, not in the
> spec changes below.
> > >> Can you please add it in the actual spec wording, including
> requirements?
> > > Hi Parav,
> > >
> > > This is to fix current error in virtio spec:
> > > "VIRTIO_NET_HDR_GSO_ECN is a flag within the VIRTIO_NET_HDR
> structure that indicates the TCP header of a packet has its Explicit Congestion
> Notification (ECN) bit set, signifying congestion in the network"
> >
> > I am unable to find the above cited text in virtio spec.
> >
> > Do I miss to find above text in the spec?
> >
> >
> > What I read in spec is:
> >
> > The driver SHOULD NOT send to the device TCP packets requiring
> > segmentation offload which have the
> >
> > Explicit Congestion Notification bit set, unless the
> > VIRTIO_NET_F_HOST_ECN feature is negotiated, in
> >
> > which case the driver MUST set the VIRTIO_NET_HDR_GSO_ECN bit in
> gso_type.
> 
> Yes, you are right.
> 
> > > TCP header does not have ECN bit, and this flag shall indicate the CWR bit
> of TCP header is set when doing the GSO for the first packet.
> > > The corresponding texts in RFC3168 are "When the TCP data sender is
> ready to set the CWR bit after reducing the congestion window, it SHOULD set
> the CWR bit only on the first new data packet that it transmits."
> > >
> > > So, do you think adding above texts in the commit message is ok?
> >
> > Yes, but only commit message is not enough. We need equivalent text in
> the description and in driver + device requirement section.
> >
> > Something like,
> >
> > When the device is transmitting packets of gso_type of segmentation type
> A, B, or C, and if driver requested gso_type of HOST_ECN, the device must set
> the ECN bits in the IP header and CWR bit in the TCP header in the first data
> packet of the TCP or UDP segments.
> >
> 
> I think the text changes are already proposed below.
> 
> Or you can refer to my original email for better comparison:
> https://yhbt.net/lore/virtio-comment/[email protected]/T/#mc1750dcc26d74c9b19939c4e86dae8bbade6ec78
> 
Above link indicates to follow the requirements from section 6.1.2 of RFC 3168.
Section 6.1.2 largely describes how TCP state machine to set the CWR bits.
It does not describe when doing GSO on tx, how first and non_first packets to be prepared by the device.
GSO of virtio net is stateless operation and segmentation does not interact with RTT.

If I understand it right,
The requirement from the device is that if 64KB segmentation offload is done with mtu of 4K, out of 16 packets, only the first TCP pkt to have ECN and CWR bits set.

If yes, then we need to spell that out in the virtio spec requirements section and description.

Similar wording to apply in patch_2 for accecn too.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.