From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Gonglei <arei.gonglei@huawei.com>,
qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] pci-testdev: add nodata test
Date: Mon, 31 Aug 2015 10:28:13 +0300 [thread overview]
Message-ID: <20150831102708-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <55E3C44A.1030805@redhat.com>
On Mon, Aug 31, 2015 at 11:04:42AM +0800, Jason Wang wrote:
>
>
> On 08/27/2015 06:30 PM, Michael S. Tsirkin wrote:
> > Add nodata test where data length is ignored.
> > Skip it for port IO since kvm does not support it there.
> >
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> > hw/misc/pci-testdev.c | 15 ++++++++++++---
> > 1 file changed, 12 insertions(+), 3 deletions(-)
> >
> > diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c
> > index 26b9b86..b6e11d6 100644
> > --- a/hw/misc/pci-testdev.c
> > +++ b/hw/misc/pci-testdev.c
> > @@ -45,6 +45,7 @@ typedef struct IOTest {
> >
> > #define IOTEST_DATAMATCH 0xFA
> > #define IOTEST_NOMATCH 0xCE
> > +#define IOTEST_NODATA 0xAB
>
> This is never used.
>
> >
> > #define IOTEST_IOSIZE 128
> > #define IOTEST_MEMSIZE 2048
> > @@ -52,7 +53,8 @@ typedef struct IOTest {
> > static const char *iotest_test[] = {
> > "no-eventfd",
> > "wildcard-eventfd",
> > - "datamatch-eventfd"
> > + "datamatch-eventfd",
> > + "nodata-eventfd"
>
> For PIO test, "nodata-eventfd" actually means "nodata-noeventfd".
Not really - this test is skipped completely for PIO, as
kvm does not support it.
> > };
> >
> > static const char *iotest_type[] = {
> > @@ -261,12 +263,19 @@ static void pci_testdev_realize(PCIDevice *pci_dev, Error **errp)
> > memcpy(test->hdr->name, name, strlen(name) + 1);
> > g_free(name);
> > test->hdr->offset = cpu_to_le32(IOTEST_SIZE(i) + i * IOTEST_ACCESS_WIDTH);
> > - test->size = IOTEST_ACCESS_WIDTH;
> > - test->match_data = strcmp(IOTEST_TEST(i), "wildcard-eventfd");
> > + test->size = strcmp(IOTEST_TEST(i), "nodata-eventfd") ? IOTEST_ACCESS_WIDTH : 0;
> > +
> > + test->match_data = strcmp(IOTEST_TEST(i), "wildcard-eventfd") &&
> > + strcmp(IOTEST_TEST(i), "nodata-eventfd");
> > test->hdr->test = i;
> > test->hdr->data = test->match_data ? IOTEST_DATAMATCH : IOTEST_NOMATCH;
> > test->hdr->width = IOTEST_ACCESS_WIDTH;
> > test->mr = IOTEST_REGION(d, i);
> > +
> > + if (!test->size && !IOTEST_IS_MEM(i)) {
> > + test->hasnotifier = false;
> > + continue;
> > + }
> > if (!strcmp(IOTEST_TEST(i), "no-eventfd")) {
> > test->hasnotifier = false;
> > continue;
>
> Since you're at this, how about introduce a test that mixes datamatch
> and wildcard?
How do you mean? wildcard means ignore data ...
next prev parent reply other threads:[~2015-08-31 7:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-27 10:30 [Qemu-devel] [PATCH] pci-testdev: add nodata test Michael S. Tsirkin
2015-08-27 11:47 ` Gonglei
2015-08-31 3:04 ` Jason Wang
2015-08-31 7:28 ` Michael S. Tsirkin [this message]
2015-08-31 8:01 ` Jason Wang
2015-08-31 11:39 ` Michael S. Tsirkin
2015-09-01 3:17 ` Jason Wang
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=20150831102708-mutt-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=armbru@redhat.com \
--cc=jasowang@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).