]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Increase nvme(4) maximum transfer size from 1MB to 2MB.
authormav <mav@FreeBSD.org>
Sun, 29 Nov 2020 00:20:31 +0000 (00:20 +0000)
committermav <mav@FreeBSD.org>
Sun, 29 Nov 2020 00:20:31 +0000 (00:20 +0000)
commitcc27bf440d7a370200ecfcedd47fba2516e243ac
tree8b9fb342667c8f939e03cbf55545bafa9e569eba
parent68711bc23b8cab6926ee022d1a8797d87f05b6e2
Increase nvme(4) maximum transfer size from 1MB to 2MB.

With 4KB page size the 2MB is the maximum we can address with one page PRP.
Going further would require chaining, that would add some more complexity.

On the other side, to reduce memory consumption, allocate the PRP memory
respecting maximum transfer size reported in the controller identify data.
Many of NVMe devices support much smaller values, starting from 128KB.
To do that we have to change the initialization sequence to pull the data
earlier, before setting up the I/O queue pairs.  The admin queue pair is
still allocated for full MIN(maxphys, 2MB) size, but it is not a big deal,
since there is only one such queue with only 16 trackers.

Reviewed by: imp
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
sys/dev/nvme/nvme.h
sys/dev/nvme/nvme_ctrlr.c
sys/dev/nvme/nvme_private.h
sys/dev/nvme/nvme_qpair.c