Skip to content

Commit

Permalink
virtio-vsock: add VIRTIO_VSOCK_F_NO_IMPLIED_STREAM feature bit
Browse files Browse the repository at this point in the history
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

Fixes: #142

Suggested-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
  • Loading branch information
stefano-garzarella authored and cohuck committed Aug 3, 2022
1 parent abbe8af commit 26ed30c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
2 changes: 2 additions & 0 deletions conformance.tex
Expand Up @@ -230,6 +230,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}
Expand Down Expand Up @@ -504,6 +505,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}
Expand Down
28 changes: 24 additions & 4 deletions virtio-vsock.tex
Expand Up @@ -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:
Expand Down

0 comments on commit 26ed30c

Please sign in to comment.