From: Alex Williamson <alex.williamson@redhat.com>
To: Kirti Wankhede <kwankhede@nvidia.com>
Cc: <pbonzini@redhat.com>, <kraxel@redhat.com>, <cjia@nvidia.com>,
<qemu-devel@nongnu.org>, <kvm@vger.kernel.org>,
<kevin.tian@intel.com>, <shuai.ruan@intel.com>,
<jike.song@intel.com>, <zhiyuan.lv@intel.com>,
<bjsdjshi@linux.vnet.ibm.com>
Subject: Re: [PATCH 2/3] VFIO driver for mediated PCI device
Date: Tue, 28 Jun 2016 20:54:27 -0600 [thread overview]
Message-ID: <20160628205427.155ea634@t450s.home> (raw)
In-Reply-To: <75c10494-b983-d3a9-489f-66accc68c1ae@nvidia.com>
On Wed, 29 Jun 2016 00:15:23 +0530
Kirti Wankhede <kwankhede@nvidia.com> wrote:
> On 6/25/2016 1:15 AM, Alex Williamson wrote:
> > On Sat, 25 Jun 2016 00:04:27 +0530
> > Kirti Wankhede <kwankhede@nvidia.com> wrote:
> >
>
> >>>> +
> >>>> +static int mdev_get_irq_count(struct vfio_mdev *vmdev, int irq_type)
> >>>> +{
> >>>> + /* Don't support MSIX for now */
> >>>> + if (irq_type == VFIO_PCI_MSIX_IRQ_INDEX)
> >>>> + return -1;
> >>>> +
> >>>> + return 1;
> >>>
> >>> Too much hard coding here, the mediated driver should define this.
> >>>
> >>
> >> I'm testing INTX and MSI, I don't have a way to test MSIX for now. So we
> >> thought we can add supported for MSIX later. Till then hard code it to 1.
> >
> > To me it screams that there needs to be an interface to the mediated
> > device here. How do you even know that the mediated device intends to
> > support MSI? What if it wants to emulated a VF and not support INTx?
> > This is basically just a big "TODO" flag that needs to be addressed
> > before a non-RFC.
> >
>
> VFIO user space app reads emulated PCI config space of mediated device.
> In PCI capability list when MSI capability (PCI_CAP_ID_MSI) is present,
> it calls VFIO_DEVICE_SET_IRQS ioctl with irq_set->index set to
> VFIO_PCI_MSI_IRQ_INDEX.
> Similarly, MSIX is identified from emulated config space of mediated
> device that checks if MSI capability is present and number of vectors
> extracted from PCI_MSI_FLAGS_QSIZE flag.
> vfio_mpci modules don't need to query it from vendor driver of mediated
> device. Depending on which interrupt to support, mediated driver should
> emulate PCI config space.
Are you suggesting that if the user can determine which interrupts are
supported and the various counts for each by querying the PCI config
space of the mediated device then this interface should do the same,
much like vfio_pci_get_irq_count(), such that it can provide results
consistent with config space? That I'm ok with. Having the user find
one IRQ count as they read PCI config space and another via the vfio
API, I'm not ok with. Thanks,
Alex
next prev parent reply other threads:[~2016-06-29 2:54 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 ` [Qemu-devel] " Kirti Wankhede
2016-06-30 18:51 ` 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 [this message]
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=20160628205427.155ea634@t450s.home \
--to=alex.williamson@redhat.com \
--cc=bjsdjshi@linux.vnet.ibm.com \
--cc=cjia@nvidia.com \
--cc=jike.song@intel.com \
--cc=kevin.tian@intel.com \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
--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