[PATCH 4/9] nvme-pci: refactor nvme_pci_use_sgls

Christoph Hellwig hch at lst.de
Wed Jun 11 22:00:27 PDT 2025


On Wed, Jun 11, 2025 at 02:50:53PM -0600, Keith Busch wrote:
> > +	if (use_sgl == SGL_FORCED ||
> > +	    (use_sgl == SGL_SUPPORTED &&
> > +	     (!sgl_threshold || nvme_pci_avg_seg_size(req) < sgl_threshold)))
> 
> This looks backwards for deciding to use sgls in the non-forced case.
> Shouldn't it be:
> 
> 	     (sgl_threshold && nvme_pci_avg_seg_size(req) >= sgl_threshold)))
> 
> ?

Yes.




More information about the Linux-nvme mailing list