All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zeng, Xin" <xin.zeng@intel.com>
To: Brett Creeley <bcreeley@amd.com>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Cc: "Cabiddu, Giovanni" <giovanni.cabiddu@intel.com>,
	"andriy.shevchenko@linux.intel.com" 
	<andriy.shevchenko@linux.intel.com>,
	"Cao, Yahui" <yahui.cao@intel.com>
Subject: RE: [RFC 5/5] vfio/qat: Add vfio_pci driver for Intel QAT VF devices
Date: Thu, 24 Aug 2023 07:31:26 +0000	[thread overview]
Message-ID: <DM4PR11MB55021A7ECD9DAB45C246A9DC881DA@DM4PR11MB5502.namprd11.prod.outlook.com> (raw)
In-Reply-To: <10f3159d-62ae-0e4c-8ba4-6f7819a47ecb@amd.com>

On Thursday, August 17, 2023 12:20 AM, Brett Creeley <bcreeley@amd.com> wrote:
> > +{
> > +       struct device *dev = &pdev->dev;
> > +       struct qat_vf_core_device *qat_vdev;
> > +       int ret;
> > +
> > +       qat_vdev = vfio_alloc_device(qat_vf_core_device, core_device.vdev,
> dev, &qat_vf_pci_ops);
> > +       if (IS_ERR(qat_vdev))
> > +               return PTR_ERR(qat_vdev);
> > +
> > +       qat_vdev->vf_id = pci_iov_vf_id(pdev);
> > +       qat_vdev->parent = pdev->physfn;
> > +       if (!qat_vdev->parent || qat_vdev->vf_id < 0)
> > +               return -EINVAL;
> 
> Since vfio_alloc_device() was successful you need to call
> vfio_put_device() in this error case as well.

Good catch, will fix it. 
Thanks for the comment, Brett.

> > +
> > +       pci_set_drvdata(pdev, &qat_vdev->core_device);
> > +       ret = vfio_pci_core_register_device(&qat_vdev->core_device);
> > +       if (ret)
> > +               goto out_put_device;
> > +
> > +       return 0;
> > +
> > +out_put_device:
> > +       vfio_put_device(&qat_vdev->core_device.vdev);
> > +       return ret;
> > +}
> > +
> > +static struct qat_vf_core_device *qat_vf_drvdata(struct pci_dev *pdev)
> > +{
> > +       struct vfio_pci_core_device *core_device = pci_get_drvdata(pdev);
> > +
> > +       return container_of(core_device, struct qat_vf_core_device,
> core_device);
> > +}
> > +
> > +

> > +MODULE_LICENSE("GPL");
> > +MODULE_AUTHOR("Intel Corporation");
> > +MODULE_DESCRIPTION("QAT VFIO PCI - VFIO PCI driver with live
> migration support for Intel(R) QAT device family");
> > --
> > 2.18.2
> >

      reply	other threads:[~2023-08-24  7:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-30 13:12 [RFC 0/5] crypto: qat - enable SRIOV VF live migration Xin Zeng
2023-06-30 13:13 ` [RFC 1/5] crypto: qat - add bank save/restore and RP drain Xin Zeng
2023-08-04  7:51   ` Tian, Kevin
2023-08-11  8:52     ` Wan, Siming
2023-06-30 13:13 ` [RFC 2/5] crypto: qat - add interface for live migration Xin Zeng
2023-08-04  7:52   ` Tian, Kevin
2023-08-24  7:27     ` Zeng, Xin
2023-06-30 13:13 ` [RFC 3/5] units: Add HZ_PER_GHZ Xin Zeng
2023-06-30 13:13 ` [RFC 4/5] crypto: qat - implement interface for live migration Xin Zeng
2023-08-04  7:55   ` Tian, Kevin
2023-08-24  7:28     ` Zeng, Xin
2023-06-30 13:13 ` [RFC 5/5] vfio/qat: Add vfio_pci driver for Intel QAT VF devices Xin Zeng
2023-07-26 19:37   ` Alex Williamson
2023-08-23 15:29     ` Zeng, Xin
2023-08-24 15:25       ` Alex Williamson
2023-08-04  8:09   ` Tian, Kevin
2023-08-24  7:29     ` Zeng, Xin
2023-08-16 16:20   ` Brett Creeley
2023-08-24  7:31     ` Zeng, Xin [this message]

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=DM4PR11MB55021A7ECD9DAB45C246A9DC881DA@DM4PR11MB5502.namprd11.prod.outlook.com \
    --to=xin.zeng@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bcreeley@amd.com \
    --cc=giovanni.cabiddu@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.