All of lore.kernel.org
 help / color / mirror / Atom feed
* [virtio-comment] [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants
@ 2021-03-15  8:35 Arseny Krasnov
  2021-03-15 15:53   ` [virtio-comment] " Cornelia Huck
  0 siblings, 1 reply; 13+ messages in thread
From: Arseny Krasnov @ 2021-03-15  8:35 UTC (permalink / raw)
  To: cohuck, virtio-comment, Stefan Hajnoczi, Stefano Garzarella,
	Michael S. Tsirkin, Jason Wang, David S. Miller, Jakub Kicinski,
	Arseny Krasnov, Jorgen Hansen, Norbert Slusarek, Colin Ian King,
	Andra Paraschiv
  Cc: virtualization, oxffffaa

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:
+
+\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.
-- 
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/


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants
  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
  0 siblings, 0 replies; 13+ messages in thread
From: Cornelia Huck @ 2021-03-15 15:53 UTC (permalink / raw)
  To: Arseny Krasnov
  Cc: Andra Paraschiv, Michael S. Tsirkin, Colin Ian King, oxffffaa,
	Norbert Slusarek, Stefan Hajnoczi, virtio-comment,
	Jakub Kicinski, virtualization, David S. Miller, Jorgen Hansen

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants
@ 2021-03-15 15:53   ` Cornelia Huck
  0 siblings, 0 replies; 13+ messages in thread
From: Cornelia Huck @ 2021-03-15 15:53 UTC (permalink / raw)
  To: Arseny Krasnov
  Cc: virtio-comment, Stefan Hajnoczi, Stefano Garzarella,
	Michael S. Tsirkin, Jason Wang, David S. Miller, Jakub Kicinski,
	Jorgen Hansen, Norbert Slusarek, Colin Ian King, Andra Paraschiv,
	virtualization, oxffffaa

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/


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [virtio-comment] Re: [MASSMAIL KLMS] [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants
  2021-03-15 15:53   ` [virtio-comment] " Cornelia Huck
  (?)
@ 2021-03-16  3:35   ` Arseny Krasnov
  2021-03-16  8:11       ` [virtio-comment] " Cornelia Huck
  2021-03-16  8:19       ` [virtio-comment] " Stefano Garzarella
  -1 siblings, 2 replies; 13+ messages in thread
From: Arseny Krasnov @ 2021-03-16  3:35 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: virtio-comment, Stefan Hajnoczi, Stefano Garzarella,
	Michael S. Tsirkin, Jason Wang, David S. Miller, Jakub Kicinski,
	Jorgen Hansen, Norbert Slusarek, Colin Ian King, Andra Paraschiv,
	virtualization, oxffffaa


On 15.03.2021 18:53, Cornelia Huck wrote:
> 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?)

I'm not sure, in Linux driver there are several cases when these constants are used

independently from each over, but I think, this is question to implementation of virtio

vsock protocol, while this patch is cosmetic for specification.

>
>> +
>> +\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/
>
>

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/


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [MASSMAIL KLMS] [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants
  2021-03-16  3:35   ` [virtio-comment] Re: [MASSMAIL KLMS] " Arseny Krasnov
@ 2021-03-16  8:11       ` Cornelia Huck
  2021-03-16  8:19       ` [virtio-comment] " Stefano Garzarella
  1 sibling, 0 replies; 13+ messages in thread
From: Cornelia Huck @ 2021-03-16  8:11 UTC (permalink / raw)
  To: Arseny Krasnov
  Cc: Andra Paraschiv, Michael S. Tsirkin, Colin Ian King, oxffffaa,
	Norbert Slusarek, Stefan Hajnoczi, virtio-comment,
	Jakub Kicinski, virtualization, David S. Miller, Jorgen Hansen

On Tue, 16 Mar 2021 06:35:11 +0300
Arseny Krasnov <arseny.krasnov@kaspersky.com> wrote:

> On 15.03.2021 18:53, Cornelia Huck wrote:
> > 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?)  
> 
> I'm not sure, in Linux driver there are several cases when these constants are used
> 
> independently from each over, but I think, this is question to implementation of virtio
> 
> vsock protocol, while this patch is cosmetic for specification.

Yes, even if Linux doesn't use it like that, we allow it in the spec.
What about:

"When a connected socked receives VIRTIO_VSOCK_OP_SHUTDOWN, the header
\field{flags} contains a combination of one or more of the following
constants:"

?

> 
> >  
> >> +
> >> +\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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [virtio-comment] Re: [MASSMAIL KLMS] [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants
@ 2021-03-16  8:11       ` Cornelia Huck
  0 siblings, 0 replies; 13+ messages in thread
From: Cornelia Huck @ 2021-03-16  8:11 UTC (permalink / raw)
  To: Arseny Krasnov
  Cc: virtio-comment, Stefan Hajnoczi, Stefano Garzarella,
	Michael S. Tsirkin, Jason Wang, David S. Miller, Jakub Kicinski,
	Jorgen Hansen, Norbert Slusarek, Colin Ian King, Andra Paraschiv,
	virtualization, oxffffaa

On Tue, 16 Mar 2021 06:35:11 +0300
Arseny Krasnov <arseny.krasnov@kaspersky.com> wrote:

> On 15.03.2021 18:53, Cornelia Huck wrote:
> > 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?)  
> 
> I'm not sure, in Linux driver there are several cases when these constants are used
> 
> independently from each over, but I think, this is question to implementation of virtio
> 
> vsock protocol, while this patch is cosmetic for specification.

Yes, even if Linux doesn't use it like that, we allow it in the spec.
What about:

"When a connected socked receives VIRTIO_VSOCK_OP_SHUTDOWN, the header
\field{flags} contains a combination of one or more of the following
constants:"

?

> 
> >  
> >> +
> >> +\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/


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [MASSMAIL KLMS] [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants
  2021-03-16  3:35   ` [virtio-comment] Re: [MASSMAIL KLMS] " Arseny Krasnov
@ 2021-03-16  8:19       ` Stefano Garzarella
  2021-03-16  8:19       ` [virtio-comment] " Stefano Garzarella
  1 sibling, 0 replies; 13+ messages in thread
From: Stefano Garzarella @ 2021-03-16  8:19 UTC (permalink / raw)
  To: Arseny Krasnov
  Cc: Andra Paraschiv, Michael S. Tsirkin, Cornelia Huck,
	Colin Ian King, oxffffaa, Norbert Slusarek, Stefan Hajnoczi,
	virtio-comment, Jakub Kicinski, virtualization, David S. Miller,
	Jorgen Hansen

On Tue, Mar 16, 2021 at 06:35:11AM +0300, Arseny Krasnov wrote:
>
>On 15.03.2021 18:53, Cornelia Huck wrote:
>> 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?)
>
>I'm not sure, in Linux driver there are several cases when these constants are used
>
>independently from each over, but I think, this is question to implementation of virtio
>
>vsock protocol, while this patch is cosmetic for specification.
>

I think Cornelia's point is that from the "is one of the following 
constants" sentence it looks like only one of these flags can be set.
Instead both of them could be set together, and I guess this is the most 
frequent use case.

Thanks,
Stefano

>>
>>> +
>>> +\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/
>>
>>
>

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [virtio-comment] Re: [MASSMAIL KLMS] [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants
@ 2021-03-16  8:19       ` Stefano Garzarella
  0 siblings, 0 replies; 13+ messages in thread
From: Stefano Garzarella @ 2021-03-16  8:19 UTC (permalink / raw)
  To: Arseny Krasnov
  Cc: Cornelia Huck, virtio-comment, Stefan Hajnoczi,
	Michael S. Tsirkin, Jason Wang, David S. Miller, Jakub Kicinski,
	Jorgen Hansen, Norbert Slusarek, Colin Ian King, Andra Paraschiv,
	virtualization, oxffffaa

On Tue, Mar 16, 2021 at 06:35:11AM +0300, Arseny Krasnov wrote:
>
>On 15.03.2021 18:53, Cornelia Huck wrote:
>> 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?)
>
>I'm not sure, in Linux driver there are several cases when these constants are used
>
>independently from each over, but I think, this is question to implementation of virtio
>
>vsock protocol, while this patch is cosmetic for specification.
>

I think Cornelia's point is that from the "is one of the following 
constants" sentence it looks like only one of these flags can be set.
Instead both of them could be set together, and I guess this is the most 
frequent use case.

Thanks,
Stefano

>>
>>> +
>>> +\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/
>>
>>
>


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/


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [virtio-comment] Re: [MASSMAIL KLMS] [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants
  2021-03-16  8:19       ` [virtio-comment] " Stefano Garzarella
  (?)
@ 2021-03-16  8:54       ` Arseny Krasnov
  -1 siblings, 0 replies; 13+ messages in thread
From: Arseny Krasnov @ 2021-03-16  8:54 UTC (permalink / raw)
  To: Stefano Garzarella
  Cc: Cornelia Huck, virtio-comment, Stefan Hajnoczi,
	Michael S. Tsirkin, Jason Wang, David S. Miller, Jakub Kicinski,
	Jorgen Hansen, Norbert Slusarek, Colin Ian King, Andra Paraschiv,
	virtualization, oxffffaa


On 16.03.2021 11:19, Stefano Garzarella wrote:
> On Tue, Mar 16, 2021 at 06:35:11AM +0300, Arseny Krasnov wrote:
>> On 15.03.2021 18:53, Cornelia Huck wrote:
>>> 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?)
>> I'm not sure, in Linux driver there are several cases when these constants are used
>>
>> independently from each over, but I think, this is question to implementation of virtio
>>
>> vsock protocol, while this patch is cosmetic for specification.
>>
> I think Cornelia's point is that from the "is one of the following 
> constants" sentence it looks like only one of these flags can be set.
> Instead both of them could be set together, and I guess this is the most 
> frequent use case.
>
> Thanks,
> Stefano
Ok, understood.I'll fix it.
>
>>>> +
>>>> +\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/
>>>
>>>
>

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/


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [MASSMAIL KLMS] [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants
  2021-03-16  8:11       ` [virtio-comment] " Cornelia Huck
@ 2021-03-16 13:23         ` Michael S. Tsirkin
  -1 siblings, 0 replies; 13+ messages in thread
From: Michael S. Tsirkin @ 2021-03-16 13:23 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: Andra Paraschiv, Colin Ian King, oxffffaa, Norbert Slusarek,
	Stefan Hajnoczi, virtio-comment, Jakub Kicinski, Arseny Krasnov,
	virtualization, David S. Miller, Jorgen Hansen

On Tue, Mar 16, 2021 at 09:11:40AM +0100, Cornelia Huck wrote:
> On Tue, 16 Mar 2021 06:35:11 +0300
> Arseny Krasnov <arseny.krasnov@kaspersky.com> wrote:
> 
> > On 15.03.2021 18:53, Cornelia Huck wrote:
> > > 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}

Constants is kind of weird here, and this just makes the reader jump
through more hoops to figure out the value for little gain.
How about more clarity at cost of a bit of repetition:

---
Currently only stream sockets are supported. \field{type} is 1 for stream
socket types.

\begin{lstlisting}
#define VIRTIO_VSOCK_TYPE_STREAM 1
\end{lstlisting}
---

> > >>  
> > >>  Stream sockets provide in-order, guaranteed, connection-oriented delivery
> > >>  without message boundaries.


The use of enum seems questionable. Rest of spec except for sound uses
#define which while not documented is at least an english word.
I'd say it is easier to convert sound for consistency.

BTW we should probably document the use of #define in introduction.tex



> > >> @@ -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?)  
> > 
> > I'm not sure, in Linux driver there are several cases when these constants are used
> > 
> > independently from each over, but I think, this is question to implementation of virtio
> > 
> > vsock protocol, while this patch is cosmetic for specification.
> 
> Yes, even if Linux doesn't use it like that, we allow it in the spec.
> What about:
> 
> "When a connected socked receives VIRTIO_VSOCK_OP_SHUTDOWN, the header
> \field{flags} contains a combination of one or more of the following
> constants:"
> 
> ?

combination is kind of vague ...  Also, bit numbers are generally more
useful than masks.  Also, let's eschew abbreviation. And again a bit of
repetition here will just make things easier to read imho.

So how about e.g.

\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.

+#define VIRTIO_VSOCK_SHUTDOWN_RECEIVE_BIT 0
+#define VIRTIO_VSOCK_SHUTDOWN_SEND_BIT 1

then teach linux about VIRTIO_VSOCK_SHUTDOWN_RECEIVE_BIT and VIRTIO_VSOCK_SHUTDOWN_SEND_BIT

> > 
> > >  
> > >> +
> > >> +\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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [virtio-comment] Re: [MASSMAIL KLMS] [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants
@ 2021-03-16 13:23         ` Michael S. Tsirkin
  0 siblings, 0 replies; 13+ messages in thread
From: Michael S. Tsirkin @ 2021-03-16 13:23 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: Arseny Krasnov, virtio-comment, Stefan Hajnoczi,
	Stefano Garzarella, Jason Wang, David S. Miller, Jakub Kicinski,
	Jorgen Hansen, Norbert Slusarek, Colin Ian King, Andra Paraschiv,
	virtualization, oxffffaa

On Tue, Mar 16, 2021 at 09:11:40AM +0100, Cornelia Huck wrote:
> On Tue, 16 Mar 2021 06:35:11 +0300
> Arseny Krasnov <arseny.krasnov@kaspersky.com> wrote:
> 
> > On 15.03.2021 18:53, Cornelia Huck wrote:
> > > 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}

Constants is kind of weird here, and this just makes the reader jump
through more hoops to figure out the value for little gain.
How about more clarity at cost of a bit of repetition:

---
Currently only stream sockets are supported. \field{type} is 1 for stream
socket types.

\begin{lstlisting}
#define VIRTIO_VSOCK_TYPE_STREAM 1
\end{lstlisting}
---

> > >>  
> > >>  Stream sockets provide in-order, guaranteed, connection-oriented delivery
> > >>  without message boundaries.


The use of enum seems questionable. Rest of spec except for sound uses
#define which while not documented is at least an english word.
I'd say it is easier to convert sound for consistency.

BTW we should probably document the use of #define in introduction.tex



> > >> @@ -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?)  
> > 
> > I'm not sure, in Linux driver there are several cases when these constants are used
> > 
> > independently from each over, but I think, this is question to implementation of virtio
> > 
> > vsock protocol, while this patch is cosmetic for specification.
> 
> Yes, even if Linux doesn't use it like that, we allow it in the spec.
> What about:
> 
> "When a connected socked receives VIRTIO_VSOCK_OP_SHUTDOWN, the header
> \field{flags} contains a combination of one or more of the following
> constants:"
> 
> ?

combination is kind of vague ...  Also, bit numbers are generally more
useful than masks.  Also, let's eschew abbreviation. And again a bit of
repetition here will just make things easier to read imho.

So how about e.g.

\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.

+#define VIRTIO_VSOCK_SHUTDOWN_RECEIVE_BIT 0
+#define VIRTIO_VSOCK_SHUTDOWN_SEND_BIT 1

then teach linux about VIRTIO_VSOCK_SHUTDOWN_RECEIVE_BIT and VIRTIO_VSOCK_SHUTDOWN_SEND_BIT

> > 
> > >  
> > >> +
> > >> +\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/


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [MASSMAIL KLMS] [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants
  2021-03-16 13:23         ` [virtio-comment] " Michael S. Tsirkin
@ 2021-03-16 13:38           ` Cornelia Huck
  -1 siblings, 0 replies; 13+ messages in thread
From: Cornelia Huck @ 2021-03-16 13:38 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Andra Paraschiv, Colin Ian King, oxffffaa, Norbert Slusarek,
	Stefan Hajnoczi, virtio-comment, Jakub Kicinski, Arseny Krasnov,
	virtualization, David S. Miller, Jorgen Hansen

On Tue, 16 Mar 2021 09:23:39 -0400
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> On Tue, Mar 16, 2021 at 09:11:40AM +0100, Cornelia Huck wrote:
> > On Tue, 16 Mar 2021 06:35:11 +0300
> > Arseny Krasnov <arseny.krasnov@kaspersky.com> wrote:
> >   
> > > On 15.03.2021 18:53, Cornelia Huck wrote:  
> > > > 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}  
> 
> Constants is kind of weird here, and this just makes the reader jump
> through more hoops to figure out the value for little gain.
> How about more clarity at cost of a bit of repetition:
> 
> ---
> Currently only stream sockets are supported. \field{type} is 1 for stream
> socket types.
> 
> \begin{lstlisting}
> #define VIRTIO_VSOCK_TYPE_STREAM 1
> \end{lstlisting}
> ---
> 
> > > >>  
> > > >>  Stream sockets provide in-order, guaranteed, connection-oriented delivery
> > > >>  without message boundaries.  
> 
> 
> The use of enum seems questionable. Rest of spec except for sound uses
> #define which while not documented is at least an english word.
> I'd say it is easier to convert sound for consistency.

It's also used for gpu, input, and crypto.

> 
> BTW we should probably document the use of #define in introduction.tex

Maybe we should also document 'enum'? Or do we want to convert all
existing uses?

> 
> 
> 
> > > >> @@ -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?)    
> > > 
> > > I'm not sure, in Linux driver there are several cases when these constants are used
> > > 
> > > independently from each over, but I think, this is question to implementation of virtio
> > > 
> > > vsock protocol, while this patch is cosmetic for specification.  
> > 
> > Yes, even if Linux doesn't use it like that, we allow it in the spec.
> > What about:
> > 
> > "When a connected socked receives VIRTIO_VSOCK_OP_SHUTDOWN, the header
> > \field{flags} contains a combination of one or more of the following
> > constants:"
> > 
> > ?  
> 
> combination is kind of vague ...  Also, bit numbers are generally more
> useful than masks.  Also, let's eschew abbreviation. And again a bit of
> repetition here will just make things easier to read imho.
> 
> So how about e.g.
> 
> \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.
> 
> +#define VIRTIO_VSOCK_SHUTDOWN_RECEIVE_BIT 0
> +#define VIRTIO_VSOCK_SHUTDOWN_SEND_BIT 1
> 
> then teach linux about VIRTIO_VSOCK_SHUTDOWN_RECEIVE_BIT and VIRTIO_VSOCK_SHUTDOWN_SEND_BIT

I'm not opposed to introducing defines for bits, but wouldn't it be
easier to say that the following bits can be set, then define the bits,
and then explain what the bits mean? Just in case we come up with
something in the future that needs another bit.

> 
> > >   
> > > >    
> > > >> +
> > > >> +\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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [virtio-comment] Re: [MASSMAIL KLMS] [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants
@ 2021-03-16 13:38           ` Cornelia Huck
  0 siblings, 0 replies; 13+ messages in thread
From: Cornelia Huck @ 2021-03-16 13:38 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Arseny Krasnov, virtio-comment, Stefan Hajnoczi,
	Stefano Garzarella, Jason Wang, David S. Miller, Jakub Kicinski,
	Jorgen Hansen, Norbert Slusarek, Colin Ian King, Andra Paraschiv,
	virtualization, oxffffaa

On Tue, 16 Mar 2021 09:23:39 -0400
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> On Tue, Mar 16, 2021 at 09:11:40AM +0100, Cornelia Huck wrote:
> > On Tue, 16 Mar 2021 06:35:11 +0300
> > Arseny Krasnov <arseny.krasnov@kaspersky.com> wrote:
> >   
> > > On 15.03.2021 18:53, Cornelia Huck wrote:  
> > > > 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}  
> 
> Constants is kind of weird here, and this just makes the reader jump
> through more hoops to figure out the value for little gain.
> How about more clarity at cost of a bit of repetition:
> 
> ---
> Currently only stream sockets are supported. \field{type} is 1 for stream
> socket types.
> 
> \begin{lstlisting}
> #define VIRTIO_VSOCK_TYPE_STREAM 1
> \end{lstlisting}
> ---
> 
> > > >>  
> > > >>  Stream sockets provide in-order, guaranteed, connection-oriented delivery
> > > >>  without message boundaries.  
> 
> 
> The use of enum seems questionable. Rest of spec except for sound uses
> #define which while not documented is at least an english word.
> I'd say it is easier to convert sound for consistency.

It's also used for gpu, input, and crypto.

> 
> BTW we should probably document the use of #define in introduction.tex

Maybe we should also document 'enum'? Or do we want to convert all
existing uses?

> 
> 
> 
> > > >> @@ -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?)    
> > > 
> > > I'm not sure, in Linux driver there are several cases when these constants are used
> > > 
> > > independently from each over, but I think, this is question to implementation of virtio
> > > 
> > > vsock protocol, while this patch is cosmetic for specification.  
> > 
> > Yes, even if Linux doesn't use it like that, we allow it in the spec.
> > What about:
> > 
> > "When a connected socked receives VIRTIO_VSOCK_OP_SHUTDOWN, the header
> > \field{flags} contains a combination of one or more of the following
> > constants:"
> > 
> > ?  
> 
> combination is kind of vague ...  Also, bit numbers are generally more
> useful than masks.  Also, let's eschew abbreviation. And again a bit of
> repetition here will just make things easier to read imho.
> 
> So how about e.g.
> 
> \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.
> 
> +#define VIRTIO_VSOCK_SHUTDOWN_RECEIVE_BIT 0
> +#define VIRTIO_VSOCK_SHUTDOWN_SEND_BIT 1
> 
> then teach linux about VIRTIO_VSOCK_SHUTDOWN_RECEIVE_BIT and VIRTIO_VSOCK_SHUTDOWN_SEND_BIT

I'm not opposed to introducing defines for bits, but wouldn't it be
easier to say that the following bits can be set, then define the bits,
and then explain what the bits mean? Just in case we come up with
something in the future that needs another bit.

> 
> > >   
> > > >    
> > > >> +
> > > >> +\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/


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-03-16 13:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-03-15 15:53   ` [virtio-comment] " Cornelia Huck
2021-03-16  3:35   ` [virtio-comment] Re: [MASSMAIL KLMS] " Arseny Krasnov
2021-03-16  8:11     ` Cornelia Huck
2021-03-16  8:11       ` [virtio-comment] " Cornelia Huck
2021-03-16 13:23       ` Michael S. Tsirkin
2021-03-16 13:23         ` [virtio-comment] " Michael S. Tsirkin
2021-03-16 13:38         ` Cornelia Huck
2021-03-16 13:38           ` [virtio-comment] " Cornelia Huck
2021-03-16  8:19     ` Stefano Garzarella
2021-03-16  8:19       ` [virtio-comment] " Stefano Garzarella
2021-03-16  8:54       ` Arseny Krasnov

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.