diff options
author | Alexander Duyck | 2018-04-24 23:47:22 +0200 |
---|---|---|
committer | Bjorn Helgaas | 2018-04-24 23:47:22 +0200 |
commit | 115ddc491922c3c133551e9cff2d3bfaed02a27e (patch) | |
tree | c6df62a6d10a707ca0eceaffd29f7ee638d78a48 /drivers/net/ethernet/amazon/ena/ena_netdev.c | |
parent | PCI/IOV: Add pci-pf-stub driver for PFs that only enable VFs (diff) | |
download | kernel-qcow2-linux-115ddc491922c3c133551e9cff2d3bfaed02a27e.tar.gz kernel-qcow2-linux-115ddc491922c3c133551e9cff2d3bfaed02a27e.tar.xz kernel-qcow2-linux-115ddc491922c3c133551e9cff2d3bfaed02a27e.zip |
net: ena: Use pci_sriov_configure_simple() to enable VFs
Instead of implementing our own version of a SR-IOV configuration stub in
the ena driver, use the existing pci_sriov_configure_simple() function.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/net/ethernet/amazon/ena/ena_netdev.c')
-rw-r--r-- | drivers/net/ethernet/amazon/ena/ena_netdev.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index a822e70c2af3..f2af87d70594 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -3386,32 +3386,6 @@ err_disable_device: } /*****************************************************************************/ -static int ena_sriov_configure(struct pci_dev *dev, int numvfs) -{ - int rc; - - if (numvfs > 0) { - rc = pci_enable_sriov(dev, numvfs); - if (rc != 0) { - dev_err(&dev->dev, - "pci_enable_sriov failed to enable: %d vfs with the error: %d\n", - numvfs, rc); - return rc; - } - - return numvfs; - } - - if (numvfs == 0) { - pci_disable_sriov(dev); - return 0; - } - - return -EINVAL; -} - -/*****************************************************************************/ -/*****************************************************************************/ /* ena_remove - Device Removal Routine * @pdev: PCI device information struct @@ -3526,7 +3500,7 @@ static struct pci_driver ena_pci_driver = { .suspend = ena_suspend, .resume = ena_resume, #endif - .sriov_configure = ena_sriov_configure, + .sriov_configure = pci_sriov_configure_simple, }; static int __init ena_init(void) |