From: Stefan Hajnoczi <stefanha@redhat.com>
To: Gerard Garcia <ggarcia@abra.uab.cat>
Cc: netdev@vger.kernel.org, jhansen@vmware.com
Subject: Re: [RFC 2/3] vsockmon: Add vsockmon device
Date: Fri, 10 Jun 2016 16:37:09 +0100 [thread overview]
Message-ID: <20160610153709.GD3855@stefanha-x1.localdomain> (raw)
In-Reply-To: <d5141c2f-0558-2b1b-9089-4901d54e5beb@deic.uab.cat>
[-- Attachment #1: Type: text/plain, Size: 1323 bytes --]
On Thu, Jun 09, 2016 at 05:21:26PM +0200, Gerard Garcia wrote:
> > > diff --git a/include/uapi/linux/vsockmon.h b/include/uapi/linux/vsockmon.h
> > > new file mode 100644
> > > index 0000000..c73166f
> > > --- /dev/null
> > > +++ b/include/uapi/linux/vsockmon.h
> > > @@ -0,0 +1,37 @@
> > > +#ifndef _UAPI_VSOCKMON_H
> > > +#define _UAPI_VSOCKMON_H
> > > +
> > > +#include <linux/virtio_vsock.h>
> > > +
> > > +/* Packet structure of packets received from the vsockmon device. */
> > > +
> > > +struct af_vsockmon_g {
> > > + unsigned short op; /* enum af_vsock_g_ops */
> > > + unsigned int src_cid;
> > > + unsigned int src_port;
> > > + unsigned int dst_cid;
> > > + unsigned int dst_port;
> > > +};
> > > +
> > > +struct af_vsockmon_hdr {
> > > + unsigned short type; /* enum af_vosck_type */
> > > + struct af_vsockmon_g g_hdr;
> > > + union {
> > > + struct virtio_vsock_hdr virtio_hdr;
> > > + } t_hdr;
> > > +};
> > How does endianness work? virtio_hdr uses little-endian fields on the
> > wire. I guess that af_vsockmon_g is always CPU-endian.
> Yes, af_vsockmon_g is CPU-endian. I don't know what criteria is normally
> used regarding the endianness of structs facing user space but I think it is
> better to not modify the vsock transport structs.
Endianness must to be documented in this uapi header file.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2016-06-10 15:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-28 16:29 [RFC 0/3] vsockmon: virtual device to monitor AF_VSOCK sockets ggarcia
2016-05-28 16:29 ` [RFC 1/3] vsockmon: Add tap functions ggarcia
2016-06-01 21:07 ` Stefan Hajnoczi
2016-06-09 15:02 ` Gerard Garcia
2016-06-10 15:44 ` Stefan Hajnoczi
2016-06-14 12:05 ` Jorgen S. Hansen
2016-05-28 16:29 ` [RFC 2/3] vsockmon: Add vsockmon device ggarcia
2016-06-01 21:15 ` Stefan Hajnoczi
2016-06-09 15:21 ` Gerard Garcia
2016-06-10 15:37 ` Stefan Hajnoczi [this message]
2016-05-28 16:29 ` [RFC 3/3] vsockmon: Add vsock hooks ggarcia
2016-06-01 21:19 ` Stefan Hajnoczi
2016-06-09 15:27 ` Gerard Garcia
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=20160610153709.GD3855@stefanha-x1.localdomain \
--to=stefanha@redhat.com \
--cc=ggarcia@abra.uab.cat \
--cc=jhansen@vmware.com \
--cc=netdev@vger.kernel.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