git: e66c1b51850c - main - nvme: Define NVME_MPS_SHIFT
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 15 Apr 2022 20:46:42 UTC
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e66c1b51850cbe5e2b02a13131dfce83a0c9a121 commit e66c1b51850cbe5e2b02a13131dfce83a0c9a121 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2022-04-15 20:40:41 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2022-04-15 20:46:18 +0000 nvme: Define NVME_MPS_SHIFT The memory page size (MPS) is expressed in terms of a 2^(number + 12) and other items in the system inherit this. Create a define rather than sprinkling 12 everywehere. Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D34865 --- sys/dev/nvme/nvme.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 55e94c40dd2c..e120656d0050 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -65,6 +65,9 @@ /* Host memory buffer sizes are always in 4096 byte chunks */ #define NVME_HMB_UNITS 4096 +/* Many items are expressed in terms of power of two times MPS */ +#define NVME_MPS_SHIFT 12 + /* Register field definitions */ #define NVME_CAP_LO_REG_MQES_SHIFT (0) #define NVME_CAP_LO_REG_MQES_MASK (0xFFFF)