nvme-pci: fix psdt field for single segment sgls
authorKlaus Birkelund Jensen <klaus@birkelund.eu>
Tue, 30 Apr 2019 16:53:29 +0000 (18:53 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 1 May 2019 13:17:16 +0000 (09:17 -0400)
The shortcut for single segment SGL requests did not set the PSDT field
to mark the request as using SGLs.

Fixes: 297910571f08 ("nvme-pci: optimize mapping single segment requests using SGLs")
Signed-off-by: Klaus Birkelund Jensen <klaus.jensen@cnexlabs.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/pci.c

index c1eecde..efc1da5 100644 (file)
@@ -830,6 +830,7 @@ static blk_status_t nvme_setup_sgl_simple(struct nvme_dev *dev,
                return BLK_STS_RESOURCE;
        iod->dma_len = bv->bv_len;
 
+       cmnd->flags = NVME_CMD_SGL_METABUF;
        cmnd->dptr.sgl.addr = cpu_to_le64(iod->first_dma);
        cmnd->dptr.sgl.length = cpu_to_le32(iod->dma_len);
        cmnd->dptr.sgl.type = NVME_SGL_FMT_DATA_DESC << 4;