nvme/pci: Provide SR-IOV support
PATCH v3 1/1 nvme/pci: Provide SR-IOV support
This registers an sr-iov callback for nvme.
Signed-off-by Keith Busch <keith.busch at intel.com>
---
v2 -> v3:
Removed the pci dependency part, instead checking pci_vfs_assigned in nvme.
drivers/nvme/host/pci.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/nvme/host/pci.c +19 -0
@@ -2008,6 +2008,24 @@ static void nvme_remove(struct pci_dev *pdev)nvme_put_ctrl (&dev->ctrl); } +static int nvme_pci_sriov_configure (struct pci_dev *pdev,int numvfs) +{ +int ret =0 ; + +if (numvfs ==0 ) { +if (pci_vfs_assigned (pdev)) { +dev_warn (&pdev->dev, +"Cannot disable SR-IOV VFs while assigned\n" ); +return -EPERM ; + } +pci_disable_sriov (pdev); +return 0 ; + } + + ret =pci_enable_sriov (pdev, numvfs); +return ret ? ret : numvfs; +} +#ifdef CONFIG_PM_SLEEP static int nvme_suspend (struct device *dev) {
@@ -2108,6 +2126,7 @@ static struct pci_driver nvme_driver = { .driver = { .pm = &nvme_dev_pm_ops, }, + .sriov_configure = nvme_pci_sriov_configure, .err_handler = &nvme_err_handler, };
Signature · 1 line
2.7.2
PATCH v3 1/1 nvme/pci: Provide SR-IOV support
Looks fine (well, at least as fine as the current SR-IOV infrastructure allows..):
Reviewed-by Christoph Hellwig <hch at lst.de>
PATCH v3 1/1 nvme/pci: Provide SR-IOV support
Quoted 4 lines · Christoph Hellwig
Looks fine (well, at least as fine as the current SR-IOV infrastructure allows..):
Reviewed-by Christoph Hellwig <hch at lst.de>
Hi Jens,
Could we get this SRIOV patch applied for 4.8?
Jens Axboe
maintainerPATCH v3 1/1 nvme/pci: Provide SR-IOV support
Quoted 8 lines · Keith Busch
Quoted 4 lines · Christoph Hellwig
Looks fine (well, at least as fine as the current SR-IOV infrastructure allows..):
Reviewed-by Christoph Hellwig <hch at lst.de>Hi Jens,
Could we get this SRIOV patch applied for 4.8?
Added, thanks.
Signature · 1 line
Jens Axboe