Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751561AbdG0Roz (ORCPT ); Thu, 27 Jul 2017 13:44:55 -0400 Received: from mail-by2nam01on0128.outbound.protection.outlook.com ([104.47.34.128]:23590 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751030AbdG0Rox (ORCPT ); Thu, 27 Jul 2017 13:44:53 -0400 From: Casey Leedom To: Ding Tianhong , Alexander Duyck CC: Netdev , Bjorn Helgaas , "linux-arm-kernel@lists.infradead.org" , "David.Laight@aculab.com" , "ashok.raj@intel.com" , "Alex Williamson" , "l.stach@pengutronix.de" , "Suravee.Suthikulpanit@amd.com" , "catalin.marinas@arm.com" , "linux-pci@vger.kernel.org" , "will.deacon@arm.com" , Sinan Kaya , "robin.murphy@arm.com" , "linux-kernel@vger.kernel.org" , "davem@davemloft.net" , Ganesh GR , "asit.k.mallick@intel.com" , "jeffrey.t.kirsher@intel.com" , "mark.rutland@arm.com" , "gabriele.paoloni@huawei.com" , Michael Werner , "bhelgaas@google.com" , "patrick.j.cramer@intel.com" , "linuxarm@huawei.com" , "amira@mellanox.com" , "Bob.Shaw@amd.com" , "patrick.j.cramer@intel.com" Subject: Re: [PATCH v7 2/3] PCI: Enable PCIe Relaxed Ordering if supported Thread-Topic: [PATCH v7 2/3] PCI: Enable PCIe Relaxed Ordering if supported Thread-Index: AQHS++OWrGKhofvtIUCheprjRIXqU6JSQPmAgABHnoCAANEhgIAL8fcAgAPZDQCAA1q+dYAAB1V9gAAA30KAAGhOAIABEe/8 Date: Thu, 27 Jul 2017 17:44:48 +0000 Message-ID: References: <1499955692-26556-1-git-send-email-dingtianhong@huawei.com> <1499955692-26556-3-git-send-email-dingtianhong@huawei.com> <0260e398-bd8e-6615-6d5c-1f7c07b6fc09@huawei.com> <67be791f-e0cf-8284-9229-17174dc741ef@codeaurora.org> <5f9b8bfb-41a8-a17c-6fea-581aec1d5573@huawei.com> <20170724090516.2e0f0d2a@w520.home> ,<2feff1a5-25b7-eb6c-7628-7c2257c56e95@huawei.com> In-Reply-To: <2feff1a5-25b7-eb6c-7628-7c2257c56e95@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;7:UYmL+E4l/QdCxr2oJsObzZafzCGKI8eewOMrrjWwiZAU6jyYFS9SJZDOPpgv2lnLEdTgK5E0umiyjPFAPIDUGsuU29M34tU9Dth4CV/fhFssyEzdWZlaXSRmS096i3QLG5zZYUWXYQRs7BP1wSnorNf6e9z5Z2wA9Bw8EENvF1iY4fIasZ0b/VDw9fToRP980BEigjMTefEL8kMFblHBayrLZpXv4HA2LkIu2VRtEgqFc+P8tWfHTj0GqcUXISYugC/txWL9Znt0jzI7jUOsivOukhqx1gDiP1W6f78qxrUufzP19qpWvo62JlJpY9+SV2T63NoD869hcpJpKKYB7hm/Uzv6Bg5owdwbVpRO4VbBw2QFM7Xz4jyVfzeHnikt00SaPh1yu3KX7D9oGKoJGePRHkDs4T/+bDL3Ryg7pMyziJjr0xlHPG+hz76I9SSTpKSTsKWxRPDkSi2TxIXTqbWFVvXfM88I25mRgjmnW7qvm+LJEgr0zANYCIno+Zj9hmT37mH33BVex88o1ic7fiHOpkghwCMfFIX1MKr6diUZqksCElfhk0CgTFC1vw1Uegb+rf6sqJs88hPiX6/2+5J+k3Q91/UmI1BUYujWcxpCi7swIv6KQ+hzg/BXeTVrDhouWM6pVV9i0nP9DTFzXVq/ECUkEvjKS9Hh8OX5wehhOw4b+e/O0IDdC+pceVtZY3FKqXFE04N9DieKCzc0qtzbBv1AaO4mHjjZI9guKDlZhlPb4dmopdH+VfyuHyGCi8ND2dkOaLJZPWpfMsQooI7BYbwqS8pL6k102LWTsd0= x-ms-office365-filtering-correlation-id: f05759b1-11aa-46ef-f54b-08d4d5172d6b x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(2017052603031)(201703131423075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:MWHPR12MB1438; x-ms-traffictypediagnostic: MWHPR12MB1438: x-exchange-antispam-report-test: UriScan:(108984395545644)(50582790962513)(228905959029699)(68840517438536); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(920511095)(6041248)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(2016111802025)(20161123555025)(20161123560025)(20161123564025)(6043046)(6072148)(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: 03818C953D x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39450400003)(39400400002)(39840400002)(39410400002)(199003)(24454002)(54534003)(377454003)(189002)(54906002)(966005)(305945005)(6506006)(106356001)(8936002)(86362001)(7696004)(575784001)(81166006)(7736002)(68736007)(81156014)(8666007)(2900100001)(8676002)(74316002)(7416002)(66066001)(77096006)(93886004)(105586002)(229853002)(102836003)(97736004)(25786009)(6246003)(5660300001)(4326008)(189998001)(53936002)(54356999)(3846002)(2906002)(33656002)(3660700001)(6116002)(2950100002)(39060400002)(76176999)(3280700002)(50986999)(478600001)(38730400002)(99286003)(6306002)(53546010)(9686003)(101416001)(14454004)(6436002)(55016002)(17260700006);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: 27 Jul 2017 17:44:48.2377 (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 v6RHj2dl002249 Content-Length: 4316 Lines: 91 | From: Ding Tianhong | Sent: Wednesday, July 26, 2017 6:01 PM | | On 2017/7/27 3:05, Casey Leedom wrote: | > | > Ding, send me a note if you'd like me to work that [cxgb4vf patch] up | > for you. | | Ok, you could send the change log and I could put it in the v8 version | together, will you base on the patch 3/3 or build a independence patch? Which ever you'd prefer. It would basically mirror the same exact code that you've got for cxgb4. I.e. testing the setting of the VF's PCIe Capability Device Control[Relaxed Ordering Enable], setting a new flag in adpater->flags, testing that flag in cxgb4vf/sge.c:t4vf_sge_alloc_rxq(). But since the VF's PF will already have disabled the PF's Relaxed Ordering Enable, the VF will also have it's Relaxed Ordering Enable disabled and any effort by the internal chip to send TLPs with the Relaxed Ordering Attribute will be gated by the PCIe logic. So it's not critical that this be in the first patch. Your call. Let me know if you'd like me to send that to you. | From: Ding Tianhong | Sent: Wednesday, July 26, 2017 6:08 PM | | On 2017/7/27 2:26, Casey Leedom wrote: | > | > 1. Did we ever get any acknowledgement from either Intel or AMD | > on this patch? I know that we can't ensure that, but it sure would | > be nice since the PCI Quirks that we're putting in affect their | > products. | | Still no Intel and AMD guys has ack this, this is what I am worried about, | should I ping some man again ? By amusing coincidence, Patrik Cramer (now Cc'ed) from Intel sent me a note yesterday with a link to the official Intel performance tuning documentation which covers this issue: 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 Unfortunately that's a pretty thin section. But it does expand the set of Intel Root Complexes for which our Linux PCI Quirk will need to cover. So you should add those to the next (and hopefully final) spin of your patch. And, it also verifies the need to handle the use of Relaxed Ordering more subtlely than simply turning it off since the NVMe peer-to-peer example I keep bringing up would fall into the "need to use Relaxed Ordering" case ... It would have been nice to know why this is happening and if any future processor would fix this. After all, Relaxed Ordering, is just supposed to be a hint. At worst, a receiving device could just ignore the attribute entirely. Obviously someone made an effort to implement it but ... it didn't go the way they wanted. And, it also would have been nice to know if there was any hidden register in these Intel Root Complexes which can completely turn off the effort to pay attention to the Relaxed Ordering Attribute. We've spend an enormous amount of effort on this issue here on the Linux PCI email list struggling mightily to come up with a way to determine when it's safe/recommended/not-recommended/unsafe to use Relaxed Ordering when directing TLPs towards the Root Complex. And some architectures require RO for decent performance so we can't just "turn it off" unilatterally. Casey