From: Kirti Wankhede <kwankhede@nvidia.com>
To: Jike Song <jike.song@intel.com>,
Xiao Guangrong <guangrong.xiao@linux.intel.com>
Cc: <alex.williamson@redhat.com>, <pbonzini@redhat.com>,
<kraxel@redhat.com>, <cjia@nvidia.com>, <shuai.ruan@intel.com>,
<kvm@vger.kernel.org>, <kevin.tian@intel.com>,
<qemu-devel@nongnu.org>, <zhiyuan.lv@intel.com>,
<bjsdjshi@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 1/3] Mediated device Core driver
Date: Fri, 1 Jul 2016 00:28:15 +0530 [thread overview]
Message-ID: <428eeb3a-5488-41f0-5057-2cecd2f32d2e@nvidia.com> (raw)
In-Reply-To: <5774C670.7080200@intel.com>
On 6/30/2016 12:42 PM, Jike Song wrote:
> On 06/29/2016 09:51 PM, Xiao Guangrong wrote:
>> On 06/21/2016 12:31 AM, Kirti Wankhede wrote:
>>> + mutex_unlock(&parent_devices.list_lock);
>>> + return parent;
>>> +}
>>> +
>>> +static int mdev_device_create_ops(struct mdev_device *mdev, char *mdev_params)
>>> +{
>>> + struct parent_device *parent = mdev->parent;
>>> + int ret;
>>> +
>>> + mutex_lock(&parent->ops_lock);
>>> + if (parent->ops->create) {
>>> + ret = parent->ops->create(mdev->dev.parent, mdev->uuid,
>>> + mdev->instance, mdev_params);
>>
>> I think it is better if we pass @mdev to this callback, then the parent driver
>> can do its specified operations and associate it with the instance,
>> e.g, via mdev->private.
>>
>
> Just noticed that mdev->driver_data is missing in v5, I'd like to have it back :)
>
Actually, I added mdev_get_drvdata() and mdev_set_drvdata() but I missed
earlier that mdev->dev->driver_data is used by vfio module to keep
reference of vfio_device. So adding driver_data to struct mdev_device
again and updating mdev_get_drvdata() and mdev_set_drvdata() as below.
static inline void *mdev_get_drvdata(struct mdev_device *mdev)
{
- return dev_get_drvdata(&mdev->dev);
+ return mdev->driver_data;
}
static inline void mdev_set_drvdata(struct mdev_device *mdev, void *data)
{
- dev_set_drvdata(&mdev->dev, data);
+ mdev->driver_data = data;
}
> Yes either mdev need to be passed to parent driver (preferred), or find_mdev_device to
> be exported for parent driver (less preferred, but at least functional).
>
Updating argument to create to have mdev.
Thanks,
Kirti.
next prev parent reply other threads:[~2016-06-30 18:58 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-20 16:31 [RFC PATCH v5 0/3] Add Mediated device support Kirti Wankhede
2016-06-20 16:31 ` [PATCH 1/3] Mediated device Core driver Kirti Wankhede
2016-06-21 7:38 ` Jike Song
2016-06-21 21:30 ` Alex Williamson
2016-06-24 17:54 ` Kirti Wankhede
2016-06-24 19:40 ` Alex Williamson
2016-06-30 16:48 ` Kirti Wankhede
2016-06-29 13:51 ` Xiao Guangrong
2016-06-30 7:12 ` Jike Song
2016-06-30 18:58 ` Kirti Wankhede [this message]
2016-06-30 18:51 ` [Qemu-devel] " Kirti Wankhede
2016-07-04 7:27 ` Xiao Guangrong
2016-07-04 2:08 ` Jike Song
2016-06-20 16:31 ` [PATCH 2/3] VFIO driver for mediated PCI device Kirti Wankhede
2016-06-21 22:48 ` Alex Williamson
2016-06-24 18:34 ` Kirti Wankhede
2016-06-24 19:45 ` Alex Williamson
2016-06-28 18:45 ` Kirti Wankhede
2016-06-29 2:54 ` Alex Williamson
2016-06-30 16:54 ` Kirti Wankhede
2016-06-30 6:34 ` Xiao Guangrong
2016-06-20 16:31 ` [PATCH 3/3] VFIO Type1 IOMMU: Add support for mediated devices Kirti Wankhede
2016-06-22 3:46 ` Alex Williamson
2016-06-28 13:02 ` Kirti Wankhede
2016-06-29 2:46 ` Alex Williamson
2016-06-30 8:28 ` Tian, Kevin
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=428eeb3a-5488-41f0-5057-2cecd2f32d2e@nvidia.com \
--to=kwankhede@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=bjsdjshi@linux.vnet.ibm.com \
--cc=cjia@nvidia.com \
--cc=guangrong.xiao@linux.intel.com \
--cc=jike.song@intel.com \
--cc=kevin.tian@intel.com \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=shuai.ruan@intel.com \
--cc=zhiyuan.lv@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