nvme-pci: use mapped entries for sgl decision
authorKeith Busch <kbusch@kernel.org>
Thu, 5 Jan 2023 20:28:31 +0000 (12:28 -0800)
committerChristoph Hellwig <hch@lst.de>
Wed, 1 Feb 2023 13:21:59 +0000 (14:21 +0100)
commitae5829350324a6bd93c1d9fc3ac67afc0c647e32
treeb19aa60f2552893da62c70cc5a91a4ad5929e9e4
parent01df742d8c5c070f92fa9c046907506a2a0f7a9f
nvme-pci: use mapped entries for sgl decision

The driver uses the dma entries for setting up its command's SGL/PRP
lists. The dma mapping might have fewer entries than the physical
segments, so check the dma mapped count to determine which nvme data
layout method is more optimal.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/pci.c