Page MenuHomeFreeBSD

D34707.diff
No OneTemporary

D34707.diff

diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c
--- a/sys/dev/nvme/nvme_ctrlr.c
+++ b/sys/dev/nvme/nvme_ctrlr.c
@@ -389,7 +389,7 @@
cc |= 4 << NVME_CC_REG_IOCQES_SHIFT; /* CQ entry size == 16 == 2^4 */
/* This evaluates to 0, which is according to spec. */
- cc |= (PAGE_SIZE >> 13) << NVME_CC_REG_MPS_SHIFT;
+ cc |= (PAGE_SHIFT - NVME_BASE_SHIFT) << NVME_CC_REG_MPS_SHIFT;
nvme_ctrlr_barrier(ctrlr, BUS_SPACE_BARRIER_WRITE);
nvme_mmio_write_4(ctrlr, cc, cc);
diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h
--- a/sys/dev/nvme/nvme_private.h
+++ b/sys/dev/nvme/nvme_private.h
@@ -96,6 +96,11 @@
/* Maximum log page size to fetch for AERs. */
#define NVME_MAX_AER_LOG_SIZE (4096)
+/*
+ * Page size parameters
+ */
+#define NVME_BASE_SHIFT 12 /* Several parameters (MSP) are 2^(12+x) */
+
/*
* Define CACHE_LINE_SIZE here for older FreeBSD versions that do not define
* it.

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 6:56 PM (21 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14721959
Default Alt Text
D34707.diff (939 B)

Event Timeline