[PATCH 7/9] nvme-pci: convert the data mapping blk_rq_dma_map

Daniel Gomez da.gomez at kernel.org
Mon Jun 16 00:49:47 PDT 2025


On 10/06/2025 07.06, Christoph Hellwig wrote:
> @@ -46,13 +45,11 @@
>  #define NVME_MAX_NR_DESCRIPTORS	5
>  
>  /*
> - * For data SGLs we support a single descriptors worth of SGL entries, but for
> - * now we also limit it to avoid an allocation larger than PAGE_SIZE for the
> - * scatterlist.
> + * For data SGLs we support a single descriptors worth of SGL entries.
> + * For PRPs, segments don't matter at all.
>   */
>  #define NVME_MAX_SEGS \
> -	min(NVME_CTRL_PAGE_SIZE / sizeof(struct nvme_sgl_desc), \
> -	    (PAGE_SIZE / sizeof(struct scatterlist)))
> +	(NVME_CTRL_PAGE_SIZE / sizeof(struct nvme_sgl_desc))

IIRC, I've seen in the commit history going from PAGE_SIZE to CC.MPS for
different cases in the driver. PRPs requires contiguous regions to be CC.MPS,
i.e use NVME_CTRL_PAGE_SIZE for PRP lists and entries. But I think that is not a
limit for SGLs. Can we use PAGE_SIZE here?



More information about the Linux-nvme mailing list