All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Arseny Krasnov <arseny.krasnov@kaspersky.com>
Cc: virtio-comment@lists.oasis-open.org,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Stefano Garzarella <sgarzare@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Jorgen Hansen <jhansen@vmware.com>,
	Norbert Slusarek <nslusarek@gmx.net>,
	Colin Ian King <colin.king@canonical.com>,
	Andra Paraschiv <andraprs@amazon.com>,
	virtualization@lists.linux-foundation.org, oxffffaa@gmail.com
Subject: [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants
Date: Mon, 15 Mar 2021 16:53:50 +0100	[thread overview]
Message-ID: <20210315165350.7377478e.cohuck@redhat.com> (raw)
In-Reply-To: <20210315083547.2283420-1-arseny.krasnov@kaspersky.com>

On Mon, 15 Mar 2021 11:35:41 +0300
Arseny Krasnov <arseny.krasnov@kaspersky.com> wrote:

> This replaces constants defined in "bit X set to Y" manner
> with enums from Linux kernel uapi headers.
> ---
>  virtio-vsock.tex | 29 ++++++++++++++++++++++-------
>  1 file changed, 22 insertions(+), 7 deletions(-)
> 
> diff --git a/virtio-vsock.tex b/virtio-vsock.tex
> index da7e641..a97a81e 100644
> --- a/virtio-vsock.tex
> +++ b/virtio-vsock.tex
> @@ -140,8 +140,14 @@ \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 only stream sockets are supported. \field{type} is one of the
> +following constants:
> +
> +\begin{lstlisting}
> +enum virtio_vsock_type {
> +	VIRTIO_VSOCK_TYPE_STREAM = 1,
> +};
> +\end{lstlisting}
>  
>  Stream sockets provide in-order, guaranteed, connection-oriented delivery
>  without message boundaries.
> @@ -221,11 +227,20 @@ \subsubsection{Stream Sockets}\label{sec:Device Types / Socket Device / Device O
>  a listening socket does not exist on the destination or the destination has
>  insufficient resources to establish the connection.
>  
> -When a connected socket receives VIRTIO_VSOCK_OP_SHUTDOWN the header
> -\field{flags} field bit 0 indicates that the peer will not receive any more
> -data and bit 1 indicates that the peer will not send any more data.  These
> -hints are permanent once sent and successive packets with bits clear do not
> -reset them.
> +When a connected socket receives VIRTIO_VSOCK_OP_SHUTDOWN, header \field{flags}
> +field is one of the following constants:

I don't think these two are required to be mutually exclusive (i.e.
both can be indicated at the same time?)

> +
> +\begin{lstlisting}
> +enum virtio_vsock_shutdown {
> +	VIRTIO_VSOCK_SHUTDOWN_RCV = 1,
> +	VIRTIO_VSOCK_SHUTDOWN_SEND = 2,
> +};
> +\end{lstlisting}
> +
> +VIRTIO_VSOCK_SHUTDOWN_RCV indicates that the peer will not receive any more
> +data and VIRTIO_VSOCK_SHUTDOWN_SEND indicates that the peer will not send
> +any more data.  These hints are permanent once sent and successive packets
> +with bits clear do not reset them.
>  
>  The VIRTIO_VSOCK_OP_RST packet aborts the connection process or forcibly
>  disconnects a connected socket.


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/


WARNING: multiple messages have this Message-ID (diff)
From: Cornelia Huck <cohuck@redhat.com>
To: Arseny Krasnov <arseny.krasnov@kaspersky.com>
Cc: Andra Paraschiv <andraprs@amazon.com>,
	"Michael S. Tsirkin" <mst@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: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants
Date: Mon, 15 Mar 2021 16:53:50 +0100	[thread overview]
Message-ID: <20210315165350.7377478e.cohuck@redhat.com> (raw)
In-Reply-To: <20210315083547.2283420-1-arseny.krasnov@kaspersky.com>

On Mon, 15 Mar 2021 11:35:41 +0300
Arseny Krasnov <arseny.krasnov@kaspersky.com> wrote:

> This replaces constants defined in "bit X set to Y" manner
> with enums from Linux kernel uapi headers.
> ---
>  virtio-vsock.tex | 29 ++++++++++++++++++++++-------
>  1 file changed, 22 insertions(+), 7 deletions(-)
> 
> diff --git a/virtio-vsock.tex b/virtio-vsock.tex
> index da7e641..a97a81e 100644
> --- a/virtio-vsock.tex
> +++ b/virtio-vsock.tex
> @@ -140,8 +140,14 @@ \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 only stream sockets are supported. \field{type} is one of the
> +following constants:
> +
> +\begin{lstlisting}
> +enum virtio_vsock_type {
> +	VIRTIO_VSOCK_TYPE_STREAM = 1,
> +};
> +\end{lstlisting}
>  
>  Stream sockets provide in-order, guaranteed, connection-oriented delivery
>  without message boundaries.
> @@ -221,11 +227,20 @@ \subsubsection{Stream Sockets}\label{sec:Device Types / Socket Device / Device O
>  a listening socket does not exist on the destination or the destination has
>  insufficient resources to establish the connection.
>  
> -When a connected socket receives VIRTIO_VSOCK_OP_SHUTDOWN the header
> -\field{flags} field bit 0 indicates that the peer will not receive any more
> -data and bit 1 indicates that the peer will not send any more data.  These
> -hints are permanent once sent and successive packets with bits clear do not
> -reset them.
> +When a connected socket receives VIRTIO_VSOCK_OP_SHUTDOWN, header \field{flags}
> +field is one of the following constants:

I don't think these two are required to be mutually exclusive (i.e.
both can be indicated at the same time?)

> +
> +\begin{lstlisting}
> +enum virtio_vsock_shutdown {
> +	VIRTIO_VSOCK_SHUTDOWN_RCV = 1,
> +	VIRTIO_VSOCK_SHUTDOWN_SEND = 2,
> +};
> +\end{lstlisting}
> +
> +VIRTIO_VSOCK_SHUTDOWN_RCV indicates that the peer will not receive any more
> +data and VIRTIO_VSOCK_SHUTDOWN_SEND indicates that the peer will not send
> +any more data.  These hints are permanent once sent and successive packets
> +with bits clear do not reset them.
>  
>  The VIRTIO_VSOCK_OP_RST packet aborts the connection process or forcibly
>  disconnects a connected socket.

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2021-03-15 15:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15  8:35 [virtio-comment] [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants Arseny Krasnov
2021-03-15 15:53 ` Cornelia Huck [this message]
2021-03-15 15:53   ` Cornelia Huck
2021-03-16  3:35   ` [virtio-comment] Re: [MASSMAIL KLMS] [virtio-comment] " Arseny Krasnov
2021-03-16  8:11     ` Cornelia Huck
2021-03-16  8:11       ` Cornelia Huck
2021-03-16 13:23       ` [virtio-comment] " Michael S. Tsirkin
2021-03-16 13:23         ` Michael S. Tsirkin
2021-03-16 13:38         ` [virtio-comment] " Cornelia Huck
2021-03-16 13:38           ` Cornelia Huck
2021-03-16  8:19     ` [virtio-comment] " Stefano Garzarella
2021-03-16  8:19       ` Stefano Garzarella
2021-03-16  8:54       ` [virtio-comment] " Arseny Krasnov

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=20210315165350.7377478e.cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=andraprs@amazon.com \
    --cc=arseny.krasnov@kaspersky.com \
    --cc=colin.king@canonical.com \
    --cc=davem@davemloft.net \
    --cc=jasowang@redhat.com \
    --cc=jhansen@vmware.com \
    --cc=kuba@kernel.org \
    --cc=mst@redhat.com \
    --cc=nslusarek@gmx.net \
    --cc=oxffffaa@gmail.com \
    --cc=sgarzare@redhat.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 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.