virtio-vsock: add VIRTIO_VSOCK_F_NO_IMPLIED_STREAM feature bit
PATCH v2 1/1 virtio-vsock: add VIRTIO_VSOCK_F_NO_IMPLIED_STREAM feature bit
Initially virtio-vsock only supported the stream type, which is why there was no feature. Later we added the seqpacket type and in the future we may have other types (e.g. datagram).
seqpacket is an extension of stream, so it might be implied that if seqpacket is supported, stream is too, but this might not be true for other types.
As we discussed here [1] should be better to add a new VIRTIO_VSOCK_F_NO_IMPLIED_STREAM feature bit to avoid this implication.
Let's also add normative sections to better define the behavior when VIRTIO_VSOCK_F_NO_IMPLIED_STREAM is negotiated or not.
[1] http://markmail.org/message/2s3qd74drgjxkvte
---
v2:
- rewrote better normative statements [Cornelia]
- updated conformance.tex with the new sections [Cornelia]
v1: https://markmail.org/message/ybtl4trifrhjnkfe
--- conformance.tex | 2 ++ virtio-vsock.tex | 28 ++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-)
conformance.tex +2 -0
@@ -229,6 +229,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} A socket driver MUST conform to the following normative statements: \begin{itemize} +\item \ref{drivernormative:Device Types / Socket Device / Feature bits} \item \ref{drivernormative:Device Types / Socket Device / Device Operation / Buffer Space Management} \item \ref{drivernormative:Device Types / Socket Device / Device Operation / Receive and Transmit} \item \ref{drivernormative:Device Types / Socket Device / Device Operation / Device Events}
@@ -500,6 +501,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} A socket device MUST conform to the following normative statements: \begin{itemize} +\item \ref{devicenormative:Device Types / Socket Device / Feature bits} \item \ref{devicenormative:Device Types / Socket Device / Device Operation / Buffer Space Management} \item \ref{devicenormative:Device Types / Socket Device / Device Operation / Receive and Transmit} \end{itemize}
virtio-vsock.tex +24 -4
@@ -16,15 +16,35 @@ \subsection{Virtqueues}\label{sec:Device Types / Socket Device / Virtqueues} \subsection{Feature bits}\label{sec:Device Types / Socket Device / Feature bits} -If no feature bit is set, only stream socket type is supported. -If VIRTIO_VSOCK_F_SEQPACKET has been negotiated, the device MAY act -as if VIRTIO_VSOCK_F_STREAM has also been negotiated. - \begin{description} \item[VIRTIO_VSOCK_F_STREAM (0)] stream socket type is supported. \item[VIRTIO_VSOCK_F_SEQPACKET (1)] seqpacket socket type is supported. +\item[VIRTIO_VSOCK_F_NO_IMPLIED_STREAM (2)] stream socket type is not implied. \end{description} +\drivernormative{\subsubsection}{Feature bits}{Device Types / Socket Device / Feature bits} + +The driver SHOULD accept the VIRTIO_VSOCK_F_NO_IMPLIED_STREAM feature if +offered by the device. + +If no feature bit has been negotiated, the driver SHOULD act as if +VIRTIO_VSOCK_F_STREAM has been negotiated. + +If VIRTIO_VSOCK_F_SEQPACKET has been negotiated, but not +VIRTIO_VSOCK_F_NO_IMPLIED_STREAM, the driver MAY act as if +VIRTIO_VSOCK_F_STREAM has also been negotiated. + +\devicenormative{\subsubsection}{Feature bits}{Device Types / Socket Device / Feature bits} + +The device SHOULD offer the VIRTIO_VSOCK_F_NO_IMPLIED_STREAM feature. + +If no feature bit has been negotiated, the device SHOULD act as if +VIRTIO_VSOCK_F_STREAM has been negotiated. + +If VIRTIO_VSOCK_F_SEQPACKET has been negotiated, but not +VIRTIO_VSOCK_F_NO_IMPLIED_STREAM, the device MAY act as if +VIRTIO_VSOCK_F_STREAM has also been negotiated. + \subsection{Device configuration layout}\label{sec:Device Types / Socket Device / Device configuration layout} Socket device configuration uses the following layout structure:
Signature · 1 line
2.36.1
Quoted 23 lines · Stefano Garzarella
Initially virtio-vsock only supported the stream type, which is why there was no feature. Later we added the seqpacket type and in the future we may have other types (e.g. datagram).
seqpacket is an extension of stream, so it might be implied that if seqpacket is supported, stream is too, but this might not be true for other types.
As we discussed here [1] should be better to add a new
VIRTIO_VSOCK_F_NO_IMPLIED_STREAMfeature bit to avoid this implication.Let's also add normative sections to better define the behavior when
VIRTIO_VSOCK_F_NO_IMPLIED_STREAMis negotiated or not.[1] http://markmail.org/message/2s3qd74drgjxkvte
Suggested-by Michael S. Tsirkin <[email protected]>Signed-off-by Stefano Garzarella <[email protected]>---
v2:
- rewrote better normative statements [Cornelia]
- updated conformance.tex with the new sections [Cornelia]
Quoted 5 lines
v1: https://markmail.org/message/ybtl4trifrhjnkfe
--- conformance.tex | 2 ++ virtio-vsock.tex | 28 ++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-)
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/
Hey Stefano,
Please excuse the late reply to this thread.
I am trying to think through the imagined usage of this bit. Following the referenced threads,
I am not sure I can clearly see under what version combinations of driver/device that the bit will be used.
Given that feature bits being zero imply stream support, and VIRTIO_VSOCK_F_{STREAM,SEQPACKET,DGRAM}
all existing (dgram in the future), how does NO_IMPLIED_STREAM=1 differ from STREAM=0, SEQPACKET=0,
and DGRAM=1 (for example)?
Thanks,
Bobby
PS. Sorry for the odd [External] prefix... That comes from our company email system.
From: "Stefano Garzarella"<[email protected]>
Date: Mon, Jul 18, 2022, 7:27 AM
Subject: [External] [PATCH v2] virtio-vsock: add VIRTIO_VSOCK_F_NO_IMPLIED_STREAM feature bit
To: <[email protected]>
Cc: <[email protected]>, "Stefan Hajnoczi"<[email protected]>, "Arseniy Krasnov"<[email protected]>, "Michael S . Tsirkin"<[email protected]>, < [email protected]>, "Cornelia Huck"<[email protected]>, "Stefano Garzarella"<[email protected]>
Initially virtio-vsock only supported the stream type, which is why there was no feature. Later we added the seqpacket type and in the future we may have other types (e.g. datagram). seqpacket is an extension of stream, so it might be implied that if seqpacket is supported, stream is too, but this might not be true for other types. As we discussed here [1] should be better to add a new VIRTIO_VSOCK_F_NO_IMPLIED_STREAM feature bit to avoid this implication. Let's also add normative sections to better define the behavior when VIRTIO_VSOCK_F_NO_IMPLIED_STREAM is negotiated or not. [1]
http://markmail.org/message/2s3qd74drgjxkvte Suggested-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Stefano Garzarella < [email protected]> --- v2: - rewrote better normative statements [Cornelia] - updated conformance.tex with the new sections [Cornelia] v1:
https://markmail.org/message/ybtl4trifrhjnkfe --- conformance.tex | 2 ++ virtio-vsock.tex | 28 ++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/conformance.tex b/conformance.tex index 663e7c3..98626ba 100644 --- a/conformance.tex +++ b/conformance.tex @@ -229,6 +229,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} A socket driver MUST conform to the following normative statements: \begin{itemize} +\item \ref{drivernormative:Device Types / Socket Device / Feature bits} \item \ref{drivernormative:Device Types / Socket Device / Device Operation / Buffer Space Management} \item \ref{drivernormative:Device Types / Socket Device / Device Operation / Receive and Transmit} \item \ref{drivernormative:Device Types / Socket Device / Device Operation / Device Events} @@ -500,6 +501,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} A socket device MUST conform to the following normative statements: \begin{itemize} +\item \ref{devicenormative:Device Types / Socket Device / Feature bits} \item \ref{devicenormative:Device Types / Socket Device / Device Operation / Buffer Space Management} \item \ref{devicenormative:Device Types / Socket Device / Device Operation / Receive and Transmit} \end{itemize} diff --git a/virtio-vsock.tex b/virtio-vsock.tex index d79984d..b3ff45a 100644 --- a/virtio-vsock.tex +++ b/virtio-vsock.tex @@ -16,15 +16,35 @@ \subsection{Virtqueues}\label{sec:Device Types / Socket Device / Virtqueues} \subsection{Feature bits}\label{sec:Device Types / Socket Device / Feature bits} -If no feature bit is set, only stream socket type is supported. -If VIRTIO_VSOCK_F_SEQPACKET has been negotiated, the device MAY act -as if VIRTIO_VSOCK_F_STREAM has also been negotiated. - \begin{description} \item[VIRTIO_VSOCK_F_STREAM (0)] stream socket type is supported. \item[VIRTIO_VSOCK_F_SEQPACKET (1)] seqpacket socket type is supported. +\item[VIRTIO_VSOCK_F_NO_IMPLIED_STREAM (2)] stream socket type is not implied. \end{description} +\drivernormative{\subsubsection}{Feature bits}{Device Types / Socket Device / Feature bits} + +The driver SHOULD accept the VIRTIO_VSOCK_F_NO_IMPLIED_STREAM feature if +offered by the device. + +If no feature bit has been negotiated, the driver SHOULD act as if +VIRTIO_VSOCK_F_STREAM has been negotiated. + +If VIRTIO_VSOCK_F_SEQPACKET has been negotiated, but not +VIRTIO_VSOCK_F_NO_IMPLIED_STREAM, the driver MAY act as if +VIRTIO_VSOCK_F_STREAM has also been negotiated. + +\devicenormative{\subsubsection}{Feature bits}{Device Types / Socket Device / Feature bits} + +The device SHOULD offer the VIRTIO_VSOCK_F_NO_IMPLIED_STREAM feature. + +If no feature bit has been negotiated, the device SHOULD act as if +VIRTIO_VSOCK_F_STREAM has been negotiated. + +If VIRTIO_VSOCK_F_SEQPACKET has been negotiated, but not +VIRTIO_VSOCK_F_NO_IMPLIED_STREAM, the device MAY act as if +VIRTIO_VSOCK_F_STREAM has also been negotiated. + \subsection{Device configuration layout}\label{sec:Device Types / Socket Device / Device configuration layout} Socket device configuration uses the following layout
structure: -- 2.36.1
Hi Bobby,
Quoted 3 lines · Bobby Eshleman
Hey Stefano,
Please excuse the late reply to this thread.
No problems at all!
Quoted 6 lines
I am trying to think through the imagined usage of this bit. Following the referenced threads,
I am not sure I can clearly see under what version combinations of driver/device that the bit will be used.
The main reason is to continue to support the current implementation.
If we had F_STREAM from the beginning when we introduced virtio-vsock, then there would have been no need for F_NO_IMPLIED_STREAM, but unfortunately, that was not the case.
If we look at the current implementation in Linux (virtio-vsock and vhost-vsock), F_STREAM is not negotiated. We added it in the specification, but not yet implemented.
That's because the driver and device were designed to support only stream sockets, so it was implied as a feature.
Then we added seqpacket, which is somehow an extension of stream sockets, so we only negotiated F_SEQPACKET (unfortunately we merged the patch too early before we better defined F_STREAM). Leaving support for stream sockets implied.
At this point we realized that if we would add another type, completely unrelated to stream (e.g. datagram), it would be complicated to negotiate only datagram support without stream.
Quoted 5 lines
Given that feature bits being zero imply stream support, and VIRTIO_VSOCK_F_{STREAM,SEQPACKET,DGRAM}
all existing (dgram in the future), how does NO_IMPLIED_STREAM=1 differ from STREAM=0, SEQPACKET=0,
and DGRAM=1 (for example)?
Unfortunately, even when the feature bits are non-zero (F_SEQPACKET negotiated), we still support stream sockets implicitly.
So adding F_NO_IMPLIED_STREAM, just to make sure that if F_STREAM is not negotiated, then really the device/driver doesn't support it. As we wrote in the specification, all drivers and devices in the future should negotiate F_NO_IMPLIED_STREAM to avoid ambiguity.
It's basically a way to be compatible with the current implementation and have backward compatibility in the future.
Thanks,
Stefano
I see, thank you for the clarification. Sorry for the late response, I just noticed this ACK was left in my draft box.
Thanks again,
Bobby
From: "Stefano Garzarella"<[email protected]>
Date: Tue, Jul 19, 2022, 1:04 AM
Subject: Re: [External] [PATCH v2] virtio-vsock: add VIRTIO_VSOCK_F_NO_IMPLIED_STREAM feature bit
To: "Bobby Eshleman"<[email protected]>
Cc: <[email protected]>, <[email protected]>, "Stefan Hajnoczi"<[email protected]>, "Arseniy Krasnov"<[email protected]>, "Michael S . Tsirkin"<[email protected]>, "Cornelia Huck"<[email protected]>
Quoted 1 line · Bobby Eshleman
Hey Stefano, > >Please excuse the late reply to this thread. No problems
at all! > >I am trying to think through the imagined usage of this bit. Following the >referenced threads, >I am not sure I can clearly see under what version combinations of >driver/device that the bit will be used. > The main reason is to continue to support the current implementation. If we had F_STREAM from the beginning when we introduced virtio-vsock, then there would have been no need for F_NO_IMPLIED_STREAM, but unfortunately, that was not the case. If we look at the current implementation in Linux (virtio-vsock and vhost-vsock), F_STREAM is not negotiated. We added it in the specification, but not yet implemented. That's because the driver and device were designed to support only stream sockets, so it was implied as a feature. Then we added seqpacket, which is somehow an extension of stream sockets, so we only negotiated F_SEQPACKET (unfortunately we merged the patch too early before we better defined F_STREAM). Leaving support for stream sockets implied. At this point we realized that if we would add another type, completely unrelated to stream (e.g. datagram), it would be complicated to negotiate only datagram support without stream. >Given that feature bits being zero imply stream support, and
Quoted 1 line
VIRTIO_VSOCK_F_{STREAM,SEQPACKET,DGRAM} >all existing (dgram in the
future), how does NO_IMPLIED_STREAM=1 differ >from STREAM=0, SEQPACKET=0,
Quoted 1 line
and DGRAM=1 (for example)? Unfortunately, even when the feature bits are
non-zero (F_SEQPACKET negotiated), we still support stream sockets implicitly. So adding F_NO_IMPLIED_STREAM, just to make sure that if F_STREAM is not negotiated, then really the device/driver doesn't support it. As we wrote in the specification, all drivers and devices in the future should negotiate F_NO_IMPLIED_STREAM to avoid ambiguity. It's basically a way to be compatible with the current implementation and have backward compatibility in the future. Thanks, Stefano
Quoted 8 lines · Stefano Garzarella
Initially virtio-vsock only supported the stream type, which is why there was no feature. Later we added the seqpacket type and in the future we may have other types (e.g. datagram).
seqpacket is an extension of stream, so it might be implied that if seqpacket is supported, stream is too, but this might not be true for other types.
Quoted 8 lines
As we discussed here [1] should be better to add a new
VIRTIO_VSOCK_F_NO_IMPLIED_STREAMfeature bit to avoid this implication.Let's also add normative sections to better define the behavior when
VIRTIO_VSOCK_F_NO_IMPLIED_STREAMis negotiated or not.
PR opened.
Thanks,
Stefano
Quoted 80 lines
Suggested-by Michael S. Tsirkin <[email protected]>Signed-off-by Stefano Garzarella <[email protected]>---
v2:
- rewrote better normative statements [Cornelia]
- updated conformance.tex with the new sections [Cornelia]v1: https://markmail.org/message/ybtl4trifrhjnkfe
---
conformance.tex | 2 ++
virtio-vsock.tex | 28 ++++++++++++++++++++++++----2 files changed, 26 insertions(+), 4 deletions(-)conformance.tex +0
-0@@ -229,6 +229,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}A socket driver MUST conform to the following normative statements:
\begin{itemize}
+\item \ref{drivernormative:Device Types / Socket Device / Feature bits}
\item \ref{drivernormative:Device Types / Socket Device / Device Operation / Buffer Space Management} \item \ref{drivernormative:Device Types / Socket Device / Device Operation / Receive and Transmit} \item \ref{drivernormative:Device Types / Socket Device / Device Operation / Device Events}conformance.tex +0
-0@@ -500,6 +501,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}A socket device MUST conform to the following normative statements:
\begin{itemize}
+\item \ref{devicenormative:Device Types / Socket Device / Feature bits}
\item \ref{devicenormative:Device Types / Socket Device / Device Operation / Buffer Space Management} \item \ref{devicenormative:Device Types / Socket Device / Device Operation / Receive and Transmit} \end{itemize}virtio-vsock.tex +0
-4@@ -16,15 +16,35 @@ \subsection{Virtqueues}\label{sec:Device Types / Socket Device / Virtqueues} \subsection{Feature bits}\label{sec:Device Types / Socket Device / Feature bits} -If no feature bit is set, only stream socket type is supported. -If VIRTIO_VSOCK_F_SEQPACKET has been negotiated, the device MAY act -as if VIRTIO_VSOCK_F_STREAM has also been negotiated. - \begin{description}\item[VIRTIO_VSOCK_F_STREAM (0)] stream socket type is supported. \item[VIRTIO_VSOCK_F_SEQPACKET (1)] seqpacket socket type is supported. +\item[VIRTIO_VSOCK_F_NO_IMPLIED_STREAM (2)] stream socket type is not implied. \end{description}
+\drivernormative{\subsubsection}{Feature bits}{Device Types / Socket Device / Feature bits}
virtio-vsock.tex +22
-0+ +The driver SHOULD accept the VIRTIO_VSOCK_F_NO_IMPLIED_STREAM feature if +offered by the device. + +If no feature bit has been negotiated, the driver SHOULD act as if +VIRTIO_VSOCK_F_STREAM has been negotiated. + +If VIRTIO_VSOCK_F_SEQPACKET has been negotiated, but not +VIRTIO_VSOCK_F_NO_IMPLIED_STREAM, the driver MAY act as if +VIRTIO_VSOCK_F_STREAM has also been negotiated. + +\devicenormative{\subsubsection}{Feature bits}{Device Types / Socket Device / Feature bits} + +The device SHOULD offer the VIRTIO_VSOCK_F_NO_IMPLIED_STREAM feature. + +If no feature bit has been negotiated, the device SHOULD act as if +VIRTIO_VSOCK_F_STREAM has been negotiated. + +If VIRTIO_VSOCK_F_SEQPACKET has been negotiated, but not +VIRTIO_VSOCK_F_NO_IMPLIED_STREAM, the device MAY act as if +VIRTIO_VSOCK_F_STREAM has also been negotiated. +\subsection{Device configuration layout}\label{sec:Device Types / Socket Device / Device configuration layout}
Socket device configuration uses the following layout structure:
Signature · 1 line
2.36.1
Quoted 11 lines · Stefano Garzarella
Initially virtio-vsock only supported the stream type, which is why there was no feature. Later we added the seqpacket type and in the future we may have other types (e.g. datagram).
seqpacket is an extension of stream, so it might be implied that if seqpacket is supported, stream is too, but this might not be true for other types.
As we discussed here [1] should be better to add a new
VIRTIO_VSOCK_F_NO_IMPLIED_STREAMfeature bit to avoid this implication.
Quoted 7 lines
Let's also add normative sections to better define the behavior when
VIRTIO_VSOCK_F_NO_IMPLIED_STREAMis negotiated or not.[1] http://markmail.org/message/2s3qd74drgjxkvte
Suggested-by Michael S. Tsirkin <[email protected]>Signed-off-by Stefano Garzarella <[email protected]>
Quoted 77 lines
---
v2:
- rewrote better normative statements [Cornelia]
- updated conformance.tex with the new sections [Cornelia]v1: https://markmail.org/message/ybtl4trifrhjnkfe
--- conformance.tex | 2 ++ virtio-vsock.tex | 28 ++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-)conformance.tex +2
-0@@ -229,6 +229,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} A socket driver MUST conform to the following normative statements: \begin{itemize} +\item \ref{drivernormative:Device Types / Socket Device / Feature bits} \item \ref{drivernormative:Device Types / Socket Device / Device Operation / Buffer Space Management} \item \ref{drivernormative:Device Types / Socket Device / Device Operation / Receive and Transmit} \item \ref{drivernormative:Device Types / Socket Device / Device Operation / Device Events}@@ -500,6 +501,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} A socket device MUST conform to the following normative statements: \begin{itemize} +\item \ref{devicenormative:Device Types / Socket Device / Feature bits} \item \ref{devicenormative:Device Types / Socket Device / Device Operation / Buffer Space Management} \item \ref{devicenormative:Device Types / Socket Device / Device Operation / Receive and Transmit} \end{itemize}virtio-vsock.tex +24
-4@@ -16,15 +16,35 @@ \subsection{Virtqueues}\label{sec:Device Types / Socket Device / Virtqueues} \subsection{Feature bits}\label{sec:Device Types / Socket Device / Feature bits} -If no feature bit is set, only stream socket type is supported. -If VIRTIO_VSOCK_F_SEQPACKET has been negotiated, the device MAY act -as if VIRTIO_VSOCK_F_STREAM has also been negotiated. - \begin{description} \item[VIRTIO_VSOCK_F_STREAM (0)] stream socket type is supported. \item[VIRTIO_VSOCK_F_SEQPACKET (1)] seqpacket socket type is supported. +\item[VIRTIO_VSOCK_F_NO_IMPLIED_STREAM (2)] stream socket type is not implied. \end{description} +\drivernormative{\subsubsection}{Feature bits}{Device Types / Socket Device / Feature bits} + +The driver SHOULD accept the VIRTIO_VSOCK_F_NO_IMPLIED_STREAM feature if +offered by the device. + +If no feature bit has been negotiated, the driver SHOULD act as if +VIRTIO_VSOCK_F_STREAM has been negotiated. + +If VIRTIO_VSOCK_F_SEQPACKET has been negotiated, but not +VIRTIO_VSOCK_F_NO_IMPLIED_STREAM, the driver MAY act as if +VIRTIO_VSOCK_F_STREAM has also been negotiated. + +\devicenormative{\subsubsection}{Feature bits}{Device Types / Socket Device / Feature bits} + +The device SHOULD offer the VIRTIO_VSOCK_F_NO_IMPLIED_STREAM feature. + +If no feature bit has been negotiated, the device SHOULD act as if +VIRTIO_VSOCK_F_STREAM has been negotiated. + +If VIRTIO_VSOCK_F_SEQPACKET has been negotiated, but not +VIRTIO_VSOCK_F_NO_IMPLIED_STREAM, the device MAY act as if +VIRTIO_VSOCK_F_STREAM has also been negotiated. + \subsection{Device configuration layout}\label{sec:Device Types / Socket Device / Device configuration layout} Socket device configuration uses the following layout structure:Signature · 1 line
2.36.1