diff mbox

Architectural question regarding IOV support in Linux 3.13.4

Message ID 20141202212616.GA20069@google.com
State Not Applicable
Headers show

Commit Message

Bjorn Helgaas Dec. 2, 2014, 9:26 p.m. UTC
On Tue, Dec 02, 2014 at 09:11:26PM +0000, Zytaruk, Kelly wrote:
> > -----Original Message-----
> > From: linux-pci-owner@vger.kernel.org [mailto:linux-pci-
> > owner@vger.kernel.org] On Behalf Of Bjorn Helgaas
> > Sent: Tuesday, December 02, 2014 4:02 PM
> > To: Zytaruk, Kelly
> > Cc: Yu Zhao; linux-pci@vger.kernel.org; Alex Williamson
> > Subject: Re: Architectural question regarding IOV support in Linux 3.13.4
> > 
> > On Tue, Dec 2, 2014 at 9:42 AM, Zytaruk, Kelly <Kelly.Zytaruk@amd.com>
> > wrote:
> > >
> > >
> > >> -----Original Message-----
> > >> From: Bjorn Helgaas [mailto:bhelgaas@google.com]
...

> > >> Can you try out Yu's patch and see what happens?  If you do turn on
> > >> SR-IOV on this device, it would be interesting to see the complete dmesg log
> > and "lspci -vv"
> > >> output to see what we do with it.
> > >
> > > Bjorn,
> > > I am resurrecting this thread as I have been looking through the 3.18 source
> > code and don't see any support for PCI_EXP_TYPE_LEG_END for SRIOV.  For
> > devices that must remain defined as Legacy endpoints we still need to be able to
> > enable SRIOV.
> > 
> > Looking back, I see that Yu Zhao did attach a patch earlier in the thread.  Are you
> > asking me to apply that one?  I don't remember why I dropped it from my queue;
> > maybe it was because I was waiting for you to test it.
> > 
> > Did you test it?  What were the results (complete dmesg log and lspci -vv
> > output)?  There was also some follow-on discussion that I would need to
> > evaluate before applying it.
> > 
> > Bjorn
> 
> I lost the original patch but it was simple enough that I coded it myself (one line change) locally.  I have been testing with it for several months now and have no issues with it.  In fact my testing requires it to be present in order to succeed, it will fail if it is not present.

Huh, I don't see it in the archives, either.  Ah, I see, it was a
multi-part message, which is rejected by the mailing lists.  But since I'm
a nice guy, I'll include it again below.

See https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches
for the usual procedure.

Please test the patch below (or post your patch if you prefer), collect
the info I requested above (dmesg and lspci info), and attach it to a
bugzilla so we can archive the details that motivate this change.

Bjorn



From e81dfb3e73982ae9d74e3a8c6110a5104e36c3c0 Mon Sep 17 00:00:00 2001
From: Yu Zhao <yuzhao@google.com>
Date: Fri, 21 Feb 2014 14:46:50 -0800
Subject: [PATCH] pci: fix legacy endpoint being excluded from using SR-IOV

Neither PCIe 3.0 nor SR-IOV 1.1 spec excludes device of legacy
endpoint type from having SR-IOV capability. The legacy endpoint
together with root complex integrated and regular endpoints should
be supported by sriov_init().

Signed-off-by: Yu Zhao <yu.zhao@google.com>
---
 drivers/pci/iov.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 9dce7c5..5f98707 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -418,6 +418,7 @@  static int sriov_init(struct pci_dev *dev, int pos)
 	struct pci_dev *pdev;
 
 	if (pci_pcie_type(dev) != PCI_EXP_TYPE_RC_END &&
+	    pci_pcie_type(dev) != PCI_EXP_TYPE_LEG_END &&
 	    pci_pcie_type(dev) != PCI_EXP_TYPE_ENDPOINT)
 		return -ENODEV;