[PATCH v2 1/1] nvme-pci: clamp max_hw_sectors based on DMA optimized limitation

Keith Busch kbusch at kernel.org
Wed May 10 11:22:07 PDT 2023


On Wed, May 03, 2023 at 06:17:59PM +0200, Christoph Hellwig wrote:
> dma_opt_mapping_size falls back to and is bound by dma_max_mapping_size.
> So I think we could just do this:

Thanks for discoverying this even futher simplifaction. This looks good
to me.

Adrian, are you okay with the suggestion?

> @@ -2956,7 +2956,7 @@ static struct nvme_dev *nvme_pci_alloc_dev(struct pci_dev *pdev,
>  	 * over a single page.
>  	 */
>  	dev->ctrl.max_hw_sectors = min_t(u32,
> -		NVME_MAX_KB_SZ << 1, dma_max_mapping_size(&pdev->dev) >> 9);
> +		NVME_MAX_KB_SZ << 1, dma_opt_mapping_size(&pdev->dev) >> 9);
>  	dev->ctrl.max_segments = NVME_MAX_SEGS;
>  
>  	/*



More information about the Linux-nvme mailing list