linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Myron Stowe <myron.stowe@redhat.com>
To: bhelgaas@google.com, linux-pci@vger.kernel.org
Cc: keith.busch@intel.com, jdmason@kudzu.us, okaya@kernel.org
Subject: [PATCH 1/2] PCI: Skip MPS logic for Virtual Functions (VFs)
Date: Mon, 13 Aug 2018 12:19:39 -0600	[thread overview]
Message-ID: <20180813181939.105655.50410.stgit@tak.stowe> (raw)
In-Reply-To: <20180813181931.105655.22182.stgit@tak.stowe>

Section 9.3.5.4 "Device Control Register" specifically shows both
Max_Payload_Size (MPS) and Max_Read_request_Size (MRRS) to be 'RsvdP' for
VFs in Table 9-16 [1].  Just prior to the table it states:
  "PF and VF functionality is defined in Section 7.5.3.4 except where
   noted in Table 9-16.  For VF fields marked 'RsvdP', the PF setting
   applies to the VF."

All of which implies that with respect to Max_Payload_Size Supported
(MPSS), MPS, and MRRS values, we should not be paying any attention to the
VF's fields, but rather only to the PF's.  Only looking at the PF's fields
also logically makes sense as it's the sole physical interface to the PCIe
bus.

[1] PCI Express Base Specification, Revision 4.0 Version 1.0 (2017).

Link: https://bugzilla.kernel.org/show_bug.cgi?id=200527
Cc: Keith Busch <keith.busch@intel.com>
Cc: Sinan Kaya <okaya@kernel.org>
Cc: Dongdong Liu <liudongdong3@huawei.com>
Cc: Jon Mason <jdmason@kudzu.us>
Fixes: 27d868b5e6cf ("PCI: Set MPS to match upstream bridge")
Cc: stable@vger.kernel.org # 4.3+
Signed-off-by: Myron Stowe <myron.stowe@redhat.com>
---
 drivers/pci/probe.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 611adcd..b285786 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1730,6 +1730,10 @@ static void pci_configure_mps(struct pci_dev *dev)
 	if (!pci_is_pcie(dev) || !bridge || !pci_is_pcie(bridge))
 		return;
 
+	/* MPS and MRRS fields are of type 'RsvdP' for VFs, short-circuit out */
+	if (dev->is_virtfn)
+		return;
+
 	mps = pcie_get_mps(dev);
 	p_mps = pcie_get_mps(bridge);
 

  reply	other threads:[~2018-08-13 21:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-13 18:19 [PATCH 0/2] Augment device matching its upstream Root Port's MPS logic Myron Stowe
2018-08-13 18:19 ` Myron Stowe [this message]
2018-08-13 18:19 ` [PATCH 2/2] PCI: Match Root Port's MPS to endpoint's MPSS as necessary Myron Stowe
2018-08-14 14:18 ` [PATCH 0/2] Augment device matching its upstream Root Port's MPS logic 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=20180813181939.105655.50410.stgit@tak.stowe \
    --to=myron.stowe@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=jdmason@kudzu.us \
    --cc=keith.busch@intel.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=okaya@kernel.org \
    /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).