Linux virtualization list
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@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>,
	Norbert Slusarek <nslusarek@gmx.net>,
	oxffffaa@gmail.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] Re: [RFC PATCH v1] virtio-vsock: use C style defines for constants
Date: Tue, 23 Mar 2021 08:34:25 +0000	[thread overview]
Message-ID: <YFmoESIM64aiF5sk@stefanha-x1.localdomain> (raw)
In-Reply-To: <71e16d33-b5f5-d551-ad5a-22b45e946b9a@kaspersky.com>


[-- Attachment #1.1: Type: text/plain, Size: 1643 bytes --]

On Tue, Mar 23, 2021 at 09:18:34AM +0300, Arseny Krasnov wrote:
> 
> On 22.03.2021 17:30, Stefan Hajnoczi wrote:
> > On Mon, Mar 22, 2021 at 09:34:58AM -0400, Michael S. Tsirkin wrote:
> >> On Mon, Mar 22, 2021 at 11:52:22AM +0000, Stefan Hajnoczi wrote:
> >>> On Mon, Mar 22, 2021 at 09:37:59AM +0300, Arseny Krasnov wrote:
> >>>> @@ -227,6 +226,11 @@ \subsubsection{Stream Sockets}\label{sec:Device Types / Socket Device / Device O
> >>>>  hints are permanent once sent and successive packets with bits clear do not
> >>>>  reset them.
> >>>>  
> >>>> +\begin{lstlisting}
> >>>> +#define VIRTIO_VSOCK_SHUTDOWN_RECEIVE_BIT 0
> >>>> +#define VIRTIO_VSOCK_SHUTDOWN_SEND_BIT    1
> >>>> +\end{lstlisting}
> >>> The spec has no other _BIT constants.
> >> True. Sometimes there's an _F_ somewhere there instead.
> > You're right, I missed the virtio-net bit constants:
> >
> >   #define VIRTIO_NET_F_GUEST_TSO4 7
> >
> > Compared to:
> >
> >   #define VIRTQ_DESC_F_AVAIL     (1 << 7)
> >
> > or
> >
> >   #define VIRTQ_DESC_F_WRITE     2
> >
> > It's an inconsistent mix :). Hard to tell them apart when they aren't
> > bitmask constants with '<<'.
> >
> > Can we use '<<' for clarity on new constants?
> 
> So for bit constants, i can use:
> 
> #define VIRTIO_VSOCK_SHUTDOWN_RECEIVE (1 << 0)
> #define VIRTIO_VSOCK_SHUTDOWN_SEND    (1 << 1)
> 
> for this case and all other next cases, when i'll add SEQPACKET
> description in spec?

Personally I think that's clearest. Michael pointed out that the spec is
not consistent though, so I won't complain if you prefer to keep the
_BIT numbering.

Stefan

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 183 bytes --]

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

      parent reply	other threads:[~2021-03-23  8:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210322063804.641923-1-arseny.krasnov@kaspersky.com>
2021-03-22 11:52 ` [RFC PATCH v1] virtio-vsock: use C style defines for constants Stefan Hajnoczi
2021-03-22 13:34   ` Michael S. Tsirkin
2021-03-22 14:30     ` Stefan Hajnoczi
     [not found]       ` <71e16d33-b5f5-d551-ad5a-22b45e946b9a@kaspersky.com>
2021-03-23  8:34         ` Stefan Hajnoczi [this message]

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=YFmoESIM64aiF5sk@stefanha-x1.localdomain \
    --to=stefanha@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=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