linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: bhelgaas@google.com, linux-pci@vger.kernel.org
Cc: sathya.perla@emulex.com, linux-kernel@vger.kernel.org,
	ajit.khaparde@emulex.com, ddutile@redhat.com,
	subbu.seetharaman@emulex.com, myron.stowe@redhat.com
Subject: [PATCH] pci/iov: VFs are never multifunction
Date: Thu, 09 Jan 2014 08:36:08 -0700	[thread overview]
Message-ID: <20140109153513.21446.31778.stgit@bling.home> (raw)

Per the SR-IOV spec rev 1.1:

3.4.1.9 Header Type (Offset 0Eh)

"... For VFs, this register must be RO Zero."

Unfortunately some devices get this wrong, ex. Emulex OneConnect 10Gb
NIC.  When they do it makes us handle ACS testing and therefore IOMMU
groups as if they were actual multifunction devices and require ACS
capabilities to make sure there's no peer-to-peer between functions.
VFs are never traditional multifunction devices, so simply clear this
bit before we get any further into setup.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 drivers/pci/iov.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 1fe2d6f..e2fbb67 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -84,6 +84,7 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset)
 	virtfn->dev.parent = dev->dev.parent;
 	virtfn->physfn = pci_dev_get(dev);
 	virtfn->is_virtfn = 1;
+	virtfn->multifunction = 0;
 
 	for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
 		res = dev->resource + PCI_IOV_RESOURCES + i;


             reply	other threads:[~2014-01-09 15:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-09 15:36 Alex Williamson [this message]
2014-01-09 18:08 ` [PATCH] pci/iov: VFs are never multifunction Bjorn Helgaas
2014-01-09 18:25   ` Alex Williamson
2014-01-09 21:39     ` Bjorn Helgaas
2014-01-09 21:58       ` Alex Williamson
2014-01-09 23:20         ` Bjorn Helgaas
2014-01-09 23:39           ` Alex Williamson
2014-01-13 18:56 ` Bjorn Helgaas

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=20140109153513.21446.31778.stgit@bling.home \
    --to=alex.williamson@redhat.com \
    --cc=ajit.khaparde@emulex.com \
    --cc=bhelgaas@google.com \
    --cc=ddutile@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=myron.stowe@redhat.com \
    --cc=sathya.perla@emulex.com \
    --cc=subbu.seetharaman@emulex.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).