Allow the maximum data transfer size to be specified for an in-kernel
NVMeoF controller via the "mdts" property of the ctl(4) port. To ease
administration, this value is provided in bytes. The nvmft module
calculates the appropriate value to advertise in the CDATA.MDTS field
based on the configured CAP.MPSMIN value for the controller.
Enforce this maximum data transfer on GET_LOG_PAGE commands by
validating the numd parameter against the maxium transfer size.
Also enforce this limit on NVM I/O commands such as READ and WRITE
that transfer data. Commands such as VERIFY or WRITE_ZEROES do not
enforce such a limit. Note that IDENTIFY commands use a fixed size
of 4096 bytes and thus are not subject to this limit.
The limit defaults to 4MiB but can be configured via the "mdts"
transport-group option in ctl.conf. The limit can be set to 0 to
revert back to the previous behavior of no limit for debugging, but
this is not suitable for production use as it can permit a remote host
to request an arbitrarily-sized memory allocation in the kernel.
Tests are included for overly-long GET_LOG_PAGE and READ commands.
Reported by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Sponsored by: Chelsio Communications