From: Stefano Garzarella <sgarzare@redhat.com>
To: Arseny Krasnov <arseny.krasnov@kaspersky.com>
Cc: Andra Paraschiv <andraprs@amazon.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
cohuck@redhat.com, Colin Ian King <colin.king@canonical.com>,
oxffffaa@gmail.com, Norbert Slusarek <nslusarek@gmx.net>,
Stefan Hajnoczi <stefanha@redhat.com>,
virtio-comment@lists.oasis-open.org,
Jakub Kicinski <kuba@kernel.org>,
virtualization@lists.linux-foundation.org,
"David S. Miller" <davem@davemloft.net>,
Jorgen Hansen <jhansen@vmware.com>
Subject: Re: [virtio-comment] [RFC PATCH v1 1/1] virtio-vsock: add SOCK_SEQPACKET description
Date: Wed, 24 Feb 2021 10:32:00 +0100 [thread overview]
Message-ID: <20210224093200.tpflaqgoap4fe5ax@steredhat> (raw)
In-Reply-To: <20210218060827.1075863-1-arseny.krasnov@kaspersky.com>
On Thu, Feb 18, 2021 at 09:08:23AM +0300, Arseny Krasnov wrote:
>Signed-off-by: Arseny Krasnov <arseny.krasnov@kaspersky.com>
>---
> virtio-vsock.tex | 40 +++++++++++++++++++++++++++++++++++++---
> 1 file changed, 37 insertions(+), 3 deletions(-)
>
>diff --git a/virtio-vsock.tex b/virtio-vsock.tex
>index da7e641..1ee8f99 100644
>--- a/virtio-vsock.tex
>+++ b/virtio-vsock.tex
>@@ -102,6 +102,11 @@ \subsection{Device Operation}\label{sec:Device Types / Socket Device / Device Op
> VIRTIO_VSOCK_OP_CREDIT_UPDATE = 6,
> /* Request the peer to send the credit info to us */
> VIRTIO_VSOCK_OP_CREDIT_REQUEST = 7,
>+
>+ /* Message begin for SOCK_SEQPACKET */
>+ VIRTIO_VSOCK_OP_SEQ_BEGIN = 8,
>+ /* Message end for SOCK_SEQPACKET */
>+ VIRTIO_VSOCK_OP_SEQ_END = 9,
> };
> \end{lstlisting}
>
>@@ -140,11 +145,11 @@ \subsubsection{Addressing}\label{sec:Device Types / Socket Device / Device Opera
> consists of a (cid, port number) tuple. The header fields used for this are
> \field{src_cid}, \field{src_port}, \field{dst_cid}, and \field{dst_port}.
>
>-Currently only stream sockets are supported. \field{type} is 1 for stream
>-socket types.
>+Currently stream and seqpacket sockets are supported. \field{type} is 1 for
>+stream socket types. \field{type} is 2 for seqpacket socket types.
>
> Stream sockets provide in-order, guaranteed, connection-oriented delivery
>-without message boundaries.
>+without message boundaries. Seqpacket sockets also provide message boundaries.
>
> \subsubsection{Buffer Space Management}\label{sec:Device Types / Socket Device / Device Operation / Buffer Space Management}
> \field{buf_alloc} and \field{fwd_cnt} are used for buffer space management of
>@@ -240,6 +245,35 @@ \subsubsection{Stream Sockets}\label{sec:Device Types / Socket Device / Device O
> destination) address tuple for a new connection while the other peer is still
> processing the old connection.
>
>+\subsubsection{Seqpacket Sockets}\label{sec:Device Types / Socket Device / Device Operation / Seqpacket Sockets}
>+
>+Seqpacket sockets differ from stream sockets only in data transmission way: in
>+stream sockets all data is sent using only VIRTIO_VSOCK_OP_RW packets. In
>+seqpacket sockets, to provide message boundaries, every sequence of
>+VIRTIO_VSOCK_OP_RW packets of each message is headed with
^
Since this is a spec, I think we should use MUST when something must be
respected by the peer, for example here we can say "MUST be headed"
>+VIRTIO_VSOCK_OP_SEQ_BEGIN and tailed with VIRTIO_VSOCK_OP_SEQ_END packets.
>+Both VIRTIO_VSOCK_OP_SEQ_BEGIN and VIRTIO_VSOCK_OP_SEQ_END packets carry
^
Same here "MUST carry" and in the rest of the patch.
>+special header in payload:
>+
>+\begin{lstlisting}
>+struct virtio_vsock_seq_hdr {
>+ __le32 msg_cnt;
>+ __le32 msg_len;
>+};
>+\end{lstlisting}
>+
>+\field{msg_cnt} is per socket and incremented by 1 on every send of
>+VIRTIO_VSOCK_OP_SEQ_BEGIN or VIRTIO_VSOCK_OP_SEQ_END. \field{msg_len} contains
>+message length. This header is used to check integrity of each message: message
>+is valid if length of data in VIRTIO_VSOCK_OP_RW packets is equal to
>+\field{msg_len} of prepending VIRTIO_VSOCK_OP_SEQ_BEGIN and \field{msg_cnt} of
>+VIRTIO_VSOCK_OP_SEQ_END differs from \field{msg_cnt} of
>+VIRTIO_VSOCK_OP_SEQ_BEGIN by 1.
If we replace msg_cnt with msg_id, I think we should have the same
'msg_id' for VIRTIO_VSOCK_OP_SEQ_BEGIN or VIRTIO_VSOCK_OP_SEQ_END. If
you want to use 'msg_cnt' and you increment it between BEGIN and END, we
should consider the overflow case.
>+
>+POSIX MSG_EOR flag is supported by special value of \field{flags} in packet's
>+header. If this flag is set for message, then all VIRTIO_VSOCK_OP_RW packets
>+of this message have bit 0 is set to 1 in \field{flags}.
Maybe we need to define what MSG_EOR means.
Thanks,
Stefano
>+
> \subsubsection{Device Events}\label{sec:Device Types / Socket Device / Device Operation / Device Events}
>
> Certain events are communicated by the device to the driver using the event
>--
>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: 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/
>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2021-02-24 9:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210218060715.1075547-1-arseny.krasnov@kaspersky.com>
2021-02-22 10:16 ` [RFC PATCH v1 0/1] virtio-vsock: introduce SEQPACKET description Stefano Garzarella
2021-03-16 13:50 ` [virtio-comment] " Michael S. Tsirkin
2021-03-16 14:08 ` Stefano Garzarella
[not found] ` <20210218060827.1075863-1-arseny.krasnov@kaspersky.com>
2021-02-24 9:32 ` Stefano Garzarella [this message]
2021-03-03 12:08 ` [virtio-comment] [RFC PATCH v1 1/1] virtio-vsock: add SOCK_SEQPACKET description Cornelia Huck
2021-03-03 12:35 ` Stefano Garzarella
2021-03-03 16:52 ` Michael S. Tsirkin
2021-03-03 17:08 ` Cornelia Huck
2021-03-16 13:49 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210224093200.tpflaqgoap4fe5ax@steredhat \
--to=sgarzare@redhat.com \
--cc=andraprs@amazon.com \
--cc=arseny.krasnov@kaspersky.com \
--cc=cohuck@redhat.com \
--cc=colin.king@canonical.com \
--cc=davem@davemloft.net \
--cc=jhansen@vmware.com \
--cc=kuba@kernel.org \
--cc=mst@redhat.com \
--cc=nslusarek@gmx.net \
--cc=oxffffaa@gmail.com \
--cc=stefanha@redhat.com \
--cc=virtio-comment@lists.oasis-open.org \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox