]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r368132: Increase nvme(4) maximum transfer size from 1MB to 2MB.
authorAlexander Motin <mav@FreeBSD.org>
Sun, 13 Dec 2020 02:19:18 +0000 (02:19 +0000)
committerAlexander Motin <mav@FreeBSD.org>
Sun, 13 Dec 2020 02:19:18 +0000 (02:19 +0000)
commitb52bc40cc2c24c5a72438af95ef6c89168ed3504
tree31d89f3e669d792e38dca8de94f108d9a427ee46
parentb95930d369e6f0dd7d9e1d983e5d94290f14f109
MFC r368132: 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.
sys/dev/nvme/nvme.h
sys/dev/nvme/nvme_ctrlr.c
sys/dev/nvme/nvme_private.h
sys/dev/nvme/nvme_qpair.c