From: Stefan Hajnoczi <stefanha@gmail.com>
To: "Oleinik, Alexander" <alxndr@bu.edu>
Cc: "lvivier@redhat.com" <lvivier@redhat.com>,
"thuth@redhat.com" <thuth@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"bsd@redhat.com" <bsd@redhat.com>,
"superirishdonkey@gmail.com" <superirishdonkey@gmail.com>,
"stefanha@redhat.com" <stefanha@redhat.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"jsnow@redhat.com" <jsnow@redhat.com>
Subject: Re: [Qemu-devel] [RFC 13/19] fuzz: add ctrl vq support to virtio-net in libqos
Date: Fri, 26 Jul 2019 14:09:07 +0100 [thread overview]
Message-ID: <20190726130907.GH25977@stefanha-x1.localdomain> (raw)
In-Reply-To: <b2503c69ad82bd13c1bab518154c6168e7eeb1cc.camel@bu.edu>
[-- Attachment #1: Type: text/plain, Size: 2097 bytes --]
On Thu, Jul 25, 2019 at 05:05:25PM +0000, Oleinik, Alexander wrote:
> On Thu, 2019-07-25 at 12:25 -0400, John Snow wrote:
> >
> > On 7/24/19 11:23 PM, Oleinik, Alexander wrote:
> > > Signed-off-by: Alexander Oleinik <alxndr@bu.edu>
> >
> > Is there some explanation for why the below patch does what the
> > subject
> > line claims for the uninitiated?
> When multiqueue mode (VIRTIO_NET_F_MQ) is disabled, virtio-net sets up
> three queues. 0:receiveq, 1:transmitq and 2:controlq.
> > I don't know why increasing the number of queues from 2 to 3 here is
> > correct in the general case, OR why it would "add ctrl vq support".
> > (Or what it has to do with fuzzing, in general.)
>
> Prior to the change, accessing the ctrl vq through QOS, would trigger a
> segfault, since only two queues were allocated to QVirtioDevice*
> interface->queues.
>
> Also, when VIRTIO_NET_F_MQ is enabled, the number of queues is 2*N + 1,
> so I think in that case n->n_queues is also short by one in the code
> below.
I think the patch could be changed to:
> > [Only responding because this landed in tests/libqos, which I do try
> > to
> > keep an eye on, but this patch is opaque to me. --js]
> >
> > > ---
> > > tests/libqos/virtio-net.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/tests/libqos/virtio-net.c b/tests/libqos/virtio-net.c
> > > index 66405b646e..247a0a17a8 100644
> > > --- a/tests/libqos/virtio-net.c
> > > +++ b/tests/libqos/virtio-net.c
> > > @@ -51,7 +51,7 @@ static void virtio_net_setup(QVirtioNet
> > > *interface)
> > > if (features & (1u << VIRTIO_NET_F_MQ)) {
> > > interface->n_queues = qvirtio_config_readw(vdev, 8) * 2;
> > > } else {
> > > - interface->n_queues = 2;
> > > + interface->n_queues = 3;
> > > }
interface->n_queues++; /* ctrl vq */
And a comment added to the QVirtQueue::n_queues field definition:
/* total number of virtqueues (rx, tx, ctrl) */
This will prevent confusion about whether the ctrl queue is counted or
not.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-07-26 13:09 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-25 3:23 [Qemu-devel] [RFC 00/19] Add virtual device fuzzing support Oleinik, Alexander
2019-07-25 3:23 ` [Qemu-devel] [RFC 01/19] fuzz: add configure option and linker objects Oleinik, Alexander
2019-07-25 9:39 ` Paolo Bonzini
2019-07-25 3:23 ` [Qemu-devel] [RFC 02/19] fuzz: add FUZZ_TARGET type to qemu module system Oleinik, Alexander
2019-07-26 12:32 ` Stefan Hajnoczi
2019-07-25 3:23 ` [Qemu-devel] [RFC 03/19] fuzz: add fuzz accelerator Oleinik, Alexander
2019-07-26 10:33 ` Paolo Bonzini
2019-07-26 12:35 ` Stefan Hajnoczi
2019-07-25 3:23 ` [Qemu-devel] [RFC 04/19] fuzz: Add qos support to fuzz targets Oleinik, Alexander
2019-07-26 10:39 ` Paolo Bonzini
2019-07-25 3:23 ` [Qemu-devel] [RFC 05/19] fuzz: expose qemu_savevm_state & skip state header Oleinik, Alexander
2019-07-25 13:22 ` Dr. David Alan Gilbert
2019-07-25 3:23 ` [Qemu-devel] [RFC 07/19] fuzz: Modify libqtest to directly invoke qtest.c Oleinik, Alexander
2019-07-25 9:04 ` Thomas Huth
2019-07-25 9:33 ` Paolo Bonzini
2019-07-26 12:49 ` Stefan Hajnoczi
2019-07-26 12:56 ` Stefan Hajnoczi
2019-07-26 21:50 ` Paolo Bonzini
2019-07-25 3:23 ` [Qemu-devel] [RFC 06/19] fuzz: Add ramfile for fast vmstate/vmload Oleinik, Alexander
2019-07-26 12:47 ` Stefan Hajnoczi
2019-07-26 19:36 ` Oleinik, Alexander
2019-07-26 19:54 ` Paolo Bonzini
2019-07-25 3:23 ` [Qemu-devel] [RFC 08/19] fuzz: add shims to intercept libfuzzer init Oleinik, Alexander
2019-07-25 8:21 ` Paolo Bonzini
2019-07-26 12:59 ` Stefan Hajnoczi
2019-07-25 3:23 ` [Qemu-devel] [RFC 09/19] fuzz: use mtree_info to find mapped addresses Oleinik, Alexander
2019-07-26 13:04 ` Stefan Hajnoczi
2019-07-26 21:51 ` Paolo Bonzini
2019-07-25 3:23 ` [Qemu-devel] [RFC 10/19] fuzz: expose real_main (aka regular vl.c:main) Oleinik, Alexander
2019-07-25 9:38 ` Paolo Bonzini
2019-07-25 3:23 ` [Qemu-devel] [RFC 11/19] fuzz: add direct send/receive in qtest client Oleinik, Alexander
2019-07-25 9:10 ` Thomas Huth
2019-07-25 3:23 ` [Qemu-devel] [RFC 12/19] fuzz: hard-code all of the needed files for build Oleinik, Alexander
2019-07-25 3:23 ` [Qemu-devel] [RFC 13/19] fuzz: add ctrl vq support to virtio-net in libqos Oleinik, Alexander
2019-07-25 16:25 ` John Snow
2019-07-25 17:05 ` Oleinik, Alexander
2019-07-26 13:09 ` Stefan Hajnoczi [this message]
2019-07-25 3:23 ` [Qemu-devel] [RFC 14/19] fuzz: hard-code a main-loop timeout Oleinik, Alexander
2019-07-25 9:40 ` Paolo Bonzini
2019-07-25 3:23 ` [Qemu-devel] [RFC 15/19] fuzz: add fuzz accelerator type Oleinik, Alexander
2019-07-25 3:23 ` [Qemu-devel] [RFC 16/19] fuzz: add general fuzzer entrypoints Oleinik, Alexander
2019-07-25 17:53 ` Philippe Mathieu-Daudé
2019-07-25 3:23 ` [Qemu-devel] [RFC 17/19] fuzz: add general qtest fuzz target Oleinik, Alexander
2019-07-25 3:24 ` [Qemu-devel] [RFC 18/19] fuzz: Add virtio-net tx and ctrl fuzz targets Oleinik, Alexander
2019-07-25 3:24 ` [Qemu-devel] [RFC 19/19] fuzz: Add documentation about the fuzzer to docs/ Oleinik, Alexander
2019-07-26 13:19 ` Stefan Hajnoczi
2019-07-25 3:41 ` [Qemu-devel] [RFC 00/19] Add virtual device fuzzing support no-reply
2019-07-26 13:24 ` Stefan Hajnoczi
2019-08-06 9:59 ` jiade zhang
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=20190726130907.GH25977@stefanha-x1.localdomain \
--to=stefanha@gmail.com \
--cc=alxndr@bu.edu \
--cc=bsd@redhat.com \
--cc=jsnow@redhat.com \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=superirishdonkey@gmail.com \
--cc=thuth@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).