nvme-pci: don't simple map sgl when sgls are disabled
authorNiklas Cassel <niklas.cassel@wdc.com>
Fri, 9 Apr 2021 18:12:55 +0000 (20:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:50:27 +0000 (09:50 +0200)
commita11497b3bb7546db5a982ccf8bc36a1f30aa4a6f
tree4b2a062b0afa763d3089b39040fdafb3b9470094
parentb2c55f81c1d16978de9ef43dac9f20dc91eb9302
nvme-pci: don't simple map sgl when sgls are disabled

[ Upstream commit e51183be1fa96dc6d3cd11b3c25a0f595807315e ]

According to the module parameter description for sgl_threshold,
a value of 0 means that SGLs are disabled.

If SGLs are disabled, we should respect that, even for the case
where the request is made up of a single physical segment.

Fixes: 297910571f08 ("nvme-pci: optimize mapping single segment requests using SGLs")
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/pci.c