* [virtio-comment] [PATCH] virtio-net : Fix virtio_net_hdr struct size when VIRTIO_NET_F_HASH_REPORT feature is negociated.
@ 2022-08-04 17:37 Cyril Germond
2022-08-04 19:24 ` Alvaro Karsz
0 siblings, 1 reply; 4+ messages in thread
From: Cyril Germond @ 2022-08-04 17:37 UTC (permalink / raw)
To: virtio-comment
[-- Attachment #1: Type: text/plain, Size: 2155 bytes --]
content.tex | 4 ++--
split-ring.tex | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/content.tex b/content.tex
index e863709..263cb05 100644
--- a/content.tex
+++ b/content.tex
@@ -3620,8 +3620,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 12-byte (or 16-byte if VIRTIO_NET_F_HASH_REPORT feature
has been negotiated) struct virtio_net_hdr is prepended to this,
+making for 65562 or 1526 bytes (respectively 65566 and 1530 bytes if
VIRTIO_NET_F_HASH_REPORT has been negotiated).
\drivernormative{\paragraph}{Setting Up Receive Buffers}{Device Types /
Network Device / Device Operation / Setting Up Receive Buffers}
diff --git a/split-ring.tex b/split-ring.tex
index de94038..e6953d7 100644
--- a/split-ring.tex
+++ b/split-ring.tex
@@ -128,10 +128,10 @@ \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
-transmit buffer consists of a 12 byte header followed by the network
+transmit buffer consists of a 12 (or 16 if VIRTIO_NET_F_HASH_REPORT
feature has been negociated) 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,
-but it could also consist of a single 1526 byte output descriptor in
+12 (or 16) byte output descriptor followed by a 1514 byte output
descriptor,
+but it could also consist of a single 1526 (or 1530) byte output
descriptor in
the case where the header and packet are adjacent, or even three or
more descriptors (possibly with loss of efficiency in that case).
[-- Attachment #2: Type: text/html, Size: 4508 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [virtio-comment] [PATCH] virtio-net : Fix virtio_net_hdr struct size when VIRTIO_NET_F_HASH_REPORT feature is negociated.
2022-08-04 17:37 [virtio-comment] [PATCH] virtio-net : Fix virtio_net_hdr struct size when VIRTIO_NET_F_HASH_REPORT feature is negociated Cyril Germond
@ 2022-08-04 19:24 ` Alvaro Karsz
2022-08-05 6:35 ` Cyril Germond
0 siblings, 1 reply; 4+ messages in thread
From: Alvaro Karsz @ 2022-08-04 19:24 UTC (permalink / raw)
To: Cyril Germond; +Cc: virtio-comment
Hi,
The header size is 20 bytes if VIRTIO_NET_F_HASH_REPORT is negotiated.
struct virtio_net_hdr {
u8 flags;
u8 gso_type;
le16 hdr_len;
le16 gso_size;
le16 csum_start;
le16 csum_offset;
le16 num_buffers;
le32 hash_value; (Only if VIRTIO_NET_F_HASH_REPORT negotiated)
le16 hash_report; (Only if VIRTIO_NET_F_HASH_REPORT negotiated)
le16 padding_reserved; (Only if VIRTIO_NET_F_HASH_REPORT negotiated)
};
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/
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [virtio-comment] [PATCH] virtio-net : Fix virtio_net_hdr struct size when VIRTIO_NET_F_HASH_REPORT feature is negociated.
2022-08-04 19:24 ` Alvaro Karsz
@ 2022-08-05 6:35 ` Cyril Germond
2022-08-09 11:50 ` Cornelia Huck
0 siblings, 1 reply; 4+ messages in thread
From: Cyril Germond @ 2022-08-05 6:35 UTC (permalink / raw)
To: Alvaro Karsz; +Cc: virtio-comment
Hello
You are right indeed - my mistake.
It might even be better (at least less error-prone) to refer to the
sifeof(virtio_net_hdr) in case new fields get added in the future.
In the meantime, here is updated proposal.
BR
Cyril
---
content.tex | 4 ++--
split-ring.tex | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/content.tex b/content.tex
index e863709..95b0425 100644
--- a/content.tex
+++ b/content.tex
@@ -3620,8 +3620,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 12-byte (or 20-byte if VIRTIO_NET_F_HASH_REPORT feature
has been negotiated) struct virtio_net_hdr is prepended to this,
+making for 65562 or 1526 bytes (respectively 65570 and 1534 bytes if
VIRTIO_NET_F_HASH_REPORT has been negotiated).
\drivernormative{\paragraph}{Setting Up Receive Buffers}{Device Types /
Network Device / Device Operation / Setting Up Receive Buffers}
diff --git a/split-ring.tex b/split-ring.tex
index de94038..6f93c9e 100644
--- a/split-ring.tex
+++ b/split-ring.tex
@@ -128,10 +128,10 @@ \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
-transmit buffer consists of a 12 byte header followed by the network
+transmit buffer consists of a 12 (or 20 if VIRTIO_NET_F_HASH_REPORT feature
has been negociated) 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,
-but it could also consist of a single 1526 byte output descriptor in
+12 (or 20) byte output descriptor followed by a 1514 byte output
descriptor,
+but it could also consist of a single 1526 (or 1534) byte output descriptor
in
the case where the header and packet are adjacent, or even three or
more descriptors (possibly with loss of efficiency in that case).
--
-----Original Message-----
From: Alvaro Karsz <alvaro.karsz@solid-run.com>
Sent: Thursday, August 4, 2022 9:24 PM
To: Cyril Germond <cgermond@kalray.eu>
Cc: virtio-comment@lists.oasis-open.org
Subject: Re: [virtio-comment] [PATCH] virtio-net : Fix virtio_net_hdr struct
size when VIRTIO_NET_F_HASH_REPORT feature is negociated.
Hi,
The header size is 20 bytes if VIRTIO_NET_F_HASH_REPORT is negotiated.
struct virtio_net_hdr {
u8 flags;
u8 gso_type;
le16 hdr_len;
le16 gso_size;
le16 csum_start;
le16 csum_offset;
le16 num_buffers;
le32 hash_value; (Only if VIRTIO_NET_F_HASH_REPORT
negotiated)
le16 hash_report; (Only if VIRTIO_NET_F_HASH_REPORT
negotiated)
le16 padding_reserved; (Only if VIRTIO_NET_F_HASH_REPORT
negotiated) };
To declare a filtering error, please use the following link :
https://www.security-mail.net/reporter.php?mid=62c2.62ec1d06.258ee.0&r=cgermond%40kalray.eu&s=alvaro.karsz%40solid-run.com&o=Re%3A+%5Bvirtio-comment%5D+%5BPATCH%5D+virtio-net+%3A+Fix+virtio_net_hdr+struct+size+when+VIRTIO_NET_F_HASH_REPORT+feature+is+negociated.&verdict=C&c=ed2662797903b4423f528eab3fae6cc47b606e8b
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/
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [virtio-comment] [PATCH] virtio-net : Fix virtio_net_hdr struct size when VIRTIO_NET_F_HASH_REPORT feature is negociated.
2022-08-05 6:35 ` Cyril Germond
@ 2022-08-09 11:50 ` Cornelia Huck
0 siblings, 0 replies; 4+ messages in thread
From: Cornelia Huck @ 2022-08-09 11:50 UTC (permalink / raw)
To: Cyril Germond, Alvaro Karsz; +Cc: virtio-comment
On Fri, Aug 05 2022, Cyril Germond <cgermond@kalray.eu> wrote:
> Hello
> You are right indeed - my mistake.
> It might even be better (at least less error-prone) to refer to the
> sifeof(virtio_net_hdr) in case new fields get added in the future.
>
> In the meantime, here is updated proposal.
> BR
> Cyril
> ---
> content.tex | 4 ++--
> split-ring.tex | 6 +++---
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/content.tex b/content.tex
> index e863709..95b0425 100644
> --- a/content.tex
> +++ b/content.tex
> @@ -3620,8 +3620,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 12-byte (or 20-byte if VIRTIO_NET_F_HASH_REPORT feature
> has been negotiated) struct virtio_net_hdr is prepended to this,
> +making for 65562 or 1526 bytes (respectively 65570 and 1534 bytes if
> VIRTIO_NET_F_HASH_REPORT has been negotiated).
Your mail client seems to add line wraps, which means that the patch
cannot be applied by git am (and it makes the change hard to
read). Please consider using git send-email, as described in
https://github.com/oasis-tcs/virtio-spec#providing-feedback.
>
> \drivernormative{\paragraph}{Setting Up Receive Buffers}{Device Types /
> Network Device / Device Operation / Setting Up Receive Buffers}
>
> diff --git a/split-ring.tex b/split-ring.tex
> index de94038..6f93c9e 100644
> --- a/split-ring.tex
> +++ b/split-ring.tex
> @@ -128,10 +128,10 @@ \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
> -transmit buffer consists of a 12 byte header followed by the network
> +transmit buffer consists of a 12 (or 20 if VIRTIO_NET_F_HASH_REPORT feature
> has been negociated) 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,
> -but it could also consist of a single 1526 byte output descriptor in
> +12 (or 20) byte output descriptor followed by a 1514 byte output
> descriptor,
> +but it could also consist of a single 1526 (or 1534) byte output descriptor
> in
> the case where the header and packet are adjacent, or even three or
> more descriptors (possibly with loss of efficiency in that case).
As this is only an example, maybe it is better to simply prefix it with
"For example, if VIRTIO_NET_F_HASH_REPORT has not been negotiated, a
network transmit buffer consists of..."
so that you don't need to consider the separate cases, which make the
example harder to read (and don't help to illustrate the process of
deciding on a descriptor layout).
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/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-08-09 11:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-04 17:37 [virtio-comment] [PATCH] virtio-net : Fix virtio_net_hdr struct size when VIRTIO_NET_F_HASH_REPORT feature is negociated Cyril Germond
2022-08-04 19:24 ` Alvaro Karsz
2022-08-05 6:35 ` Cyril Germond
2022-08-09 11:50 ` Cornelia Huck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.