* [PATCH v2] virtio-net: Ignore num_buffers when unused
@ 2024-12-27 4:08 Akihiko Odaki
2024-12-27 13:42 ` Michael S. Tsirkin
0 siblings, 1 reply; 2+ messages in thread
From: Akihiko Odaki @ 2024-12-27 4:08 UTC (permalink / raw)
To: virtio-comment
Cc: Michael S. Tsirkin, Jason Wang, Parav Pandit, devel,
Akihiko Odaki
If VIRTIO_NET_F_MRG_RXBUF has not been negotuated, vhost_net and QEMU
leaves num_buffers uninitialized while the specification tells to set it
to one.
Let drivers ignore the field to make them compatible with
vhost_net/QEMU, in a way similar to hdr_len field, which is also
marked as unreliable due to implementation bugs.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
Changes in v2:
- Corrected the change description to tell vhost_net and QEMU leaves
num_buffers uninitialized where it used to tell they set it to zero.
- Restored statements that require devices to set num_buffers to one.
- Link to v1: https://lore.kernel.org/r/20241226-reserved-v1-1-39ca566889c0@daynix.com
---
device-types/net/description.tex | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/device-types/net/description.tex b/device-types/net/description.tex
index 76585b0..70c8b31 100644
--- a/device-types/net/description.tex
+++ b/device-types/net/description.tex
@@ -863,6 +863,12 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network
This is due to various bugs in implementations.
\end{note}
+If VIRTIO_NET_F_MRG_RXBUF has not been negotiated, the driver MUST ignore
+\field{num_buffers}.
+\begin{note}
+This is due to bugs in implementations.
+\end{note}
+
If neither VIRTIO_NET_HDR_F_NEEDS_CSUM nor
VIRTIO_NET_HDR_F_DATA_VALID is set, the driver MUST NOT
rely on the packet checksum being correct.
---
base-commit: b495841a8e80d12c1130f8868f4128866291142d
change-id: 20241226-reserved-d5960f173223
Best regards,
--
Akihiko Odaki <akihiko.odaki@daynix.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] virtio-net: Ignore num_buffers when unused
2024-12-27 4:08 [PATCH v2] virtio-net: Ignore num_buffers when unused Akihiko Odaki
@ 2024-12-27 13:42 ` Michael S. Tsirkin
0 siblings, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2024-12-27 13:42 UTC (permalink / raw)
To: Akihiko Odaki; +Cc: virtio-comment, Jason Wang, Parav Pandit, devel
On Fri, Dec 27, 2024 at 01:08:50PM +0900, Akihiko Odaki wrote:
> If VIRTIO_NET_F_MRG_RXBUF has not been negotuated, vhost_net and QEMU
> leaves num_buffers uninitialized while the specification tells to set it
> to one.
>
> Let drivers ignore the field to make them compatible with
> vhost_net/QEMU, in a way similar to hdr_len field, which is also
> marked as unreliable due to implementation bugs.
>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
> Changes in v2:
> - Corrected the change description to tell vhost_net and QEMU leaves
> num_buffers uninitialized where it used to tell they set it to zero.
> - Restored statements that require devices to set num_buffers to one.
> - Link to v1: https://lore.kernel.org/r/20241226-reserved-v1-1-39ca566889c0@daynix.com
> ---
> device-types/net/description.tex | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/device-types/net/description.tex b/device-types/net/description.tex
> index 76585b0..70c8b31 100644
> --- a/device-types/net/description.tex
> +++ b/device-types/net/description.tex
> @@ -863,6 +863,12 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network
> This is due to various bugs in implementations.
> \end{note}
>
> +If VIRTIO_NET_F_MRG_RXBUF has not been negotiated, the driver MUST ignore
> +\field{num_buffers}.
> +\begin{note}
> +This is due to bugs in implementations.
> +\end{note}
> +
> If neither VIRTIO_NET_HDR_F_NEEDS_CSUM nor
> VIRTIO_NET_HDR_F_DATA_VALID is set, the driver MUST NOT
> rely on the packet checksum being correct.
should
we can not post factum make existing previously compliant drivers non-complient
> ---
> base-commit: b495841a8e80d12c1130f8868f4128866291142d
> change-id: 20241226-reserved-d5960f173223
>
> Best regards,
> --
> Akihiko Odaki <akihiko.odaki@daynix.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-12-27 13:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-27 4:08 [PATCH v2] virtio-net: Ignore num_buffers when unused Akihiko Odaki
2024-12-27 13:42 ` Michael S. Tsirkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox