Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Apr 2018 15:06:48 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
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
Message-ID:  <201804201506.w3KF6mHm076720@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804201506.w3KF6mHm076720>