[PATCH 0/2] s390x: ccw: A simple test device for virtio CCW

Pierre Morel posted 2 patches 2 years, 7 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1630061450-18744-1-git-send-email-pmorel@linux.ibm.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Halil Pasic <pasic@linux.ibm.com>, Cornelia Huck <cohuck@redhat.com>, Thomas Huth <thuth@redhat.com>, Christian Borntraeger <borntraeger@de.ibm.com>, David Hildenbrand <david@redhat.com>
hw/s390x/meson.build                        |   1 +
hw/s390x/virtio-ccw-pong.c                  |  66 ++++++++
hw/s390x/virtio-ccw.h                       |  13 ++
hw/virtio/Kconfig                           |   5 +
hw/virtio/meson.build                       |   1 +
hw/virtio/virtio-pong.c                     | 161 ++++++++++++++++++++
include/hw/virtio/virtio-pong.h             |  34 +++++
include/standard-headers/linux/virtio_ids.h |   1 +
8 files changed, 282 insertions(+)
create mode 100644 hw/s390x/virtio-ccw-pong.c
create mode 100644 hw/virtio/virtio-pong.c
create mode 100644 include/hw/virtio/virtio-pong.h
[PATCH 0/2] s390x: ccw: A simple test device for virtio CCW
Posted by Pierre Morel 2 years, 7 months ago
Hello All,


This series presents a VIRTIO test device which receives data on its
input channel and sends back a simple checksum for the data it received
on its output channel.
 
The goal is to allow a simple VIRTIO device driver to check the VIRTIO
initialization and various data transfer.

For this I introduced a new device ID for the device and having no
Linux driver but a kvm-unit-test driver, I have the following
questions:

Is there another way to advertise new VIRTIO IDs but Linux?
If this QEMU test meet interest, should I write a Linux test program?

Regards,
Pierre


Pierre Morel (2):
  virtio: Linux: Update of virtio_ids
  s390x: ccw: A simple test device for virtio CCW

 hw/s390x/meson.build                        |   1 +
 hw/s390x/virtio-ccw-pong.c                  |  66 ++++++++
 hw/s390x/virtio-ccw.h                       |  13 ++
 hw/virtio/Kconfig                           |   5 +
 hw/virtio/meson.build                       |   1 +
 hw/virtio/virtio-pong.c                     | 161 ++++++++++++++++++++
 include/hw/virtio/virtio-pong.h             |  34 +++++
 include/standard-headers/linux/virtio_ids.h |   1 +
 8 files changed, 282 insertions(+)
 create mode 100644 hw/s390x/virtio-ccw-pong.c
 create mode 100644 hw/virtio/virtio-pong.c
 create mode 100644 include/hw/virtio/virtio-pong.h

-- 
2.25.1


Re: [PATCH 0/2] s390x: ccw: A simple test device for virtio CCW
Posted by Christian Borntraeger 2 years, 7 months ago

On 27.08.21 12:50, Pierre Morel wrote:
> Hello All,
> 
> 
> This series presents a VIRTIO test device which receives data on its
> input channel and sends back a simple checksum for the data it received
> on its output channel.
>   
> The goal is to allow a simple VIRTIO device driver to check the VIRTIO
> initialization and various data transfer.
> 
> For this I introduced a new device ID for the device and having no
> Linux driver but a kvm-unit-test driver, I have the following
> questions:

I think we should reserve an ID in the official virtio spec then for such a device?
Maybe also add mst for such things.
  

> Is there another way to advertise new VIRTIO IDs but Linux?
> If this QEMU test meet interest, should I write a Linux test program?
> 
> Regards,
> Pierre
> 
> 
> Pierre Morel (2):
>    virtio: Linux: Update of virtio_ids
>    s390x: ccw: A simple test device for virtio CCW
> 
>   hw/s390x/meson.build                        |   1 +
>   hw/s390x/virtio-ccw-pong.c                  |  66 ++++++++
>   hw/s390x/virtio-ccw.h                       |  13 ++
>   hw/virtio/Kconfig                           |   5 +
>   hw/virtio/meson.build                       |   1 +
>   hw/virtio/virtio-pong.c                     | 161 ++++++++++++++++++++
>   include/hw/virtio/virtio-pong.h             |  34 +++++
>   include/standard-headers/linux/virtio_ids.h |   1 +
>   8 files changed, 282 insertions(+)
>   create mode 100644 hw/s390x/virtio-ccw-pong.c
>   create mode 100644 hw/virtio/virtio-pong.c
>   create mode 100644 include/hw/virtio/virtio-pong.h
> 

Re: [PATCH 0/2] s390x: ccw: A simple test device for virtio CCW
Posted by Halil Pasic 2 years, 7 months ago
On Mon, 30 Aug 2021 11:51:51 +0200
Christian Borntraeger <borntraeger@de.ibm.com> wrote:

> On 27.08.21 12:50, Pierre Morel wrote:
> > Hello All,
> > 
> > 
> > This series presents a VIRTIO test device which receives data on its
> > input channel and sends back a simple checksum for the data it received
> > on its output channel.
> >   
> > The goal is to allow a simple VIRTIO device driver to check the VIRTIO
> > initialization and various data transfer.

Can you please elaborate a little on the objectives.

> > 
> > For this I introduced a new device ID for the device and having no
> > Linux driver but a kvm-unit-test driver, I have the following
> > questions:  
> 
> I think we should reserve an ID in the official virtio spec then for such a device?
> Maybe also add mst for such things.

I agree having ID reserved is a good idea. But then if we are going to
introduce an official test device, I believe we should write a
specification for it as well. Yes having the guarantee that test devices
and real devices won't mix is a value in itself, but if we had a
standardized test device, whoever does work with it would not have to
ask themselves is this test device compatible with this test device
driver.

>   
> 
> > Is there another way to advertise new VIRTIO IDs but Linux?
> > If this QEMU test meet interest, should I write a Linux test program?
> > 

You may not simply claim and advertise a VIRTIO ID. The virtio ids
are allocated by the virtio standardisation body, and the list of the
IDs reserved in the v1.1-cs01 incarnation of the spec can be found here:
https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/virtio-v1.1-cs01.html#x1-1930005

For how to contribute to the virtio specification please take look at
this:
https://github.com/oasis-tcs/virtio-admin/blob/master/README.md

> > Regards,
> > Pierre
> > 
> > 
> > Pierre Morel (2):
> >    virtio: Linux: Update of virtio_ids
> >    s390x: ccw: A simple test device for virtio CCW
> > 
> >   hw/s390x/meson.build                        |   1 +
> >   hw/s390x/virtio-ccw-pong.c                  |  66 ++++++++
> >   hw/s390x/virtio-ccw.h                       |  13 ++
> >   hw/virtio/Kconfig                           |   5 +
> >   hw/virtio/meson.build                       |   1 +
> >   hw/virtio/virtio-pong.c                     | 161 ++++++++++++++++++++
> >   include/hw/virtio/virtio-pong.h             |  34 +++++
> >   include/standard-headers/linux/virtio_ids.h |   1 +
> >   8 files changed, 282 insertions(+)
> >   create mode 100644 hw/s390x/virtio-ccw-pong.c
> >   create mode 100644 hw/virtio/virtio-pong.c
> >   create mode 100644 include/hw/virtio/virtio-pong.h
> >   


Re: [PATCH 0/2] s390x: ccw: A simple test device for virtio CCW
Posted by Pierre Morel 2 years, 7 months ago

On 8/30/21 10:42 PM, Halil Pasic wrote:
> On Mon, 30 Aug 2021 11:51:51 +0200
> Christian Borntraeger <borntraeger@de.ibm.com> wrote:
> 
>> On 27.08.21 12:50, Pierre Morel wrote:
>>> Hello All,
>>>
>>>
>>> This series presents a VIRTIO test device which receives data on its
>>> input channel and sends back a simple checksum for the data it received
>>> on its output channel.
>>>    
>>> The goal is to allow a simple VIRTIO device driver to check the VIRTIO
>>> initialization and various data transfer.
> 
> Can you please elaborate a little on the objectives.

Yes I will, but I must think a lot more about it, I think doing the 
specifications you speak about later in this response is the right way 
to do it.


> 
>>>
>>> For this I introduced a new device ID for the device and having no
>>> Linux driver but a kvm-unit-test driver, I have the following
>>> questions:
>>
>> I think we should reserve an ID in the official virtio spec then for such a device?
>> Maybe also add mst for such things.
> 
> I agree having ID reserved is a good idea. But then if we are going to
> introduce an official test device, I believe we should write a
> specification for it as well. Yes having the guarantee that test devices
> and real devices won't mix is a value in itself, but if we had a
> standardized test device, whoever does work with it would not have to
> ask themselves is this test device compatible with this test device
> driver.

Yes right.

> 
>>    
>>
>>> Is there another way to advertise new VIRTIO IDs but Linux?
>>> If this QEMU test meet interest, should I write a Linux test program?
>>>
> 
> You may not simply claim and advertise a VIRTIO ID. The virtio ids
> are allocated by the virtio standardisation body, and the list of the
> IDs reserved in the v1.1-cs01 incarnation of the spec can be found here:
> https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/virtio-v1.1-cs01.html#x1-1930005
> 
> For how to contribute to the virtio specification please take look at
> this:
> https://github.com/oasis-tcs/virtio-admin/blob/master/README.md

Thanks, I will go this way.


Thanks for these constructive answers,

Regards,
Pierre



-- 
Pierre Morel
IBM Lab Boeblingen

Re: [PATCH 0/2] s390x: ccw: A simple test device for virtio CCW
Posted by Pierre Morel 2 years, 7 months ago

On 8/30/21 11:51 AM, Christian Borntraeger wrote:
> 
> 
> On 27.08.21 12:50, Pierre Morel wrote:
>> Hello All,
>>
>>
>> This series presents a VIRTIO test device which receives data on its
>> input channel and sends back a simple checksum for the data it received
>> on its output channel.
>> The goal is to allow a simple VIRTIO device driver to check the VIRTIO
>> initialization and various data transfer.
>>
>> For this I introduced a new device ID for the device and having no
>> Linux driver but a kvm-unit-test driver, I have the following
>> questions:
> 
> I think we should reserve an ID in the official virtio spec then for 
> such a device?

Yes, you are right, I think we should.

> Maybe also add mst for such things.

Yes, I did.

Thanks,
Pierre



-- 
Pierre Morel
IBM Lab Boeblingen