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
This commit is contained in:
Warner Losh 2022-04-15 14:41:05 -06:00
parent a7218e7a6b
commit 6e3deec8ca

View file

@ -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);
}