[PATCH v11 1/4] virtio-net: clarify NEEDS_CSUM semantic for GSO packats.

Paolo Abeni
2024-11-27T09:37:03Z

The current wording is a bit unclear hinting to possible additional
nested headers. For GSO packets virtio net (currently) supports
offload for the checksum of single transport header, explicitly state
that in both the driver and device sections.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
device-types/net/description.tex | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/device-types/net/description.tex b/device-types/net/description.tex
index 4e4ffdb..3434a31 100644
--- a/device-types/net/description.tex
+++ b/device-types/net/description.tex
@@ -695,6 +695,11 @@ \subsubsection{Packet Transmission}\label{sec:Device Types / Network Device / De
\item the driver MUST validate the packet checksum at
offset \field{csum_offset} from \field{csum_start} as well as all
preceding offsets;
+\begin{note}
+If \field{gso_type} differs from VIRTIO_NET_HDR_GSO_NONE, \field{csum_offset}
+points to the only transport header present in the packet, and there are no
+additional preceding checksums validated by VIRTIO_NET_HDR_F_NEEDS_CSUM.
+\end{note}
\item the driver MUST set the packet checksum stored in the
buffer to the TCP/UDP pseudo header;
\item the driver MUST set \field{csum_start} and
@@ -895,7 +900,11 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network
if bit VIRTIO_NET_HDR_F_RSC_INFO is not set in \field{flags},
then \field{csum_start} and \field{csum_offset} indicate how to calculate it
(see Packet Transmission point 1).
-
+\begin{note}
+If \field{gso_type} differs from VIRTIO_NET_HDR_GSO_NONE, \field{csum_offset}
+points to the only transport header present in the packet, and there are no
+additional preceding checksums validated by VIRTIO_NET_HDR_F_NEEDS_CSUM.
+\end{note}
\end{enumerate}

If applicable, the device calculates per-packet hash for incoming packets as
--
2.45.2