virtio-net: Fix virtio_net_hdr struct size when VIRTIO_NET_F_HASH_REPORT is negotiated.
PATCH 1/1 virtio-net: Fix virtio_net_hdr struct size when VIRTIO_NET_F_HASH_REPORT is negotiated.
Hard-coded references to the size of virtio_net_hdr strut are wrong when VIRTIO_NET_HASH_REPORT feature is negotiated.
Changelog:v1->v2: Fixed wording syntaxv2->v3: Rebase
--- content.tex | 10 ++++++---- split-ring.tex | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-)
content.tex +6 -4
@@ -3622,8 +3622,8 @@ \subsubsection{Setting Up Receive Buffers}\label{sec:Device Types / Network Devi features are used, the maximum incoming packet will be to 65550 bytes long (the maximum size of a TCP or UDP packet, plus the 14 byte ethernet header), otherwise -1514 bytes. The 12-byte struct virtio_net_hdr is prepended to this, -making for 65562 or 1526 bytes. +1514 bytes. The struct virtio_net_hdr (the length of which depends on VIRTIO_NET_F_HASH_REPORT +feature negotiation) is prepended to this. \drivernormative{\paragraph}{Setting Up Receive Buffers}{Device Types / Network Device / Device Operation / Setting Up Receive Buffers}
@@ -3632,9 +3632,11 @@ \subsubsection{Setting Up Receive Buffers}\label{sec:Device Types / Network Devi \begin{itemize} \item If VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, VIRTIO_NET_F_GUEST_UFO, VIRTIO_NET_F_GUEST_USO4 or VIRTIO_NET_F_GUEST_USO6 are negotiated, the driver SHOULD populate - the receive queue(s) with buffers of at least 65562 bytes. + the receive queue(s) with buffers of at least 65570 bytes + if VIRTIO_NET_F_HASH_REPORT is negotiated, 65562 bytes otherwise. \item Otherwise, the driver SHOULD populate the receive queue(s) - with buffers of at least 1526 bytes. + with buffers of at least 1534 bytes if VIRTIO_NET_F_HASH_REPORT + is negotiated, 1526 bytes otherwise. \end{itemize} \item If VIRTIO_NET_F_MRG_RXBUF is negotiated, each buffer MUST be at least the size of the struct virtio_net_hdr.
split-ring.tex +2 -1
@@ -127,7 +127,8 @@ \subsection{Legacy Interfaces: A Note on Virtqueue Endianness}\label{sec:Basic F \subsection{Message Framing}\label{sec:Basic Facilities of a Virtio Device / Virtqueues / Message Framing} The framing of messages with descriptors is -independent of the contents of the buffers. For example, a network +independent of the contents of the buffers. For example, if +VIRTIO_NET_F_HASH_REPORT has not been negotiated, a network transmit buffer consists of a 12 byte header followed by the network packet. This could be most simply placed in the descriptor table as a 12 byte output descriptor followed by a 1514 byte output descriptor,
Signature · 22 lines
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: [email protected] Unsubscribe: [email protected] List help: [email protected] 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/
Hello
It seems this proposal has not received feedback from virtio-net folks. What should we do with it ?
Thanks
-----Original Message-----
From: Cyril Germond <[email protected]>
Sent: Monday, November 21, 2022 10:03 AM
To: [email protected]
Cc: Cyril Germond <[email protected]>
Subject: [PATCH] virtio-net: Fix virtio_net_hdr struct size when VIRTIO_NET_F_HASH_REPORT is negotiated.
Hard-coded references to the size of virtio_net_hdr strut are wrong when VIRTIO_NET_HASH_REPORT feature is negotiated.
Changelog:v1->v2: Fixed wording syntaxv2->v3: Rebase
--- content.tex | 10 ++++++---- split-ring.tex | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-)
content.tex +6 -3
@@ -3622,8 +3622,8 @@ \subsubsection{Setting Up Receive Buffers}\label{sec:Device Types / Network Devi features are used, the maximum incoming packet will be to 65550 bytes long (the maximum size of a TCP or UDP packet, plus the 14 byte ethernet header), otherwise -1514 bytes. The 12-byte struct virtio_net_hdr is prepended to this, -making for 65562 or 1526 bytes. +1514 bytes. The struct virtio_net_hdr (the length of which depends on +VIRTIO_NET_F_HASH_REPORT feature negotiation) is prepended to this. \drivernormative{\paragraph}{Setting Up Receive Buffers}{Device Types / Network Device / Device Operation / Setting Up Receive Buffers}
@@ -3632,9 +3632,11 @@ \subsubsection{Setting Up Receive Buffers}\label{sec:Device Types / Network Devi \begin{itemize} \item If VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, VIRTIO_NET_F_GUEST_UFO, VIRTIO_NET_F_GUEST_USO4 or VIRTIO_NET_F_GUEST_USO6 are negotiated, the driver SHOULD populate - the receive queue(s) with buffers of at least 65562 bytes. + the receive queue(s) with buffers of at least 65570 bytes + if VIRTIO_NET_F_HASH_REPORT is negotiated, 65562 bytes otherwise. \item Otherwise, the driver SHOULD populate the receive queue(s) - with buffers of at least 1526 bytes. + with buffers of at least 1534 bytes if VIRTIO_NET_F_HASH_REPORT + is negotiated, 1526 bytes otherwise. \end{itemize} \item If VIRTIO_NET_F_MRG_RXBUF is negotiated, each buffer MUST be at least the size of the struct virtio_net_hdr.
split-ring.tex +2 -1
@@ -127,7 +127,8 @@ \subsection{Legacy Interfaces: A Note on Virtqueue Endianness}\label{sec:Basic F \subsection{Message Framing}\label{sec:Basic Facilities of a Virtio Device / Virtqueues / Message Framing} The framing of messages with descriptors is -independent of the contents of the buffers. For example, a network +independent of the contents of the buffers. For example, if +VIRTIO_NET_F_HASH_REPORT has not been negotiated, a network transmit buffer consists of a 12 byte header followed by the network packet. This could be most simply placed in the descriptor table as a 12 byte output descriptor followed by a 1514 byte output descriptor, --
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: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
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/
Quoted 4 lines · Cyril Germond
Hello
It seems this proposal has not received feedback from virtio-net folks. What should we do with it ?
Thanks
Request a vote to resolve this as described at:
https://github.com/oasis-tcs/virtio-spec#use-of-github-issues
Quoted 68 lines
-----Original Message-----
From: Cyril Germond <[email protected]>
Sent: Monday, November 21, 2022 10:03 AM
To: [email protected]
Cc: Cyril Germond <[email protected]>
Subject: [PATCH] virtio-net: Fixvirtio_net_hdrstruct size whenVIRTIO_NET_F_HASH_REPORTis negotiated.Hard-coded references to the size of
virtio_net_hdrstrut are wrong whenVIRTIO_NET_HASH_REPORTfeature is negotiated.Changelog:
v1->v2: Fixed wording syntaxv2->v3: RebaseSigned-off-by Cyril Germond <[email protected]>--- content.tex | 10 ++++++---- split-ring.tex | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-)content.tex +6
-3@@ -3622,8 +3622,8 @@ \subsubsection{Setting Up Receive Buffers}\label{sec:Device Types / Network Devi features are used, the maximum incoming packet will be to 65550 bytes long (the maximum size of a TCP or UDP packet, plus the 14 byte ethernet header), otherwise -1514 bytes. The 12-byte struct virtio_net_hdr is prepended to this, -making for 65562 or 1526 bytes. +1514 bytes. The struct virtio_net_hdr (the length of which depends on +VIRTIO_NET_F_HASH_REPORT feature negotiation) is prepended to this. \drivernormative{\paragraph}{Setting Up Receive Buffers}{Device Types / Network Device / Device Operation / Setting Up Receive Buffers}@@ -3632,9 +3632,11 @@ \subsubsection{Setting Up Receive Buffers}\label{sec:Device Types / Network Devi \begin{itemize} \item If VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, VIRTIO_NET_F_GUEST_UFO, VIRTIO_NET_F_GUEST_USO4 or VIRTIO_NET_F_GUEST_USO6 are negotiated, the driver SHOULD populate - the receive queue(s) with buffers of at least 65562 bytes. + the receive queue(s) with buffers of at least 65570 bytes + if VIRTIO_NET_F_HASH_REPORT is negotiated, 65562 bytes otherwise. \item Otherwise, the driver SHOULD populate the receive queue(s) - with buffers of at least 1526 bytes. + with buffers of at least 1534 bytes if VIRTIO_NET_F_HASH_REPORT + is negotiated, 1526 bytes otherwise. \end{itemize} \item If VIRTIO_NET_F_MRG_RXBUF is negotiated, each buffer MUST be at least the size of the struct virtio_net_hdr.split-ring.tex +2
-1@@ -127,7 +127,8 @@ \subsection{Legacy Interfaces: A Note on Virtqueue Endianness}\label{sec:Basic F \subsection{Message Framing}\label{sec:Basic Facilities of a Virtio Device / Virtqueues / Message Framing} The framing of messages with descriptors is -independent of the contents of the buffers. For example, a network +independent of the contents of the buffers. For example, if +VIRTIO_NET_F_HASH_REPORT has not been negotiated, a network transmit buffer consists of a 12 byte header followed by the network packet. This could be most simply placed in the descriptor table as a 12 byte output descriptor followed by a 1514 byte output descriptor, --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.
Quoted 8 lines
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
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: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
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/
OK thanks
-----Original Message-----
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, May 3, 2023 4:27 PM
To: Cyril Germond <[email protected]>
Cc: [email protected]
Subject: Re: [virtio-comment] RE: [PATCH] virtio-net: Fix virtio_net_hdr struct size when VIRTIO_NET_F_HASH_REPORT is negotiated.
Quoted 4 lines · Cyril Germond
Hello
It seems this proposal has not received feedback from virtio-net folks. What should we do with it ?
Thanks
Request a vote to resolve this as described at:
https://github.com/oasis-tcs/virtio-spec#use-of-github-issues
Quoted 77 lines
-----Original Message-----
From: Cyril Germond <[email protected]>
Sent: Monday, November 21, 2022 10:03 AM
To: [email protected]
Cc: Cyril Germond <[email protected]>
Subject: [PATCH] virtio-net: Fixvirtio_net_hdrstruct size whenVIRTIO_NET_F_HASH_REPORTis negotiated.Hard-coded references to the size of
virtio_net_hdrstrut are wrong whenVIRTIO_NET_HASH_REPORTfeature is negotiated.Changelog:
v1->v2: Fixed wording syntaxv2->v3: RebaseSigned-off-by Cyril Germond <[email protected]>--- content.tex | 10 ++++++---- split-ring.tex | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-)content.tex +0
-0@@ -3622,8 +3622,8 @@ \subsubsection{Setting Up ReceiveBuffers}\label{sec:Device Types / Network Devi features are used, the
maximum incoming packet will be to 65550 bytes long (the maximum size
of a TCP or UDP packet, plus the 14 byte ethernet header), otherwise
-1514 bytes. The 12-byte structvirtio_net_hdris prepended to this, -making for 65562 or 1526 bytes. +1514 bytes. The structvirtio_net_hdr(the length of which depends
+onVIRTIO_NET_F_HASH_REPORTfeature negotiation) is prepended to this.\drivernormative{\paragraph}{Setting Up Receive Buffers}{Device Types
/ Network Device / Device Operation / Setting Up Receive Buffers}content.tex +4
-2@@ -3632,9 +3632,11 @@ \subsubsection{Setting Up Receive Buffers}\label{sec:Device Types / Network Devi \begin{itemize} \item If VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, VIRTIO_NET_F_GUEST_UFO, VIRTIO_NET_F_GUEST_USO4 or VIRTIO_NET_F_GUEST_USO6 are negotiated, the driver SHOULD populate - the receive queue(s) with buffers of at least 65562 bytes. + the receive queue(s) with buffers of at least 65570 bytes + if VIRTIO_NET_F_HASH_REPORT is negotiated, 65562 bytes otherwise. \item Otherwise, the driver SHOULD populate the receive queue(s) - with buffers of at least 1526 bytes. + with buffers of at least 1534 bytes if VIRTIO_NET_F_HASH_REPORT + is negotiated, 1526 bytes otherwise. \end{itemize} \item If VIRTIO_NET_F_MRG_RXBUF is negotiated, each buffer MUST be at least the size of the struct virtio_net_hdr.split-ring.tex index de94038..82e910f renamed from split-ring.tex +0
-0100644
split-ring.tex +0
-0@@ -127,7 +127,8 @@ \subsection{Legacy Interfaces: A Note on VirtqueueEndianness}\label{sec:Basic F
\subsection{Message Framing}\label{sec:Basic Facilities of a Virtio
Device / Virtqueues / Message Framing} The framing of messages with descriptors is -independent of the contents of the buffers. For example, a networksplit-ring.tex +2
-0+independent of the contents of the buffers. For example, if +VIRTIO_NET_F_HASH_REPORT has not been negotiated, a network transmit buffer consists of a 12 byte header followed by the networkpacket. This could be most simply placed in the descriptor table as a
12 byte output descriptor followed by a 1514 byte output descriptor,
--
2.25.1This 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.
Quoted 10 lines
Subscribe: [email protected]
Unsubscribe: [email protected] List help: [email protected]
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: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
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/
Quoted 4 lines · Cyril Germond
From: Cyril Germond <[email protected]>
Sent: Monday, November 21, 2022 10:03 AMHard-coded references to the size of
virtio_net_hdrstrut are wrong whenVIRTIO_NET_HASH_REPORTfeature is negotiated.
Please fix spelling,
s/strut/struct
Below changelog should be after "---", so that it doesnt become part of the commit log.
split-ring.tex \subsection{Legacy Interfaces: A Note on Virtqueue Endianness}\label{sec:Basic F · line 132
Quoted 6 lines
\subsection{Message Framing}\label{sec:Basic Facilities of a Virtio Device / Virtqueues / Message Framing} The framing of messages with descriptors is -independent of the contents of the buffers. For example, a network
split-ring.tex +2
-0+independent of the contents of the buffers. For example, if +VIRTIO_NET_F_HASH_REPORT has not been negotiated, a network transmit buffer consists of a 12 byte header followed by the network packet. This could be most simply placed in the descriptor table as a 12 byte output descriptor followed by a 1514 byte output descriptor,
Above change does not look correct as the example is for the Tx. and HASH_REPORT is for the RX.
Once you post the new version as v1 with above fixes, please update the link in the github issue as well.
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: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
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/
Hello
I agree VIRTIO_NET_HASH_REPORT feature is for incoming packets path.
Nevertheless, it seems - at least to me but I may be wrong there - that the packet header structure data type - as described in chapter 5.1.6 Device Operation - is the same for the Rx and TX packets. Thus, if VIRTIO_NET_HASH_REPORT feature is negotiated, even for a Rx only feature, , the same virtio_net_hdr structure size should be used for both Rx and TX packets. Am I wrong ? Thanks,
-----Original Message-----
From: Parav Pandit <[email protected]>
Sent: Wednesday, May 3, 2023 6:33 PM
To: Cyril Germond <[email protected]>; [email protected]
Subject: Re: [virtio-comment] RE: [PATCH] virtio-net: Fix virtio_net_hdr struct size when VIRTIO_NET_F_HASH_REPORT is negotiated.
Quoted 4 lines · Cyril Germond
From: Cyril Germond <[email protected]>
Sent: Monday, November 21, 2022 10:03 AMHard-coded references to the size of
virtio_net_hdrstrut are wrong whenVIRTIO_NET_HASH_REPORTfeature is negotiated.
Please fix spelling,
s/strut/struct
Below changelog should be after "---", so that it doesnt become part of the commit log.
split-ring.tex \subsection{Legacy Interfaces: A Note on Virtqueue Endianness}\label{sec:Basic F · line 132
Quoted 9 lines
\subsection{Message Framing}\label{sec:Basic Facilities of a Virtio
Device / Virtqueues / Message Framing} The framing of messages with descriptors is -independent of the contents of the buffers. For example, a networksplit-ring.tex +2
-0+independent of the contents of the buffers. For example, if +VIRTIO_NET_F_HASH_REPORT has not been negotiated, a network transmit buffer consists of a 12 byte header followed by the network packet. This could be most simply placed in the descriptor table as a 12 byte output descriptor followed by a 1514 byte output descriptor,
Above change does not look correct as the example is for the Tx. and HASH_REPORT is for the RX.
Once you post the new version as v1 with above fixes, please update the link in the github issue as well.
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: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
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/
Quoted 5 lines
From: Cyril Germond <[email protected]>
Sent: Thursday, May 4, 2023 1:17 PM
Quoted 9 lines
Hello
I agreeVIRTIO_NET_HASH_REPORTfeature is for incoming packets path. Nevertheless, it seems - at least to me but I may be wrong there - that the packet header structure data type - as described in chapter 5.1.6 Device Operation - is the same for the Rx and TX packets.
Thus, ifVIRTIO_NET_HASH_REPORTfeature is negotiated, even for a Rx only feature, , the samevirtio_net_hdrstructure size should be used for both Rx and TX packets. Am I wrong ?
Thanks,
Given the current state of the driver usage and spec it is the same size for tx and rx.
However, the delta change you proposed is modifying a generic non-network device-specific example.
We need a normative line in the section both sections.
5.1.6.2.1 Driver Requirements: Packet Transmission, 5.1.6.2.2 Device Requirements: Packet Transmission
Something like,
For the transmit virtuqueue the driver MUST prepare \field{struct virtio_net_hdr} to be the same size as that of receive virtqueue.
The device MUST consider \field{struct virtio_net_hdr} size for the transmit and the receive virtqueue to be of the same size.