From: Anthony Liguori <anthony@codemonkey.ws>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH-RFC 09/13] tap: add vhost/vhostfd options
Date: Tue, 12 Jan 2010 16:42:22 -0600 [thread overview]
Message-ID: <4B4CFACE.9010207@codemonkey.ws> (raw)
In-Reply-To: <20100111172217.GJ11936@redhat.com>
On 01/11/2010 11:22 AM, Michael S. Tsirkin wrote:
> Looks like order got mixed up: vhost_net header
> is added by a follow-up patch. Will be fixed
> in the next revision.
>
> Signed-off-by: Michael S. Tsirkin<mst@redhat.com>
> ---
> net.c | 8 ++++++++
> net/tap.c | 29 +++++++++++++++++++++++++++++
> qemu-options.hx | 4 +++-
> 3 files changed, 40 insertions(+), 1 deletions(-)
>
> diff --git a/net.c b/net.c
> index 6ef93e6..b942d03 100644
> --- a/net.c
> +++ b/net.c
> @@ -976,6 +976,14 @@ static struct {
> .name = "vnet_hdr",
> .type = QEMU_OPT_BOOL,
> .help = "enable the IFF_VNET_HDR flag on the tap interface"
> + }, {
> + .name = "vhost",
> + .type = QEMU_OPT_BOOL,
> + .help = "enable vhost-net network accelerator",
> + }, {
> + .name = "vhostfd",
> + .type = QEMU_OPT_STRING,
> + .help = "file descriptor of an already opened vhost net device",
> },
> #endif /* _WIN32 */
> { /* end of list */ }
> diff --git a/net/tap.c b/net/tap.c
> index 7e9ca79..d9f2e41 100644
> --- a/net/tap.c
> +++ b/net/tap.c
> @@ -41,6 +41,8 @@
>
> #include "net/tap-linux.h"
>
> +#include "hw/vhost_net.h"
> +
> /* Maximum GSO packet size (64k) plus plenty of room for
> * the ethernet and virtio_net headers
> */
> @@ -57,6 +59,7 @@ typedef struct TAPState {
> unsigned int has_vnet_hdr : 1;
> unsigned int using_vnet_hdr : 1;
> unsigned int has_ufo: 1;
> + struct vhost_net *vhost_net;
> } TAPState;
>
> static int launch_script(const char *setup_script, const char *ifname, int fd);
> @@ -252,6 +255,10 @@ static void tap_cleanup(VLANClientState *nc)
> {
> TAPState *s = DO_UPCAST(TAPState, nc, nc);
>
> + if (s->vhost_net) {
> + vhost_net_cleanup(s->vhost_net);
> + }
> +
> qemu_purge_queued_packets(nc);
>
> if (s->down_script[0])
> @@ -307,6 +314,7 @@ static TAPState *net_tap_fd_init(VLANState *vlan,
> s->has_ufo = tap_probe_has_ufo(s->fd);
> tap_set_offload(&s->nc, 0, 0, 0, 0, 0);
> tap_read_poll(s, 1);
> + s->vhost_net = NULL;
> return s;
> }
>
> @@ -456,6 +464,27 @@ int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan
> }
> }
>
> + if (qemu_opt_get_bool(opts, "vhost", 0)) {
> + int vhostfd, r;
> + if (qemu_opt_get(opts, "vhostfd")) {
> + r = net_handle_fd_param(mon, qemu_opt_get(opts, "vhostfd"));
> + if (r == -1) {
> + return -1;
> + }
> + vhostfd = r;
> + } else {
> + vhostfd = -1;
> + }
> + s->vhost_net = vhost_net_init(&s->nc, vhostfd);
>
Hrm, I don't see a patch that introduces this function? Am I missing
something obvious?
Regards,
Anthony Liguori
next prev parent reply other threads:[~2010-01-12 22:42 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1263230079.git.mst@redhat.com>
2010-01-11 17:16 ` [Qemu-devel] [PATCH-RFC 01/13] virtio: export virtqueue structure Michael S. Tsirkin
2010-01-12 22:32 ` [Qemu-devel] " Anthony Liguori
2010-01-25 19:10 ` Michael S. Tsirkin
2010-01-25 19:23 ` Anthony Liguori
2010-01-11 17:17 ` [Qemu-devel] [PATCH-RFC 02/13] kvm: add API to set ioeventfd Michael S. Tsirkin
2010-01-12 22:35 ` [Qemu-devel] " Anthony Liguori
2010-01-25 19:20 ` Michael S. Tsirkin
2010-01-25 19:28 ` Anthony Liguori
2010-01-25 19:28 ` Michael S. Tsirkin
2010-01-25 19:44 ` Anthony Liguori
2010-01-11 17:17 ` [Qemu-devel] [PATCH-RFC 03/13] virtio: add iofd/irqfd support Michael S. Tsirkin
2010-01-12 22:36 ` [Qemu-devel] " Anthony Liguori
2010-01-13 10:50 ` Michael S. Tsirkin
2010-01-11 17:17 ` [Qemu-devel] [PATCH-RFC 04/13] virtio-pci: fill in irqfd/queufd support Michael S. Tsirkin
2010-01-11 17:19 ` [Qemu-devel] [PATCH-RFC 05/13] syborg_virtio: add irqfd/eventfd support Michael S. Tsirkin
2010-01-11 17:20 ` [Qemu-devel] [PATCH-RFC 06/13] s390-virtio: fill in irqfd support Michael S. Tsirkin
2010-01-11 17:20 ` [Qemu-devel] [PATCH-RFC 07/13] virtio: move typedef to qemu-common Michael S. Tsirkin
2010-01-11 17:20 ` [Qemu-devel] [PATCH-RFC 08/13] net/tap: add interface to get device fd Michael S. Tsirkin
2010-01-11 17:22 ` [Qemu-devel] [PATCH-RFC 09/13] tap: add vhost/vhostfd options Michael S. Tsirkin
2010-01-12 22:39 ` [Qemu-devel] " Anthony Liguori
2010-01-13 10:59 ` Michael S. Tsirkin
2010-01-12 22:42 ` Anthony Liguori [this message]
2010-01-11 17:22 ` [Qemu-devel] [PATCH-RFC 10/13] tap: add API to retrieve vhost net header Michael S. Tsirkin
2010-01-11 17:23 ` [Qemu-devel] [PATCH-RFC 12/13] virtio: add status change callback Michael S. Tsirkin
2010-01-11 17:23 ` [Qemu-devel] [PATCH-RFC 13/13] virtio-net: connect to vhost net backend Michael S. Tsirkin
2010-01-25 19:58 ` [Qemu-devel] " Anthony Liguori
2010-01-25 20:27 ` Michael S. Tsirkin
2010-01-25 21:00 ` Anthony Liguori
2010-01-25 21:01 ` Michael S. Tsirkin
2010-01-25 21:05 ` Michael S. Tsirkin
2010-01-25 21:11 ` Anthony Liguori
2010-02-24 3:14 ` Paul Brook
2010-02-24 5:29 ` Michael S. Tsirkin
2010-02-24 11:30 ` Paul Brook
2010-02-24 11:46 ` Michael S. Tsirkin
2010-02-24 12:26 ` Paul Brook
2010-02-24 12:40 ` Michael S. Tsirkin
2010-02-24 15:16 ` Anthony Liguori
2010-02-24 14:51 ` Anthony Liguori
2010-01-11 17:23 ` [Qemu-devel] [PATCH-RFC 11/13] vhost net support Michael S. Tsirkin
2010-01-12 22:45 ` [Qemu-devel] " Anthony Liguori
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=4B4CFACE.9010207@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.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).