mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Cornelia Huck <cohuck@redhat.com>
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org,
	intel-gvt-dev@lists.freedesktop.org, kwankhede@nvidia.com,
	alex.williamson@redhat.com, mst@redhat.com, tiwei.bie@intel.com,
	virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org, maxime.coquelin@redhat.com,
	cunming.liang@intel.com, zhihong.wang@intel.com,
	rob.miller@broadcom.com, xiao.w.wang@intel.com,
	haotian.wang@sifive.com, zhenyuw@linux.intel.com,
	zhi.a.wang@intel.com, jani.nikula@linux.intel.com,
	joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com,
	airlied@linux.ie, daniel@ffwll.ch, farman@linux.ibm.com,
	pasic@linux.ibm.com, sebott@linux.ibm.com, oberpar@linux.ibm.com,
	heiko.carstens@de.ibm.com, gor@linux.ibm.com,
	borntraeger@de.ibm.com, akrowiak@linux.ibm.com,
	freude@linux.ibm.com, lingshan.zhu@intel.com, idos@mellanox.com,
	eperezma@redhat.com, lulu@redhat.com, parav@mellanox.com,
	christophe.de.dinechin@gmail.com, kevin.tian@intel.com,
	stefanha@redhat.com
Subject: Re: [PATCH V4 4/6] mdev: introduce virtio device and its device ops
Date: Mon, 21 Oct 2019 13:36:22 +0800	[thread overview]
Message-ID: <4a34d071-2e78-c37c-1046-7f9f6bb9e67f@redhat.com> (raw)
In-Reply-To: <20191018153042.3516cde1.cohuck@redhat.com>


On 2019/10/18 下午9:30, Cornelia Huck wrote:
> On Fri, 18 Oct 2019 18:55:02 +0800
> Jason Wang <jasowang@redhat.com> wrote:
>
>> On 2019/10/18 下午5:46, Cornelia Huck wrote:
>>> On Thu, 17 Oct 2019 18:48:34 +0800
>>> Jason Wang <jasowang@redhat.com> wrote:
>>>> + * @get_vendor_id:		Get virtio vendor id
>>>> + *				@mdev: mediated device
>>>> + *				Returns u32: virtio vendor id
>>> How is the vendor id defined? As for normal virtio-pci devices?
>>
>> The vendor that provides this device. So something like this
>>
>> I notice that MMIO also had this so it looks to me it's not pci specific.
> Ok. Would be good to specify this more explicitly.


Ok.


>
>>
>>>   
>>>> + * @get_status: 		Get the device status
>>>> + *				@mdev: mediated device
>>>> + *				Returns u8: virtio device status
>>>> + * @set_status: 		Set the device status
>>>> + *				@mdev: mediated device
>>>> + *				@status: virtio device status
>>>> + * @get_config: 		Read from device specific configuration space
>>>> + *				@mdev: mediated device
>>>> + *				@offset: offset from the beginning of
>>>> + *				configuration space
>>>> + *				@buf: buffer used to read to
>>>> + *				@len: the length to read from
>>>> + *				configration space
>>>> + * @set_config: 		Write to device specific configuration space
>>>> + *				@mdev: mediated device
>>>> + *				@offset: offset from the beginning of
>>>> + *				configuration space
>>>> + *				@buf: buffer used to write from
>>>> + *				@len: the length to write to
>>>> + *				configration space
>>>> + * @get_mdev_features:		Get the feature of virtio mdev device
>>>> + *				@mdev: mediated device
>>>> + *				Returns the mdev features (API) support by
>>>> + *				the device.
>>> What kind of 'features' are supposed to go in there? Are these bits,
>>> like you defined for VIRTIO_MDEV_F_VERSION_1 above?
>>
>> It's the API or mdev features other than virtio features. It could be
>> used by driver to determine the capability of the mdev device. Besides
>> _F_VERSION_1, we may add dirty page tracking etc which means we need new
>> device ops.
> Ok, so that's supposed to be distinct bits that can be or'ed together?


Yes.


> Makes sense, but probably needs some more documentation somewhere.


Let me add some doc above this helper.


>
>>
>>>   
>>>> + * @get_generation:		Get device generaton
>>>> + *				@mdev: mediated device
>>>> + *				Returns u32: device generation
>>> Is that callback mandatory?
>>
>> I think so, it's hard to emulate that completely in virtio-mdev transport.
> IIRC, the generation stuff is not mandatory in the current version of
> virtio, as not all transports have that concept.


It looks to me we can have workaround as what has been done by virtio.c. 
Return 0 if this helper is not provided.


>
> Generally, are any of the callbacks optional, or are all of them
> mandatory? From what I understand, you plan to add new things that
> depend on features... would that mean non-mandatory callbacks?


Yes, not all of them were mandatory, I will explicit explain which are 
mandatory and which are not.

Thanks



  reply	other threads:[~2019-10-21  5:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-17 10:48 [PATCH V4 0/6] mdev based hardware virtio offloading support Jason Wang
2019-10-17 10:48 ` [PATCH V4 1/6] mdev: class id support Jason Wang
2019-10-20 23:25   ` Parav Pandit
2019-10-17 10:48 ` [PATCH V4 2/6] modpost: add support for mdev class id Jason Wang
2019-10-20 23:25   ` Parav Pandit
2019-10-17 10:48 ` [PATCH V4 3/6] mdev: introduce device specific ops Jason Wang
2019-10-17 15:07   ` Cornelia Huck
2019-10-17 17:53     ` Alex Williamson
2019-10-18  7:44       ` Cornelia Huck
2019-10-18  7:34     ` Jason Wang
2019-10-20 23:41   ` Parav Pandit
2019-10-21  6:02     ` Jason Wang
2019-10-17 10:48 ` [PATCH V4 4/6] mdev: introduce virtio device and its device ops Jason Wang
2019-10-17 17:53   ` Alex Williamson
2019-10-18  7:35     ` Jason Wang
2019-10-18  9:46   ` Cornelia Huck
2019-10-18 10:55     ` Jason Wang
2019-10-18 13:30       ` Cornelia Huck
2019-10-21  5:36         ` Jason Wang [this message]
2019-10-18  9:46   ` Tiwei Bie
2019-10-18 10:57     ` Jason Wang
2019-10-17 10:48 ` [PATCH V4 5/6] virtio: introduce a mdev based transport Jason Wang
2019-10-18 14:20   ` Cornelia Huck
2019-10-21  5:59     ` Jason Wang
2019-10-21  9:36       ` Cornelia Huck
2019-10-21 10:13         ` Jason Wang
2019-10-17 10:48 ` [PATCH V4 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework 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=4a34d071-2e78-c37c-1046-7f9f6bb9e67f@redhat.com \
    --to=jasowang@redhat.com \
    --cc=airlied@linux.ie \
    --cc=akrowiak@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=christophe.de.dinechin@gmail.com \
    --cc=cohuck@redhat.com \
    --cc=cunming.liang@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eperezma@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=freude@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=haotian.wang@sifive.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=idos@mellanox.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=lingshan.zhu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=lulu@redhat.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=oberpar@linux.ibm.com \
    --cc=parav@mellanox.com \
    --cc=pasic@linux.ibm.com \
    --cc=rob.miller@broadcom.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=sebott@linux.ibm.com \
    --cc=stefanha@redhat.com \
    --cc=tiwei.bie@intel.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xiao.w.wang@intel.com \
    --cc=zhenyuw@linux.intel.com \
    --cc=zhi.a.wang@intel.com \
    --cc=zhihong.wang@intel.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

all inboxes | Powered by JetHome®