From: Gerd Hoffmann <kraxel@redhat.com>
To: Andy King <acking@vmware.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org,
gregkh@linuxfoundation.org, davem@davemloft.net,
pv-drivers@vmware.com
Subject: Re: [PATCH 1/1] VSOCK: Introduce VM Sockets
Date: Mon, 11 Feb 2013 15:22:33 +0100 [thread overview]
Message-ID: <5118FEA9.2080201@redhat.com> (raw)
In-Reply-To: <1360196636-9357-2-git-send-email-acking@vmware.com>
On 02/07/13 01:23, Andy King wrote:
> +struct vsock_transport_recv_notify_data {
> + u64 data1; /* Transport-defined. */
> + u64 data2; /* Transport-defined. */
> + bool notify_on_block;
> +};
> +
> +struct vsock_transport_send_notify_data {
> + u64 data1; /* Transport-defined. */
> + u64 data2; /* Transport-defined. */
> +};
> +
> +struct vsock_transport {
> + /* Initialize/tear-down socket. */
> + int (*init)(struct vsock_sock *, struct vsock_sock *);
> + void (*destruct)(struct vsock_sock *);
> + void (*release)(struct vsock_sock *);
> +
> + /* Connections. */
> + int (*connect)(struct vsock_sock *);
> +
> + /* DGRAM. */
> + int (*dgram_bind)(struct vsock_sock *, struct sockaddr_vm *);
> + int (*dgram_dequeue)(struct kiocb *kiocb, struct vsock_sock *vsk,
> + struct msghdr *msg, size_t len, int flags);
> + int (*dgram_enqueue)(struct vsock_sock *, struct sockaddr_vm *,
> + struct iovec *, size_t len);
> + bool (*dgram_allow)(u32 cid, u32 port);
> +
> + /* STREAM. */
> + /* TODO: stream_bind() */
> + ssize_t (*stream_dequeue)(struct vsock_sock *, struct iovec *,
> + size_t len, int flags);
> + ssize_t (*stream_enqueue)(struct vsock_sock *, struct iovec *,
> + size_t len);
> + s64 (*stream_has_data)(struct vsock_sock *);
> + s64 (*stream_has_space)(struct vsock_sock *);
> + u64 (*stream_rcvhiwat)(struct vsock_sock *);
> + bool (*stream_is_active)(struct vsock_sock *);
> + bool (*stream_allow)(u32 cid, u32 port);
> +
> + /* Notification. */
> + int (*notify_poll_in)(struct vsock_sock *, size_t, bool *);
> + int (*notify_poll_out)(struct vsock_sock *, size_t, bool *);
> + int (*notify_recv_init)(struct vsock_sock *, size_t,
> + struct vsock_transport_recv_notify_data *);
> + int (*notify_recv_pre_block)(struct vsock_sock *, size_t,
> + struct vsock_transport_recv_notify_data *);
> + int (*notify_recv_pre_dequeue)(struct vsock_sock *, size_t,
> + struct vsock_transport_recv_notify_data *);
> + int (*notify_recv_post_dequeue)(struct vsock_sock *, size_t,
> + ssize_t, bool, struct vsock_transport_recv_notify_data *);
> + int (*notify_send_init)(struct vsock_sock *,
> + struct vsock_transport_send_notify_data *);
> + int (*notify_send_pre_block)(struct vsock_sock *,
> + struct vsock_transport_send_notify_data *);
> + int (*notify_send_pre_enqueue)(struct vsock_sock *,
> + struct vsock_transport_send_notify_data *);
> + int (*notify_send_post_enqueue)(struct vsock_sock *, ssize_t,
> + struct vsock_transport_send_notify_data *);
> +
> + /* Shutdown. */
> + int (*shutdown)(struct vsock_sock *, int);
> +
> + /* Buffer sizes. */
> + void (*set_buffer_size)(struct vsock_sock *, u64);
> + void (*set_min_buffer_size)(struct vsock_sock *, u64);
> + void (*set_max_buffer_size)(struct vsock_sock *, u64);
> + u64 (*get_buffer_size)(struct vsock_sock *);
> + u64 (*get_min_buffer_size)(struct vsock_sock *);
> + u64 (*get_max_buffer_size)(struct vsock_sock *);
> +
> + /* Addressing. */
> + u32 (*get_local_cid)(void);
> +};
> +
Whoa. This has grown *alot*. Care to explain this please? Patch
creating a Documentation/virtual/vsock.txt would be cool.
*_enqueue + *_dequeue is sending/receiving data, ok.
stream_has_data + stream_has_space + stream_rcvhiwat look like they are
needed for buffer management. Details please (especially for
stream_rcvhiwat).
What is stream_is_active?
What is *_allow?
What are all those notify_* calls?
Why do you need vsock_transport_{send,recv}_notify_data structs?
Can't this live in vsock_sock->trans?
thanks,
Gerd
next prev parent reply other threads:[~2013-02-11 14:23 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-07 0:23 [PATCH 0/1] VM Sockets for Linux upstreaming Andy King
2013-02-07 0:23 ` [PATCH 1/1] VSOCK: Introduce VM Sockets Andy King
2013-02-11 14:22 ` Gerd Hoffmann [this message]
2013-02-12 15:21 ` Andy King
2013-02-13 3:21 ` [Pv-drivers] " Andy King
2013-02-13 11:06 ` Gerd Hoffmann
2013-02-14 3:20 ` Andy King
2013-02-14 9:28 ` Gerd Hoffmann
2013-02-12 10:58 ` Gerd Hoffmann
2013-02-13 3:23 ` Andy King
2013-02-13 12:44 ` Gerd Hoffmann
2013-02-14 3:07 ` Andy King
2013-02-18 16:56 ` Andy King
2013-02-14 11:05 ` Gerd Hoffmann
2013-02-18 17:07 ` Andy King
2013-02-19 8:45 ` Gerd Hoffmann
2013-02-14 20:18 ` Sasha Levin
2013-02-18 17:09 ` Andy King
2013-02-15 10:32 ` Gerd Hoffmann
2013-02-09 1:20 ` [Pv-drivers] [PATCH 0/1] VM Sockets for Linux upstreaming Dmitry Torokhov
2013-02-09 2:59 ` David Miller
2013-02-11 1:10 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2013-02-04 23:26 Andy King
2013-02-04 23:26 ` [PATCH 1/1] VSOCK: Introduce VM Sockets Andy King
2013-01-25 17:37 [PATCH 0/1] VM Sockets for Linux upstreaming acking
2013-01-25 17:37 ` [PATCH 1/1] VSOCK: Introduce VM Sockets acking
2013-01-25 23:59 ` Neil Horman
2013-01-28 12:25 ` Gerd Hoffmann
2013-01-31 22:06 ` Andy King
2013-02-01 8:12 ` Gerd Hoffmann
2013-02-04 23:41 ` Andy King
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=5118FEA9.2080201@redhat.com \
--to=kraxel@redhat.com \
--cc=acking@vmware.com \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pv-drivers@vmware.com \
--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;
as well as URLs for NNTP newsgroup(s).