git: 6e3deec8caab - main - nvme: Base maximum data transfer size directly on MPSMIN in cap_hi
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 15 Apr 2022 20:46:44 UTC
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6e3deec8caab01a4de2bb446f8c5e799ed864562 commit 6e3deec8caab01a4de2bb446f8c5e799ed864562 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2022-04-15 20:41:05 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2022-04-15 20:46:18 +0000 nvme: Base maximum data transfer size directly on MPSMIN in cap_hi Calculate the maxmimum transfer size based on the MPSMIN we have in our cached copy of cap_hi rather than using min_page_size in the controller. Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D34867 --- sys/dev/nvme/nvme_ctrlr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 6996b3151b0d..21e33f991749 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -474,7 +474,8 @@ nvme_ctrlr_identify(struct nvme_controller *ctrlr) */ if (ctrlr->cdata.mdts > 0) ctrlr->max_xfer_size = min(ctrlr->max_xfer_size, - ctrlr->min_page_size * (1 << (ctrlr->cdata.mdts))); + 1 << (ctrlr->cdata.mdts + NVME_MPS_SHIFT + + NVME_CAP_HI_MPSMIN(ctrlr->cap_hi))); return (0); }