Message ID | 20180420162841.46077.17967.stgit@ahduyck-green-test.jf.intel.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Bjorn Helgaas |
Headers | show |
On 4/20/2018 9:30 AM, Alexander Duyck wrote: > Instead of implementing our own version of a SR-IOV configuration stub in > the ena driver we can just reuse the existing > pci_sriov_configure_simple function. > > Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> > --- > > v5: Replaced call to pci_sriov_configure_unmanaged with > pci_sriov_configure_simple > v6: Dropped "#ifdef" checks for IOV wrapping sriov_configure definition > v7: No change > > drivers/net/ethernet/amazon/ena/ena_netdev.c | 28 +------------------------- > 1 file changed, 1 insertion(+), 27 deletions(-) > > diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c > index a822e70..f2af87d 100644 > --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c > +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c > @@ -3386,32 +3386,6 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) > } > > /*****************************************************************************/ > -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 int ena_resume(struct pci_dev *pdev) > .suspend = ena_suspend, > .resume = ena_resume, > #endif > - .sriov_configure = ena_sriov_configure, > + .sriov_configure = pci_sriov_configure_simple, > }; > > static int __init ena_init(void) > Reviewed-by: Greg Rose <gvrose8192@gmail.com>
On Fri, Apr 20, 2018 at 12:30:21PM -0400, Alexander Duyck wrote: > Instead of implementing our own version of a SR-IOV configuration stub in > the ena driver we can just reuse the existing > pci_sriov_configure_simple function. > > Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Looks good, Reviewed-by: Christoph Hellwig <hch@lst.de>
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index a822e70..f2af87d 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -3386,32 +3386,6 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } /*****************************************************************************/ -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 int ena_resume(struct pci_dev *pdev) .suspend = ena_suspend, .resume = ena_resume, #endif - .sriov_configure = ena_sriov_configure, + .sriov_configure = pci_sriov_configure_simple, }; static int __init ena_init(void)
Instead of implementing our own version of a SR-IOV configuration stub in the ena driver we can just reuse the existing pci_sriov_configure_simple function. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> --- v5: Replaced call to pci_sriov_configure_unmanaged with pci_sriov_configure_simple v6: Dropped "#ifdef" checks for IOV wrapping sriov_configure definition v7: No change drivers/net/ethernet/amazon/ena/ena_netdev.c | 28 +------------------------- 1 file changed, 1 insertion(+), 27 deletions(-)