All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v8 0/6] Update device MPS
@ 2013-08-22  3:24 Yijing Wang
  2013-08-22  3:24 ` [PATCH v8 1/6] PCI: Drop "PCI-E" prefix from Max Payload Size message Yijing Wang
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Yijing Wang @ 2013-08-22  3:24 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Jon Mason, linux-pci, Hanjun Guo, jiang.liu, Yijing Wang

v7->v8: Yijing update the patch 6/6, and tested this series in hotplug machine.
v6->v7: Bjorn's rework and additions of other minor cleanups
v5->v6: rework the patch 1/2, remove the unnecessary check, pointed out by Bjorn.
        remove the patch 1/2 cc stable tag, because it's not a serious bug.
v4->v5: Fix some spelling problems and move mpss = 128 << dev->pcie_mpss above to reuse
        it, also remove the else braces for code style. thanks for Jon's review and comments.
v3->v4: Call pcie_bus_update_set() only when pcie_bus_config == PCIE_BUS_TUNE_OFF
        suggested by Jon Mason, try to change parent mps when parent device is
        root port and only one slot connected to it when parent mps > child device
        mpss. Other add a patch to fix a issue in pcie_find_smpss() during use
        "pci=pcie_bus_safe".
v2->v3: Update CC stable tag suggested by Li Zefan.
v1->v2: Update patch log, remove Joe's reported-by, because his problem
        was mainly caused by BIOS incorrect setting. But this patch mainly
        to fix the bug caused by device hot add. Conservatively, this
        version only update the mps problem when hot add. When the device
        mps < parent mps found, this patch try to update device mps.
        It seems unlikely device mps > parent mps after hot add device.
        So we don't care that situation.

1. test with append "pci=pcie_bus_safe" during system bootup
-+-[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), NIC devices(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: Max Payload Size set to  256/ 256 (was  256), Max Read Rq  128 
pci 0000:46:00.0: Max Payload Size set to  256/ 512 (was  128), Max Read Rq  512 
pci 0000:46:00.1: Max Payload Size set to  256/ 512 (was  128), Max Read Rq  512 
pcieport 0000:40:07.0: Max Payload Size set to  256/ 256 (was  256), Max Read Rq  128 
pci 0000:46:00.0: Max Payload Size set to  256/ 512 (was  256), Max Read Rq  512 
pci 0000:46:00.1: Max Payload Size set to  256/ 512 (was  256), Max Read Rq  512 
...................................


2. test without append "pci=pcie_bus_xxx", default PCIE_BUS_TUNE_OFF
root port(40:07.0 mps=256, mpss=256), NIC devices(46:00.0/1, mps=256, mpss=512)
linux-ha2:/sys/bus/pci/slots/7 # echo 0 > power
root port, mps =256, NIC devices, mps = 128
linux-ha2:/sys/bus/pci/slots/7 # echo 1 > power 
root port, mps =256, NIC devices, mps = 256

all test results ok.

Bjorn Helgaas (3):
  PCI: Drop "PCI-E" prefix from Max Payload Size message
  PCI: Simplify pcie_bus_configure_settings() interface
  PCI: Simplify MPS test for Downstream Port

Yijing Wang (3):
  PCI: Remove unnecessary check for pcie_get_mps() failure
  PCI: Don't restrict MPS for slots below Root Ports
  PCI: update device mps when doing pci hotplug

 arch/powerpc/kernel/pci-common.c |    8 +---
 arch/tile/kernel/pci_gx.c        |    9 +---
 arch/x86/pci/acpi.c              |    9 +---
 drivers/pci/hotplug/pcihp_slot.c |    5 +-
 drivers/pci/pci.c                |    3 -
 drivers/pci/probe.c              |   90 +++++++++++++++++++++++++++++---------
 include/linux/pci.h              |    2 +-
 7 files changed, 78 insertions(+), 48 deletions(-)



^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: [PATCH v8 6/6] PCI: update device mps when doing pci hotplug
@ 2013-08-29 21:09 Bjorn Helgaas
  2013-08-29 21:47 ` Yinghai Lu
  0 siblings, 1 reply; 17+ messages in thread
From: Bjorn Helgaas @ 2013-08-29 21:09 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Yijing Wang, Jon Mason, linux-pci, Hanjun Guo, Jiang Liu,
	Jin Feng, linux-kernel

[+cc linux-kernel, since more folks might be interested]

On Mon, Aug 26, 2013 at 6:39 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> On Mon, Aug 26, 2013 at 2:33 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>> The current Linux default is PCIE_BUS_TUNE_OFF, and given that I don't
>> want to touch any MPS settings in that mode, I don't see a way to
>> safely fix https://bugzilla.kernel.org/show_bug.cgi?id=60671 (the
>> problem with hot-added devices not working because MPS is incorrect).
>> In the long term, I hope we can fix it by making the default
>> PCIE_BUS_SAFE, but that doesn't help right now.
>>
>> That leaves us with only the workaround of booting the Huawei rh5885
>> box with "pci=pcie_bus_safe".
>>
>> I'm willing to accept that because I think we can argue that this is
>> really a BIOS defect.  The BIOS *can* program MPS to values that will
>> be safe for hotplug even if the OS does nothing, i.e., it can set
>> MPS=128 in all paths that lead to a hotpluggable slot.  I think that's
>> probably what this BIOS *should* do, since it has no way of knowing
>> whether the OS will support hotplug or whether the OS will reprogram
>> any MPS values.
>
> BIOS should have several settings for MPS:
> 1. 128
> 2. auto or performance.
>
> When it set to Auto, Linux will have problem with hot-add.
>
> Default one was 128 before, that is ok,
> as from sndbrige and ivbridge, chipset could support more than 128.
>
> BIOS want to set it auto.
> BIOS guys is claiming that other OSes are ok with Auto, but only Linux
> has problem.

I don't understand the argument the BIOS guys are making.

1.  If the BIOS sets MPS=128 for all devices all the time, everything
should always work.  Performance won't be optimal, but it should
always work.

This requires no OS support at all, so the current Linux default of
doing nothing is fine.

2.  If the BIOS sets MPS to something larger than 128 for hardwired
devices only (where no hotplug is possible), the BIOS either knows
that the root complex will split peer-to-peer packets as required (sec
1.3.1), or it assumes there will be no peer-to-peer traffic between
hierarchies.

This should also work fine with no OS support, unless we do
peer-to-peer traffic and the root complex doesn't split packets.

3.  If the BIOS sets MPS to something larger than 128 in a path that
leads to a hotplug slot, the BIOS assumes the OS actively manages MPS
for hotplug.

This requires OS support because if we hot-add a device that only
supports MPS=128, the OS must reprogram the upstream path before using
the device.

I don't know what the BIOS "auto" setting means, but it must mean
something in case 3, because that's the only case where OS support is
required.  But if the OS is smart enough to manage MPS for hot-added
devices, why can't the OS also program MPS for the whole system at
boot-time?

That's why I don't understand what BIOS wants to do.  It sounds like
they want the performance benefit of larger MPS for devices present in
hot-plug slots at boot-time, even if the OS doesn't actively manage
MPS and things blow up if that device is replaced with one that
supports a smaller MPS.  That choice doesn't make sense.

In case 3, with a non-MPS-aware OS, you get better performance for a
while, but blow up if a card is replaced.  And with an MPS-aware OS,
there should be no advantage to case 3: the OS should be able to get
good performance by programming MPS itself, even without help from the
BIOS.

Bjorn

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2013-08-30 15:41 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-22  3:24 [PATCH v8 0/6] Update device MPS Yijing Wang
2013-08-22  3:24 ` [PATCH v8 1/6] PCI: Drop "PCI-E" prefix from Max Payload Size message Yijing Wang
2013-08-22  3:24 ` [PATCH v8 2/6] PCI: Simplify pcie_bus_configure_settings() interface Yijing Wang
2013-08-22  3:24 ` [PATCH v8 3/6] PCI: Remove unnecessary check for pcie_get_mps() failure Yijing Wang
2013-08-22  3:24 ` [PATCH v8 4/6] PCI: Simplify MPS test for Downstream Port Yijing Wang
2013-08-22  3:24 ` [PATCH v8 5/6] PCI: Don't restrict MPS for slots below Root Ports Yijing Wang
2013-08-22  3:24 ` [PATCH v8 6/6] PCI: update device mps when doing pci hotplug Yijing Wang
2013-08-22 18:18   ` Bjorn Helgaas
2013-08-26  3:42     ` Yijing Wang
2013-08-26 21:33       ` Bjorn Helgaas
2013-08-27  0:39         ` Yinghai Lu
2013-08-27  1:49         ` Yijing Wang
2013-08-29 21:09 Bjorn Helgaas
2013-08-29 21:47 ` Yinghai Lu
2013-08-29 22:22   ` Bjorn Helgaas
2013-08-29 22:46     ` Yinghai Lu
2013-08-30 15:41       ` Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.