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

Huang Adrian adrianhuang0701 at gmail.com
Thu May 11 05:06:19 PDT 2023


On Thu, May 11, 2023 at 2:22 AM Keith Busch <kbusch at kernel.org> wrote:
>
> 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?

Yes. This looks good to me. I like this simplicity.

Thanks for Christoph's changes.

> > @@ -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