Linux virtualization list
 help / color / mirror / Atom feed
From: Stefano Garzarella <sgarzare@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Andra Paraschiv <andraprs@amazon.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>,
	Arseny Krasnov <arseny.krasnov@kaspersky.com>,
	virtualization@lists.linux-foundation.org,
	"David S. Miller" <davem@davemloft.net>,
	Jorgen Hansen <jhansen@vmware.com>
Subject: Re: [virtio-comment] Re: [RFC PATCH v1 0/1] virtio-vsock: introduce SEQPACKET description
Date: Tue, 16 Mar 2021 15:08:22 +0100	[thread overview]
Message-ID: <20210316140822.gvdtqci22tlmh3x6@steredhat> (raw)
In-Reply-To: <20210316095002-mutt-send-email-mst@kernel.org>

On Tue, Mar 16, 2021 at 09:50:48AM -0400, Michael S. Tsirkin wrote:
>On Mon, Feb 22, 2021 at 11:16:54AM +0100, Stefano Garzarella wrote:
>> On Thu, Feb 18, 2021 at 09:07:12AM +0300, Arseny Krasnov wrote:
>> > This patchset adds description of SOCK_SEQPACKET socket's type
>> > of virtio vsock.
>> >
>> > Here is implementation:
>> > https://lkml.org/lkml/2021/2/18/24
>> >
>> > Arseny Krasnov(1):
>> >  virtio-vsock: add SOCK_SEQPACKET description
>> >
>> > virtio-vsock.tex | 40 +++++++++++++++++++++++++++++++++++++---
>> > 1 files changed, 37 insertions(+), 3 deletions(-)
>> >
>> > TODO:
>> > - for messages identification I use header's field called 'msg_cnt'.
>> >  May be it is better to call it 'msg_id' or 'msg_num', because it
>> >  is used as ID, but implemented as counter.
>>
>> If we use it only as an identifier, I think 'msg_id' is preferable and we
>> shouldn't mention in the specs that it's a counter, since it's just a
>> possible implementation.
>> Instead if we use the counter for some control, for example if we lost a
>> packet, then maybe msg_cnt is better.
>> But since the channel shouldn't lose packets, I don't think this is the
>> case.
>>
>> >
>> > - in current version of specification, some values of headers' fields
>> >  still unnamed, for example type of socket (stream or seqpacket), then
>> >  shutdown flags. Spec says that for stream socket value of 'type'
>> >  must be 1. For receive shutdown bit 0 is set in 'flags', for send
>> >  shutdown bit 1 is set in 'flags'. But in Linux these unnamed ones and
>> >  zeroes are implemented as enums, so may be it will be ok to add such
>> >  enums in specification (as 'enum virtio_vsock_event_id').
>>
>> Since we have an enumerate for VIRTIO_VSOCK_OP_* values, I think we can add
>> enums for socket type and maybe 'flags'.
>
>We really need to switch enums to defines, for consistency.

I fully agree, indeed at least in the virtio-vsock part, we use the 
enumerate as they were many defines, always redefining the assigned 
value.
Using defines, we are forced to always define the value and I think 
that's fair!

Thanks,
Stefano

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

  reply	other threads:[~2021-03-16 14:08 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 [this message]
     [not found] ` <20210218060827.1075863-1-arseny.krasnov@kaspersky.com>
2021-02-24  9:32   ` [virtio-comment] [RFC PATCH v1 1/1] virtio-vsock: add SOCK_SEQPACKET description Stefano Garzarella
2021-03-03 12:08     ` 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=20210316140822.gvdtqci22tlmh3x6@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