Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752280AbdHDVGW (ORCPT ); Fri, 4 Aug 2017 17:06:22 -0400 Received: from mail-by2nam03on0094.outbound.protection.outlook.com ([104.47.42.94]:56995 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751268AbdHDVGU (ORCPT ); Fri, 4 Aug 2017 17:06:20 -0400 From: Casey Leedom To: Ding Tianhong , "ashok.raj@intel.com" , "bhelgaas@google.com" , "helgaas@kernel.org" , Michael Werner , Ganesh GR , "asit.k.mallick@intel.com" , "patrick.j.cramer@intel.com" , "Suravee.Suthikulpanit@amd.com" , "Bob.Shaw@amd.com" , "l.stach@pengutronix.de" , "amira@mellanox.com" , "gabriele.paoloni@huawei.com" , "David.Laight@aculab.com" , "jeffrey.t.kirsher@intel.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , "mark.rutland@arm.com" , "robin.murphy@arm.com" , "davem@davemloft.net" , "alexander.duyck@gmail.com" , "linux-arm-kernel@lists.infradead.org" , "netdev@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linuxarm@huawei.com" Subject: Re: [PATCH v8 1/4] PCI: Add new PCIe Fabric End Node flag, PCI_DEV_FLAGS_NO_RELAXED_ORDERING Thread-Topic: [PATCH v8 1/4] PCI: Add new PCIe Fabric End Node flag, PCI_DEV_FLAGS_NO_RELAXED_ORDERING Thread-Index: AQHTDF7ty81PZI46tUSsLe0lLDIs3qJ0sEuA Date: Fri, 4 Aug 2017 21:06:15 +0000 Message-ID: References: <1501767889-7772-1-git-send-email-dingtianhong@huawei.com>,<1501767889-7772-2-git-send-email-dingtianhong@huawei.com> In-Reply-To: <1501767889-7772-2-git-send-email-dingtianhong@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=leedom@chelsio.com; x-originating-ip: [12.32.117.8] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR12MB1438;6:65xwj1lUANrAEEIePvuGWgbr1FUI0+o6Y49ZvUc3Is1BciUtvFIL6vcUNKKGhi+VbIYSeGEkloPEmr0GAaNd6OOoBt03pjUxM3vgsMsK2SkSwokNJWrHxKSQAcQMFOY8AwXhm6W15zk8QfcboljvZbpE+NaBdn8ow7wHrQBWomOP5fWhiZJJ26l534xDvRwSy0sEEdjVkyyJ6uYNLAHyoUU2Uvo1ZWzztGeE4IXL4vhSe7/BbvYm8iCHcHm25rEKxygAQZfcnHyXmfbcGCmDL96KbFW/S2E+FyOhMI0xV3JtPraMeCG2lQlsEmKb+8lJh4kfdZ4QYg/4gMFxWtfaTQ==;5:X5GC0IYx8ZYH5mcfQBJiWY9tka5uK18GjZJzCATvANWoniOtWrJctch0SRRkoNZ+S4TEzGidV3YlQy6qZyNsFUSvG4irAMkchufEAXEwCgKL46h4QvedvYQqYmTtPCcuZNgVpd2c39ptRiIJbQtFoQ==;24:C1spRooIgzVO59KK7h0AlGVeEsKEt27ng+eCjo9uJ8VYR1QkcYSThoUV1DHZQUSk3QJ67hLk3qGRjFHHHpKRV5AOHDzRK/OpYPh2hHzfXQY=;7:DRogT25rzsgyYyUeNK7yBUXrmHrg3s7wpGAB+6Xr0JfDLN5+/QZwttjXKGppcmGabS+daBdqlAG6ygrqYpVJl7B3smNfYky+AU4XitctUxl/A7rURG/rWYYuMATm1j7crXLPoqXvksPPfk1CbNBKqASam+ca2bS5K9DsLrlOUrldPZp47vIvweav29IhtnsIYL7U+rEBeKO1quXgvHqS65/nf9zZQnilldhptvYAe+Y= x-ms-office365-filtering-correlation-id: bfda94e5-6199-4b74-497d-08d4db7ca504 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(2017082002075)(300000503095)(300135400095)(2017052603031)(201703131423075)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:MWHPR12MB1438; x-ms-traffictypediagnostic: MWHPR12MB1438: x-exchange-antispam-report-test: UriScan:(108984395545644)(50582790962513)(228905959029699); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123562025)(2016111802025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123555025)(20161123560025)(6072148)(6043046)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR12MB1438;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR12MB1438; x-forefront-prvs: 0389EDA07F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39410400002)(39400400002)(39450400003)(39840400002)(199003)(377454003)(189002)(5660300001)(55016002)(575784001)(3280700002)(189998001)(86362001)(8676002)(99286003)(8666007)(6306002)(53936002)(102836003)(101416001)(3846002)(551934003)(6116002)(38730400002)(81166006)(81156014)(6246003)(6506006)(7736002)(2501003)(9686003)(39060400002)(2906002)(305945005)(2900100001)(8936002)(3660700001)(966005)(66066001)(33656002)(7696004)(478600001)(2950100002)(6436002)(14454004)(68736007)(106356001)(105586002)(77096006)(74316002)(50986999)(7416002)(54356999)(2201001)(25786009)(229853002)(97736004)(76176999)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR12MB1438;H:MWHPR12MB1600.namprd12.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-OriginatorOrg: chelsio.com X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Aug 2017 21:06:15.5313 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 065db76d-a7ae-4c60-b78a-501e8fc17095 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1438 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v74L6Qik004446 Content-Length: 3226 Lines: 75 | From: Ding Tianhong | Sent: Thursday, August 3, 2017 6:44 AM | | diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c | index 6967c6b..1e1cdbe 100644 | --- a/drivers/pci/quirks.c | +++ b/drivers/pci/quirks.c | @@ -4016,6 +4016,44 @@ static void quirk_tw686x_class(struct pci_dev *pdev) | quirk_tw686x_class); | | /* | + * Some devices have problems with Transaction Layer Packets with the Relaxed | + * Ordering Attribute set. Such devices should mark themselves and other | + * Device Drivers should check before sending TLPs with RO set. | + */ | +static void quirk_relaxedordering_disable(struct pci_dev *dev) | +{ | + dev->dev_flags |= PCI_DEV_FLAGS_NO_RELAXED_ORDERING; | +} | + | +/* | + * Intel E5-26xx Root Complex has a Flow Control Credit issue which can | + * cause performance problems with Upstream Transaction Layer Packets with | + * Relaxed Ordering set. | + */ | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f02, PCI_CLASS_NOT_DEFINED, 8, | + quirk_relaxedordering_disable); | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f04, PCI_CLASS_NOT_DEFINED, 8, | + quirk_relaxedordering_disable); | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f08, PCI_CLASS_NOT_DEFINED, 8, | + quirk_relaxedordering_disable); | + ... It looks like this is missing the set of Root Complex IDs that were noted in the document to which Patrick Cramer sent us a reference: https://software.intel.com/sites/default/files/managed/9e/bc/64-ia-32-architectures-optimization-manual.pdf In section 3.9.1 we have: 3.9.1 Optimizing PCIe Performance for Accesses Toward Coherent Memory and Toward MMIO Regions (P2P) In order to maximize performance for PCIe devices in the processors listed in Table 3-6 below, the soft- ware should determine whether the accesses are toward coherent memory (system memory) or toward MMIO regions (P2P access to other devices). If the access is toward MMIO region, then software can command HW to set the RO bit in the TLP header, as this would allow hardware to achieve maximum throughput for these types of accesses. For accesses toward coherent memory, software can command HW to clear the RO bit in the TLP header (no RO), as this would allow hardware to achieve maximum throughput for these types of accesses. Table 3-6. Intel Processor CPU RP Device IDs for Processors Optimizing PCIe Performance Processor CPU RP Device IDs Intel Xeon processors based on 6F01H-6F0EH Broadwell microarchitecture Intel Xeon processors based on 2F01H-2F0EH Haswell microarchitecture The PCI Device IDs you have there are the first ones that I guessed at having the performance problem with Relaxed Ordering. We now apparently have a complete list from Intel. I don't want to phrase this as a "NAK" because you've gone around the mulberry bush a bunch of times already. So maybe just go with what you've got in version 8 of your patch and then do a follow on patch to complete the table? Casey