From: "Michael S. Tsirkin" <mst@redhat.com>
To: Felipe Franciosi <felipe@nutanix.com>
Cc: "Marc-André Lureau" <mlureau@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
"victork@redhat.com" <victork@redhat.com>,
"Eric Blake" <eblake@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 5/6] contrib: add libvhost-user
Date: Fri, 28 Oct 2016 01:11:51 +0300 [thread overview]
Message-ID: <20161028011101-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <573FC693-003A-4A03-9870-00A9A64ADE2B@nutanix.com>
On Tue, Oct 18, 2016 at 04:21:57PM +0000, Felipe Franciosi wrote:
>
> > On 18 Oct 2016, at 16:25, Marc-André Lureau <mlureau@redhat.com> wrote:
> >
> > Hi Felipe
> >
> > ----- Original Message -----
> >> Hello,
> >>
> >>> On 18 Oct 2016, at 10:24, Marc-André Lureau <marcandre.lureau@redhat.com>
> >>> wrote:
> >>>
> >>> <...>
> >>>
> >>> diff --git a/contrib/libvhost-user/libvhost-user.h
> >>> b/contrib/libvhost-user/libvhost-user.h
> >>>
> >>> <...>
> >>>
> >>> +#define VHOST_MAX_NR_VIRTQUEUE 8
> >>> +#define VIRTQUEUE_MAX_SIZE 1024
> >>
> >> I think that the maximum number of VQs should be 1024 to match Qemu's.
> >>
> >> http://git.qemu.org/?p=qemu.git;a=blob;f=include/hw/virtio/virtio.h;h=b913aac45589449bcc5d8161651332f4b0d69c7f;hb=HEAD#l55
> >
> > That would make the VuDev structure quite big. We may want to set the nr of max queues in vu_init() instead, and allocate it there. I think this is rather a current limitation, but does not prevent iterating from there.
>
> Well, it depends what we call "quite big". The only thing that depends on that is:
>
> > struct VuDev {
> > <...>
> > VuVirtq vq[VHOST_MAX_NR_VIRTQUEUE];
> > <...>
>
> And VuVirtq is 96 bytes in size (x86_64). So we're really talking about 768 bytes vs 96 KiB.
>
> Actually, you can bring it down to 88 bytes by...
>
> > typedef struct VuRing {
> > unsigned int num;
> > struct vring_desc *desc;
> > struct vring_avail *avail;
> > struct vring_used *used;
> > uint64_t log_guest_addr;
> > uint32_t flags;
>
> ... moving "flags" just below "num". Allows gcc to compact the struct better.
>
> > } VuRing;
>
>
> I'd rather fix this kind of thing sooner than later, but it's ultimately up to you.
>
> Felipe
I suspect the right thing to do is allocating it dynamically,
I'm fine merging as is for now though.
--
MST
next prev parent reply other threads:[~2016-10-27 22:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-18 9:23 [Qemu-devel] [PATCH v2 0/6] Start a contrib/libvhost-user Marc-André Lureau
2016-10-18 9:24 ` [Qemu-devel] [PATCH v2 1/6] tests/vhost-user-bridge: remove false comment Marc-André Lureau
2016-10-18 9:24 ` [Qemu-devel] [PATCH v2 2/6] tests/vhost-user-bridge: remove unnecessary dispatcher_remove Marc-André Lureau
2016-10-18 9:24 ` [Qemu-devel] [PATCH v2 3/6] tests/vhost-user-bridge: indicate peer disconnected Marc-André Lureau
2016-10-18 9:24 ` [Qemu-devel] [PATCH v2 4/6] tests/vhost-user-bridge: do not accept more than one connection Marc-André Lureau
2016-10-18 9:24 ` [Qemu-devel] [PATCH v2 5/6] contrib: add libvhost-user Marc-André Lureau
2016-10-18 14:13 ` Felipe Franciosi
2016-10-18 14:43 ` Felipe Franciosi
2016-10-18 15:25 ` Marc-André Lureau
2016-10-18 16:21 ` Felipe Franciosi
2016-10-27 22:11 ` Michael S. Tsirkin [this message]
2016-10-27 22:17 ` Felipe Franciosi
2016-10-18 9:24 ` [Qemu-devel] [PATCH v2 6/6] tests/vhost-user-bridge: use contrib/libvhost-user Marc-André Lureau
2016-10-18 13:29 ` Eric Blake
2016-11-15 19:20 ` [Qemu-devel] [PATCH v2 0/6] Start a contrib/libvhost-user 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=20161028011101-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=eblake@redhat.com \
--cc=felipe@nutanix.com \
--cc=marcandre.lureau@redhat.com \
--cc=mlureau@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=victork@redhat.com \
/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).