Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp563205imu; Fri, 25 Jan 2019 07:07:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN7iHfTBl+eb37j+oUL2yMBDIkg6/bS+3zTtppvgw0nGzdaII68E4LVO94p0l+k2pazdlEKt X-Received: by 2002:a17:902:9a9:: with SMTP id 38mr11185185pln.204.1548428826019; Fri, 25 Jan 2019 07:07:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548428825; cv=none; d=google.com; s=arc-20160816; b=A4b3hdlkjrrvIJV2dxtDEJo/pF6NVbMHfF+VQpj+pqurQomYydIkv7Zm9kHAD3KMcG YQLAWFtFp/BafRgXRJ7E9qozFOC4g8F+UACyXTE6wNMPH6PxIZKUGLU6qcnFH2MGgVfW OEfrso/anE3JS6Rj+xA4f2vze9X1eAYt2I6maMi/2y6H8BkwhIe9ofVRq+VbPU9SC7/T +8UfgzBxqlqe24WHAL9qtAMOvnREEjXxadgEkCXNzD0aR4rRHObTMBzE0lsHxaF9pXDE JRHsRA3sFYCOyfIbV3TC7oSkaPtEhzXYugSzVEh0O3589PHflnRFjupi41muQecd+x7L bqxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ulDzWEx6wrXTTv0Om4+RBYZvynIUdYTqMdS+0868Thw=; b=dgUkNtQJYZdwQNOTcHU8wFeD6O0wRuuIIZGisO7Fx7ieY9lbn5OdhdgDuqnyRu0gQ/ Ijut5/YeXHykPOOG/t57KSafMXzvVpTA/S3olDic+Dq67OpGXA4dOSvb9hLUFTuIPaFO Pi2ecJvto7XA6lPI+FB4GNXQuYHRYPfMOTEmAlXPdSXV+lBq0x/xMJqdJj8t47bsS97I OezI1XtWq8VbUkYc9icThD4q+twRQtkaMsQT7puzLkArBEEIuA8Nl8fR61NlhCHLOdZC AR0HllaSUfzq8rtd0MsE3tlsm1tdgH3iw3z1hiWjrULppl0yH1mGAGKTpIQeCZVSULWZ Mm9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RMOovllV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4si25012711pgl.16.2019.01.25.07.06.49; Fri, 25 Jan 2019 07:07:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RMOovllV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727558AbfAYPFe (ORCPT + 99 others); Fri, 25 Jan 2019 10:05:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:40892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726262AbfAYPFe (ORCPT ); Fri, 25 Jan 2019 10:05:34 -0500 Received: from localhost (173-25-171-118.client.mchsi.com [173.25.171.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 30BB4218A2; Fri, 25 Jan 2019 15:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548428732; bh=UXh6bkdhHEnRPhBMd9nh8nmkn8Lj0Pr0l6ytxxt6H0E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RMOovllVZJpSesVvZa2OueA5ofC/qSN8L/3LibVsyQuchA1ZI057cDaV/xNwG3diY 2ZIZpc3yZwwiI2FlIM+KA80jzRohzy7cpepV7ECz6JXcNvYs6bxhkHue152ZqRxzZs noFQKIN0APft319eblSGoPaDze7lT+khNjUrrnbk= Date: Fri, 25 Jan 2019 09:05:31 -0600 From: Bjorn Helgaas To: Srinath Mannam Cc: Lorenzo Pieralisi , Ray Jui , Scott Branden , BCM Kernel Feedback , linux-pci@vger.kernel.org, iommu@lists.linux-foundation.org, Linux Kernel Mailing List , Arun Ananthapadmanaban Subject: Re: [PATCH 1/3] PCI: iproc: Add feature to set order mode Message-ID: <20190125150531.GI14636@google.com> References: <1547785403-32268-1-git-send-email-srinath.mannam@broadcom.com> <1547785403-32268-2-git-send-email-srinath.mannam@broadcom.com> <20190118150713.GB25249@google.com> <20190124193131.GG14636@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 25, 2019 at 03:13:38PM +0530, Srinath Mannam wrote: > On Fri, Jan 25, 2019 at 1:01 AM Bjorn Helgaas wrote: > > On Thu, Jan 24, 2019 at 02:10:18PM +0530, Srinath Mannam wrote: > > > On Fri, Jan 18, 2019 at 8:37 PM Bjorn Helgaas wrote: > > > > On Fri, Jan 18, 2019 at 09:53:21AM +0530, Srinath Mannam wrote: > > > > > Order mode in RX header of incoming pcie packets can be override to > > > > > strict or loose order based on requirement. > > > > > Sysfs entry is provided to set dynamic and default order modes of upstream > > > > > traffic. > > > > ... > > > > Are you talking about the Relaxed Ordering bit in the TLP Attributes > > > > field? If so, please use the exact language used in the spec and > > > > include a reference, e.g., to PCIe r4.0, sec 2.2.6.4, 2.4, etc. > > > > > > > Yes Relax ordering bit in TLP. I will use spec reference. Thanks. > > > > I'm hesitant about a new sysfs file for this. That automatically > > > > creates a user-space dependency on this iProc feature. Who would use > > > > this file? > > > > > > > This is the specific feature given in iProc, used to improve > > > performance for the endpoints which does not support > > > ordering configuration at its end. > > > This is the reason we used sysfs file, which allows user to change > > > ordering based on endpoint used and requirement. > > > we are using these sysfs files to configure ordering to improve > > > performance in NVMe endpoints with SPDK/DPDK drivers. > > > If we enable this default in kernel, then it is applicable to all > > > endpoints connected. But it may not required for all endpoints. > > > > Normally, relaxed ordering is used only when an endpoint sets the > > "Relaxed Ordering" attribute bit in a TLP. The endpoint is only > > allowed to do that if relaxed ordering is enabled in the Device > > Control register. > Yes, endpoint has to set RO attribute in up-streaming TLPs. > But in most of NVMe SSDs even Relax ordering bit in device controller > register is set, > still it send TLPs with RO attribute disable (strict order). > > > > If I understand correctly, this sysfs knob would let you configure the > > iProc RC so it handles *all* TLPs (or just those in certain address > > ranges) with relaxed ordering, regardless of whether the endpoint has > > relaxed ordering, or even whether it supports relaxed ordering at all. > Yes, iProc can enable/disable RO attribute in given address range regardless of > endpoint settings. > > > > My gut feeling is that this is a messy hack, and if you want the > > performance benefits of relaxed ordering, you should just choose an > > NVMe endpoint that supports it correctly. > > Most of the NVMe endpoints available in market are sending TLPs in > strict order even Relax ordering bit in device controller register > is set. This is the reason to add this dynamic ordering feature in > iProc IP. I'm not very sympathetic to this argument about NVMe endpoints not supporting Relaxed Ordering. Relaxed Ordering has been in the PCIe spec since the very beginning in 2002 (see PCIe r1.0, sec 2.4.3). Why should we jump through hoops to tack this on after the fact if the endpoint designer couldn't be bothered? This sysfs knob is problematic because it's not safe and it can't be supported across architectures. It's not safe because only the endpoint and its driver know the ordering requirements. We *hope* the user only enables relaxed ordering when it is safe. Even when it's not safe, it makes things faster and works most of the time, so it's pretty tempting. But eventually it will lead to data corruption. We try to avoid sysfs things that are architecture-specific. This particular file would only exist on iProc, and then any user-space software that uses it would only work on iProc. Bjorn