nvme: implement non-mdts command limits
authorKeith Busch <kbusch@kernel.org>
Wed, 24 Mar 2021 23:18:05 +0000 (16:18 -0700)
committerChristoph Hellwig <hch@lst.de>
Tue, 6 Apr 2021 06:34:39 +0000 (08:34 +0200)
commit5befc7c26e5a98cd49789fb1beb52c62bd472dba
tree10baf33084d873b4a731e59af03f00ea64b3421d
parentc881a23fb6f7eb901155d25ba8dd1af0b8c7923b
nvme: implement non-mdts command limits

Commands that access LBA contents without a data transfer between the
host historically have not had a spec defined upper limit. The driver
set the queue constraints for such commands to the max data transfer
size just to be safe, but this artificial constraint frequently limits
devices below their capabilities.

The NVMe Workgroup ratified TP4040 defines how a controller may
advertise their non-MDTS limits. Use these if provided and default to
the current constraints if not. Since the Dataset Management command
limits are defined in logical blocks, but without a namespace to tell us
the logical block size, the code defaults to the safe 512b size.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h
include/linux/nvme.h