From: Yijing Wang <wangyijing@huawei.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jon Mason <jdmason@kudzu.us>, <linux-pci@vger.kernel.org>,
Hanjun Guo <guohanjun@huawei.com>, <jiang.liu@huawei.com>,
Yijing Wang <wangyijing@huawei.com>
Subject: [PATCH v6 1/2] PCI: remove the unnecessary check in pcie_find_smpss()
Date: Wed, 21 Aug 2013 10:25:36 +0800 [thread overview]
Message-ID: <1377051937-5712-2-git-send-email-wangyijing@huawei.com> (raw)
In-Reply-To: <1377051937-5712-1-git-send-email-wangyijing@huawei.com>
In "pci=pcie_bus_safe" mode, if find a hotplug slot, we will set
all devices which in the path mps value to the minimum mps
support(128B). Unless the slot is directly connected to root port,
and there are not other devices on the fabric. In the latter case,
we will set root port and device mps to the minmum mpss support
for performace. Currently we use list_is_singular() to identify
whether slot is the only one connected to root port, it's not
necessary, because root port always connected to only one slot.
Following is test info:
-+-[0000:40]-+-00.0-[0000:41]--
................
| +-05.0-[0000:45]--
| +-07.0-[0000:46]--+-00.0 Intel Corporation 82576 Gigabit Network Connection
| | \-00.1 Intel Corporation 82576 Gigabit Network Connection
root port (40:07.0 mps=256 mpss=256)
EndPoing deivce (46:00.0/1 mps=256 mpss=512)
linux-ha2:/sys/bus/pci/slots/7 # echo 0 > power
linux-ha2:/sys/bus/pci/slots/7 # echo 1 > power
linux-ha2:/sys/bus/pci/slots/7 # dmesg
...........................
pcieport 0000:40:07.0: PCI-E Max Payload Size set to 256/ 256 (was 256), Max Read Rq 128
pci 0000:46:00.0: PCI-E Max Payload Size set to 256/ 512 (was 128), Max Read Rq 512
pci 0000:46:00.1: PCI-E Max Payload Size set to 256/ 512 (was 128), Max Read Rq 512
pcieport 0000:40:07.0: PCI-E Max Payload Size set to 256/ 256 (was 256), Max Read Rq 128
pci 0000:46:00.0: PCI-E Max Payload Size set to 256/ 512 (was 256), Max Read Rq 512
pci 0000:46:00.1: PCI-E Max Payload Size set to 256/ 512 (was 256), Max Read Rq 512
...........................
result is good, root port and device mps were wrote to 256, original code wrote to 128
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Cc: Jon Mason <jdmason@kudzu.us>
---
drivers/pci/probe.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index cf57fe7..160ae38 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1501,14 +1501,11 @@ static int pcie_find_smpss(struct pci_dev *dev, void *data)
* To work around this, the MPS for the entire fabric must be
* set to the minimum size. Any devices hotplugged into this
* fabric will have the minimum MPS set. If the PCI hotplug
- * slot is directly connected to the root port and there are not
- * other devices on the fabric (which seems to be the most
- * common case), then this is not an issue and MPS discovery
- * will occur as normal.
+ * slot is directly connected to the root port, then this is
+ * not an issue and MPS discovery will occur as normal.
*/
- if (dev->is_hotplug_bridge && (!list_is_singular(&dev->bus->devices) ||
- (dev->bus->self &&
- pci_pcie_type(dev->bus->self) != PCI_EXP_TYPE_ROOT_PORT)))
+ if (dev->is_hotplug_bridge &&
+ pci_pcie_type(dev) == PCI_EXP_TYPE_DOWNSTREAM)
*smpss = 0;
if (*smpss > dev->pcie_mpss)
--
1.7.1
next prev parent reply other threads:[~2013-08-21 2:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-21 2:25 [PATCH v6 0/2] update device mps Yijing Wang
2013-08-21 2:25 ` Yijing Wang [this message]
2013-08-21 2:25 ` [PATCH v6 2/2] PCI: update device mps when doing pci hotplug Yijing Wang
2013-08-21 23:31 ` Bjorn Helgaas
2013-08-22 1:27 ` Yijing Wang
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=1377051937-5712-2-git-send-email-wangyijing@huawei.com \
--to=wangyijing@huawei.com \
--cc=bhelgaas@google.com \
--cc=guohanjun@huawei.com \
--cc=jdmason@kudzu.us \
--cc=jiang.liu@huawei.com \
--cc=linux-pci@vger.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).