From: Yishai Hadas <yishaih@nvidia.com>
To: Jason Gunthorpe <jgg@nvidia.com>,
Alex Williamson <alex.williamson@redhat.com>
Cc: Xin Zeng <xin.zeng@intel.com>, <herbert@gondor.apana.org.au>,
<shameerali.kolothum.thodi@huawei.com>, <kevin.tian@intel.com>,
<linux-crypto@vger.kernel.org>, <kvm@vger.kernel.org>,
<qat-linux@intel.com>, Yahui Cao <yahui.cao@intel.com>
Subject: Re: [PATCH v3 10/10] vfio/qat: Add vfio_pci driver for Intel QAT VF devices
Date: Thu, 29 Feb 2024 17:53:09 +0200 [thread overview]
Message-ID: <bd471602-ef7e-4552-8de4-aba604739c62@nvidia.com> (raw)
In-Reply-To: <20240229141023.GF9179@nvidia.com>
On 29/02/2024 16:10, Jason Gunthorpe wrote:
> On Wed, Feb 28, 2024 at 12:07:06PM -0700, Alex Williamson wrote:
>> On Mon, 26 Feb 2024 15:24:58 -0700
>> Alex Williamson <alex.williamson@redhat.com> wrote:
>>
>>> On Mon, 26 Feb 2024 15:49:52 -0400
>>> Jason Gunthorpe <jgg@nvidia.com> wrote:
>>>
>>>> On Mon, Feb 26, 2024 at 12:41:07PM -0700, Alex Williamson wrote:
>>>>> On Mon, 26 Feb 2024 15:12:20 -0400
>>>>> libvirt recently implemented support for managed="yes" with variant
>>>>> drivers where it will find the best "vfio_pci" driver for a device
>>>>> using an algorithm like Max suggested, but in practice it's not clear
>>>>> how useful that will be considering devices likes CX7 require
>>>>> configuration before binding to the variant driver. libvirt has no
>>>>> hooks to specify or perform configuration at that point.
>>>>
>>>> I don't think this is fully accurate (or at least not what was
>>>> intended), the VFIO device can be configured any time up until the VM
>>>> mlx5 driver reaches the device startup.
>>>>
>>>> Is something preventing this? Did we accidentally cache the migratable
>>>> flag in vfio or something??
>>>
>>> I don't think so, I think this was just the policy we had decided
>>> relative to profiling VFs when they're created rather than providing a
>>> means to do it though a common vfio variant driver interface[1].
>>
>> Turns out that yes, migration support needs to be established at probe
>> time. vfio_pci_core_register_device() expects migration_flags,
>> mig_ops, and log_ops to all be established by this point, which for
>> mlx5-vfio-pci occurs when the .init function calls
>> mlx5vf_cmd_set_migratable().
>
> This is unfortunate, we should look at trying to accomodate this,
> IMHO. Yishai?
I'm not sure what is the alternative here.
Moving to the open() might be too late if the guest driver will be
active already, this might prevent changing/setting some caps/profiling,
by that time.
In addition, as Alex wrote, today upon probe() each driver calls
vfio_pci_core_register_device() and by that time the 'mig/log' ops are
checked.
Making a change here, I believe, requires a good justification / use
case and a working alternative and design.
Note:
The above is true for other migration drivers around which upon probe
should supply their 'mig/log' ops.
>
>> That also makes me wonder what happens if migration support is disabled
>> via devlink after binding the VF to mlx5-vfio-pci. Arguably this could
>> be considered user error, but what's the failure mode and support
>> implication? Thanks,
>
> I think tThe FW will start failing the migration commands.
>
Right, please see my previous answer here, I supplied some further details.
Yishai
next prev parent reply other threads:[~2024-02-29 15:53 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-21 15:49 [PATCH v3 00/10] crypto: qat - enable QAT GEN4 SRIOV VF live migration for QAT GEN4 Xin Zeng
2024-02-21 15:49 ` [PATCH v3 01/10] crypto: qat - adf_get_etr_base() helper Xin Zeng
2024-02-21 15:50 ` [PATCH v3 02/10] crypto: qat - relocate and rename 4xxx PF2VM definitions Xin Zeng
2024-02-21 15:50 ` [PATCH v3 03/10] crypto: qat - move PFVF compat checker to a function Xin Zeng
2024-02-21 15:50 ` [PATCH v3 04/10] crypto: qat - relocate CSR access code Xin Zeng
2024-02-21 15:50 ` [PATCH v3 05/10] crypto: qat - rename get_sla_arr_of_type() Xin Zeng
2024-02-21 15:50 ` [PATCH v3 06/10] crypto: qat - expand CSR operations for QAT GEN4 devices Xin Zeng
2024-02-21 15:50 ` [PATCH v3 07/10] crypto: qat - add bank save and restore flows Xin Zeng
2024-02-21 15:50 ` [PATCH v3 08/10] crypto: qat - add interface for live migration Xin Zeng
2024-02-21 15:50 ` [PATCH v3 09/10] crypto: qat - implement " Xin Zeng
2024-02-21 15:50 ` [PATCH v3 10/10] vfio/qat: Add vfio_pci driver for Intel QAT VF devices Xin Zeng
2024-02-26 18:55 ` Alex Williamson
2024-02-26 19:12 ` Jason Gunthorpe
2024-02-26 19:41 ` Alex Williamson
2024-02-26 19:49 ` Jason Gunthorpe
2024-02-26 22:24 ` Alex Williamson
2024-02-28 19:07 ` Alex Williamson
2024-02-29 12:36 ` Yishai Hadas
2024-02-29 14:10 ` Jason Gunthorpe
2024-02-29 15:53 ` Yishai Hadas [this message]
2024-02-29 14:22 ` Jason Gunthorpe
2024-02-26 20:25 ` Cabiddu, Giovanni
2024-02-28 13:57 ` Zeng, Xin
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=bd471602-ef7e-4552-8de4-aba604739c62@nvidia.com \
--to=yishaih@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=herbert@gondor.apana.org.au \
--cc=jgg@nvidia.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=qat-linux@intel.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=xin.zeng@intel.com \
--cc=yahui.cao@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