From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: virtio-comment-return-1835-cohuck=redhat.com@lists.oasis-open.org Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis-open.org [10.110.1.242]) by lists.oasis-open.org (Postfix) with ESMTP id A57F7986561 for ; Tue, 27 Apr 2021 10:04:32 +0000 (UTC) Date: Tue, 27 Apr 2021 06:04:23 -0400 From: "Michael S. Tsirkin" Message-ID: <20210427060155-mutt-send-email-mst@kernel.org> References: <20210410092715.14397-1-yuri.benditovich@daynix.com> MIME-Version: 1.0 In-Reply-To: <20210410092715.14397-1-yuri.benditovich@daynix.com> Subject: Re: [virtio-comment] [PATCH] virtio-net: define USO feature Content-Type: text/plain; charset=us-ascii Content-Disposition: inline To: Yuri Benditovich Cc: virtio-comment@lists.oasis-open.org, yan@daynix.com List-ID: On Sat, Apr 10, 2021 at 12:27:15PM +0300, Yuri Benditovich wrote: > Fixes: https://github.com/oasis-tcs/virtio-spec/issues/104 > > Unlike UFO (fragmenting the packet) the USO splits large UDP packet > to several segments when each of these smaller packets has UDP > header. In Linux see SKB_GSO_UDP_L4. > > Signed-off-by: Yuri Benditovich looks good to me. > --- > content.tex | 31 ++++++++++++++++++++----------- > 1 file changed, 20 insertions(+), 11 deletions(-) > > diff --git a/content.tex b/content.tex > index e536fd4..2708386 100644 > --- a/content.tex > +++ b/content.tex > @@ -2964,6 +2964,8 @@ \subsection{Feature bits}\label{sec:Device Types / Network Device / Feature bits > \item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control > channel. > > +\item[VIRTIO_NET_F_HOST_USO (56)] Device can receive USO. > + USO packets maybe? > \item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash > value and a type of calculated hash. > > @@ -2998,6 +3000,7 @@ \subsubsection{Feature bit requirements}\label{sec:Device Types / Network Device > \item[VIRTIO_NET_F_HOST_TSO6] Requires VIRTIO_NET_F_CSUM. > \item[VIRTIO_NET_F_HOST_ECN] Requires VIRTIO_NET_F_HOST_TSO4 or VIRTIO_NET_F_HOST_TSO6. > \item[VIRTIO_NET_F_HOST_UFO] Requires VIRTIO_NET_F_CSUM. > +\item[VIRTIO_NET_F_HOST_USO] Requires VIRTIO_NET_F_CSUM. > > \item[VIRTIO_NET_F_CTRL_RX] Requires VIRTIO_NET_F_CTRL_VQ. > \item[VIRTIO_NET_F_CTRL_VLAN] Requires VIRTIO_NET_F_CTRL_VQ. > @@ -3200,10 +3203,10 @@ \subsection{Device Initialization}\label{sec:Device Types / Network Device / Dev > \item A performant driver would indicate that it will generate checksumless > packets by negotating the VIRTIO_NET_F_CSUM feature. > > -\item If that feature is negotiated, a driver can use TCP or UDP > - segmentation offload by negotiating the VIRTIO_NET_F_HOST_TSO4 (IPv4 > - TCP), VIRTIO_NET_F_HOST_TSO6 (IPv6 TCP) and VIRTIO_NET_F_HOST_UFO > - (UDP fragmentation) features. > +\item If that feature is negotiated, a driver can use TCP segmentation or UDP > + segmentation/fragmentation offload by negotiating the VIRTIO_NET_F_HOST_TSO4 (IPv4 > + TCP), VIRTIO_NET_F_HOST_TSO6 (IPv6 TCP), VIRTIO_NET_F_HOST_UFO > + (UDP fragmentation) and VIRTIO_NET_F_HOST_USO (UDP segmentation) features. > > \item The converse features are also available: a driver can save > the virtual device some work by negotiating these features.\note{For example, a network packet transported between two guests on > @@ -3242,6 +3245,7 @@ \subsection{Device Operation}\label{sec:Device Types / Network Device / Device O > #define VIRTIO_NET_HDR_GSO_TCPV4 1 > #define VIRTIO_NET_HDR_GSO_UDP 3 > #define VIRTIO_NET_HDR_GSO_TCPV6 4 > +#define VIRTIO_NET_HDR_GSO_UDP_L4 5 > #define VIRTIO_NET_HDR_GSO_ECN 0x80 > u8 gso_type; > le16 hdr_len; > @@ -3312,9 +3316,9 @@ \subsubsection{Packet Transmission}\label{sec:Device Types / Network Device / De > \end{note} > > \item If the driver negotiated > - VIRTIO_NET_F_HOST_TSO4, TSO6 or UFO, and the packet requires > - TCP segmentation or UDP fragmentation, then \field{gso_type} > - is set to VIRTIO_NET_HDR_GSO_TCPV4, TCPV6 or UDP. > + VIRTIO_NET_F_HOST_TSO4, TSO6, USO or UFO, and the packet requires > + TCP segmentation, UDP segmentation or fragmentation, then \field{gso_type} > + is set to VIRTIO_NET_HDR_GSO_TCPV4, TCPV6, UDP_L4 or UDP. > (Otherwise, it is set to VIRTIO_NET_HDR_GSO_NONE). In this > case, packets larger than 1514 bytes can be transmitted: the > metadata indicates how to replicate the packet header to cut it > @@ -3372,9 +3376,14 @@ \subsubsection{Packet Transmission}\label{sec:Device Types / Network Device / De > > If VIRTIO_NET_F_HOST_UFO is negotiated, the driver MAY set > \field{gso_type} to VIRTIO_NET_HDR_GSO_UDP to request UDP > -segmentation, otherwise the driver MUST NOT set > +fragmentation, otherwise the driver MUST NOT set > \field{gso_type} to VIRTIO_NET_HDR_GSO_UDP. This is actually a bugfix. Could you split this to a separate patch so we can track this as a defect? > > +If VIRTIO_NET_F_HOST_USO is negotiated, the driver MAY set > +\field{gso_type} to VIRTIO_NET_HDR_GSO_UDP_L4 to request UDP > +segmentation, otherwise the driver MUST NOT set > +\field{gso_type} to VIRTIO_NET_HDR_GSO_UDP_L4. How about adding the text from the commit log here (no need to mention linux) so people are not confused which is which. E.g.: Unlike UFO (fragmenting the packet) the USO splits large UDP packet to several segments when each of these smaller packets has UDP header. > + > 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 > @@ -3398,7 +3407,7 @@ \subsubsection{Packet Transmission}\label{sec:Device Types / Network Device / De > packet; > \end{enumerate} > > -If none of the VIRTIO_NET_F_HOST_TSO4, TSO6 or UFO options have > +If none of the VIRTIO_NET_F_HOST_TSO4, TSO6, USO or UFO options have > been negotiated, the driver MUST set \field{gso_type} to > VIRTIO_NET_HDR_GSO_NONE. > > @@ -3407,7 +3416,7 @@ \subsubsection{Packet Transmission}\label{sec:Device Types / Network Device / De > \field{flags} and MUST set \field{gso_size} to indicate the > desired MSS. > > -If one of the VIRTIO_NET_F_HOST_TSO4, TSO6 or UFO options have > +If one of the VIRTIO_NET_F_HOST_TSO4, TSO6, USO or UFO options have > been negotiated: > \begin{itemize} > \item If the VIRTIO_NET_F_GUEST_HDRLEN feature has been negotiated, > @@ -3434,7 +3443,7 @@ \subsubsection{Packet Transmission}\label{sec:Device Types / Network Device / De > If VIRTIO_NET_HDR_F_NEEDS_CSUM bit in \field{flags} is not set, the > device MUST NOT use the \field{csum_start} and \field{csum_offset}. > > -If one of the VIRTIO_NET_F_HOST_TSO4, TSO6 or UFO options have > +If one of the VIRTIO_NET_F_HOST_TSO4, TSO6, USO or UFO options have > been negotiated: > \begin{itemize} > \item If the VIRTIO_NET_F_GUEST_HDRLEN feature has been negotiated, > -- > 2.25.1 > > > This publicly archived list offers a means to provide input to the > OASIS Virtual I/O Device (VIRTIO) TC. > > In order to verify user consent to the Feedback License terms and > to minimize spam in the list archive, subscription is required > before posting. > > Subscribe: virtio-comment-subscribe@lists.oasis-open.org > Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org > List help: virtio-comment-help@lists.oasis-open.org > List archive: https://lists.oasis-open.org/archives/virtio-comment/ > Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf > List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists > Committee: https://www.oasis-open.org/committees/virtio/ > Join OASIS: https://www.oasis-open.org/join/ This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: virtio-comment-subscribe@lists.oasis-open.org Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org List help: virtio-comment-help@lists.oasis-open.org List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/