The branch main has been updated by imp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a7218e7a6b05557c9ce60f8db33c06c97da72641

commit a7218e7a6b05557c9ce60f8db33c06c97da72641
Author:     Warner Losh <i...@freebsd.org>
AuthorDate: 2022-04-15 20:40:57 +0000
Commit:     Warner Losh <i...@freebsd.org>
CommitDate: 2022-04-15 20:46:18 +0000

    nvme: Fix old intel alignment size
    
    The intel raid stripe alignment parameter is based on CAP.MPSMIN, so use
    that directly now that we have it available.
    
    Sponsored by:           Netflix
    Reviewed by:            chuck
    Differential Revision:  https://reviews.freebsd.org/D34866
---
 sys/dev/nvme/nvme_ns.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c
index ba6960e476f8..da700ae9f59f 100644
--- a/sys/dev/nvme/nvme_ns.c
+++ b/sys/dev/nvme/nvme_ns.c
@@ -567,14 +567,16 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t id,
        }
 
        /*
-        * 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.
+        * Older Intel devices (like the PC35xxx and P45xx series) 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.
         */
        if ((ctrlr->quirks & QUIRK_INTEL_ALIGNMENT) != 0) {
                if (ctrlr->cdata.vs[3] != 0)
                        ns->boundary =
-                           (1 << ctrlr->cdata.vs[3]) * ctrlr->min_page_size;
+                           1 << (ctrlr->cdata.vs[3] + NVME_MPS_SHIFT +
+                               NVME_CAP_HI_MPSMIN(ctrlr->cap_hi));
                else
                        ns->boundary = 0;
        } else {

Reply via email to