* [Qemu-devel] [PATCH] pci-testdev: add nodata test
@ 2015-08-27 10:30 Michael S. Tsirkin
2015-08-27 11:47 ` Gonglei
2015-08-31 3:04 ` Jason Wang
0 siblings, 2 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2015-08-27 10:30 UTC (permalink / raw)
To: qemu-devel; +Cc: Jason Wang, Gonglei, Markus Armbruster
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
#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"
};
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;
--
MST
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] pci-testdev: add nodata test
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
1 sibling, 0 replies; 7+ messages in thread
From: Gonglei @ 2015-08-27 11:47 UTC (permalink / raw)
To: Michael S. Tsirkin, qemu-devel; +Cc: Jason Wang, Markus Armbruster
On 2015/8/27 18:30, 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(-)
>
Reviewed-by: Gonglei <arei.gongeli@huawei.com>
> 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
>
> #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"
> };
>
> 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;
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] pci-testdev: add nodata test
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
1 sibling, 1 reply; 7+ messages in thread
From: Jason Wang @ 2015-08-31 3:04 UTC (permalink / raw)
To: Michael S. Tsirkin, qemu-devel; +Cc: Gonglei, Markus Armbruster
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".
> };
>
> 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?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] pci-testdev: add nodata test
2015-08-31 3:04 ` Jason Wang
@ 2015-08-31 7:28 ` Michael S. Tsirkin
2015-08-31 8:01 ` Jason Wang
0 siblings, 1 reply; 7+ messages in thread
From: Michael S. Tsirkin @ 2015-08-31 7:28 UTC (permalink / raw)
To: Jason Wang; +Cc: Gonglei, qemu-devel, Markus Armbruster
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 ...
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] pci-testdev: add nodata test
2015-08-31 7:28 ` Michael S. Tsirkin
@ 2015-08-31 8:01 ` Jason Wang
2015-08-31 11:39 ` Michael S. Tsirkin
0 siblings, 1 reply; 7+ messages in thread
From: Jason Wang @ 2015-08-31 8:01 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: Gonglei, qemu-devel, Markus Armbruster
On 08/31/2015 03:28 PM, Michael S. Tsirkin wrote:
> 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.
But I get:
...
portio-no-eventfd:pci-io 5024
portio-wildcard-eventfd:pci-io 1731
portio-datamatch-eventfd:pci-io 1731
portio-nodata-eventfd:pci-io 4967
...
>>> };
>>>
>>> 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 ...
>
I mean for example having both datamatch and wildcard eventfds in a
single subtest. E.g in "datamatch-eventfd", registering 1 or more
wildcard eventfd before doing the real tests.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] pci-testdev: add nodata test
2015-08-31 8:01 ` Jason Wang
@ 2015-08-31 11:39 ` Michael S. Tsirkin
2015-09-01 3:17 ` Jason Wang
0 siblings, 1 reply; 7+ messages in thread
From: Michael S. Tsirkin @ 2015-08-31 11:39 UTC (permalink / raw)
To: Jason Wang; +Cc: Gonglei, qemu-devel, Markus Armbruster
On Mon, Aug 31, 2015 at 04:01:11PM +0800, Jason Wang wrote:
>
>
> On 08/31/2015 03:28 PM, Michael S. Tsirkin wrote:
> > 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.
>
> But I get:
>
> ...
> portio-no-eventfd:pci-io 5024
> portio-wildcard-eventfd:pci-io 1731
> portio-datamatch-eventfd:pci-io 1731
> portio-nodata-eventfd:pci-io 4967
> ...
Weird - I thought I fixed it, but now I see it too.
I'll add code to drop portio-nodata-eventfd.
> >>> };
> >>>
> >>> 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 ...
> >
>
> I mean for example having both datamatch and wildcard eventfds in a
> single subtest. E.g in "datamatch-eventfd", registering 1 or more
> wildcard eventfd before doing the real tests.
For same address? We can't do that - kvm won't let us.
--
MST
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] pci-testdev: add nodata test
2015-08-31 11:39 ` Michael S. Tsirkin
@ 2015-09-01 3:17 ` Jason Wang
0 siblings, 0 replies; 7+ messages in thread
From: Jason Wang @ 2015-09-01 3:17 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: Gonglei, qemu-devel, Markus Armbruster
On 08/31/2015 07:39 PM, Michael S. Tsirkin wrote:
>>>> Since you're at this, how about introduce a test that mixes datamatch
>>>> > >> and wildcard?
>>> > > How do you mean? wildcard means ignore data ...
>>> > >
>> >
>> > I mean for example having both datamatch and wildcard eventfds in a
>> > single subtest. E.g in "datamatch-eventfd", registering 1 or more
>> > wildcard eventfd before doing the real tests.
> For same address? We can't do that - kvm won't let us.
Not same. Which can make test to be more similar like real machine.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-09-01 3:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2015-08-31 8:01 ` Jason Wang
2015-08-31 11:39 ` Michael S. Tsirkin
2015-09-01 3:17 ` Jason Wang
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).