From owner-svn-src-stable@freebsd.org Fri Apr 20 15:06:48 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FAA8FAAE45; Fri, 20 Apr 2018 15:06:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 425806B4F7; Fri, 20 Apr 2018 15:06:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D09319E79; Fri, 20 Apr 2018 15:06:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3KF6m6a076721; Fri, 20 Apr 2018 15:06:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3KF6mHm076720; Fri, 20 Apr 2018 15:06:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804201506.w3KF6mHm076720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 20 Apr 2018 15:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332824 - stable/11/sys/dev/nvme X-SVN-Group: stable-11 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/11/sys/dev/nvme X-SVN-Commit-Revision: 332824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 15:06:48 -0000 Author: imp Date: Fri Apr 20 15:06:47 2018 New Revision: 332824 URL: https://svnweb.freebsd.org/changeset/base/332824 Log: MFC r332780,r332783: Intel drives have an optimal alignment for I/O. While they honor I/Os that cross this boundary, they perform better when this isn't the case. Intel uses the 3rd byte in the vendor specific area for this. The DC P3500 was previously listed without any explanation. Add the DC P3520 and DC P4500 to the list. There won't be any others drives needing this quirk. Intel has standardized a field in the namespace data in 1.3 (noiob). A future patch will use that if it exists, with fallback to this method. Submitted by: Keith Busch Reviewed by: jimharris@ [[ plus tweak comments from 332783 ]] Sponsored by: Netflix Modified: stable/11/sys/dev/nvme/nvme_ns.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/nvme/nvme_ns.c ============================================================================== --- stable/11/sys/dev/nvme/nvme_ns.c Fri Apr 20 15:05:48 2018 (r332823) +++ stable/11/sys/dev/nvme/nvme_ns.c Fri Apr 20 15:06:47 2018 (r332824) @@ -486,9 +486,22 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t ns->id = id; ns->stripesize = 0; - if (pci_get_devid(ctrlr->dev) == 0x09538086 && ctrlr->cdata.vs[3] != 0) - ns->stripesize = - (1 << ctrlr->cdata.vs[3]) * ctrlr->min_page_size; + /* + * Older Intel devices advertise in vendor specific space an alignment + * that improves performance. If present use for the stripe size. NVMe + * 1.3 standardized this as NOIOB, and newer Intel drives use that. + */ + switch (pci_get_devid(ctrlr->dev)) { + case 0x09538086: /* Intel DC PC3500 */ + case 0x0a538086: /* Intel DC PC3520 */ + case 0x0a548086: /* Intel DC PC4500 */ + if (ctrlr->cdata.vs[3] != 0) + ns->stripesize = + (1 << ctrlr->cdata.vs[3]) * ctrlr->min_page_size; + break; + default: + break; + } /* * Namespaces are reconstructed after a controller reset, so check