From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 In-Reply-To: References: <1360036520-31032-1-git-send-email-wangyijing@huawei.com> <51A42137.9090908@huawei.com> <51F73108.4070905@huawei.com> <51F8D5C9.4020309@huawei.com> From: Bjorn Helgaas Date: Wed, 31 Jul 2013 14:42:36 -0600 Message-ID: Subject: Re: [PATCH] PCI: update device mps when doing pci hotplug To: Yijing Wang Cc: Jon Mason , "linux-kernel@vger.kernel.org" , "linux-pci@vger.kernel.org" , Yijing Wang , Hanjun Guo , Jiang Liu , Joe Jin Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: On Wed, Jul 31, 2013 at 11:53 AM, Bjorn Helgaas wrote: > On Wed, Jul 31, 2013 at 3:15 AM, Yijing Wang wrote: >> Hi Bjorn, >> I didn't observe a performance difference between MPS=128 and MPS=512. I use ping $dest_ip -s 65500(large size packet) >> to test the different situations. > > Interesting. "ping" is probably not a good way to see performance > differences, but hopefully you could see a difference in *some* > scenario. Otherwise, there's not much point in increasing MPS :) > >>> I assume there are no AER or other errors logged by the root port? >> Yes, AER is not support in local machine. > > Per the 5520/5500 spec, it does support AER (sec 19.11.5). Maybe > there's some platform support required in addition. You might still > be able to see some info just with "lspci -vv" > >> Hmmm, PCIe Spec does not involve too much about MPS setting. So maybe different platform >> has different strategy. > > I think there's enough in the spec to tell us what we need to do (this > is sec 2.2.2): > > - A Transmitter must not send a TLP larger than its Max_Payload_Size > - A Receiver must treat TLPs larger than its Max_Payload_Size as malformed > > The only way I can see to guarantee that is to set the MPS on both > ends of the link the same. > >> Conservatively, as a improvement for mps setting after hotplug. I think update mps setting equal to its parent >> make sense. This is no harm to other devices, we only modify the hotplug device itself mps register. >> >> So if you agree, I will update my patch ,only try to modify hotplug device mps, make them equal to its parent. > > Yes, I think that would be safe. If the switch is set to a larger MPS > than the hot-added device supports, I don't think we can safely use > the device. I opened a bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=60671 for this problem. Please correct any mistakes in my summary and reference it in your changelog. Bjorn