[PATCH 1/7] nvme-pci: don't try to use SGLs for metadata on the admin queue
Christoph Hellwig
hch at lst.de
Tue May 13 00:47:11 PDT 2025
On Tue, May 13, 2025 at 10:45:15AM +0300, Leon Romanovsky wrote:
> On Tue, May 13, 2025 at 09:39:08AM +0200, Christoph Hellwig wrote:
> > On Tue, May 13, 2025 at 10:28:42AM +0300, Leon Romanovsky wrote:
> > > > - if (nvme_pci_metadata_use_sgls(dev, req))
> > > > + struct nvme_iod *iod = blk_mq_rq_to_pdu(req);
> > > > +
> > > > + if ((iod->cmd.common.flags & NVME_CMD_SGL_METABUF) &&
> > >
> > > Won't it be more future error proof to check for NVME_CMD_SGL_ALL?
> >
> > No really, as this is used to decide to call into the routine that
> > sets NVME_CMD_SGL_METASEG.
>
> I see same NVME_CMD_SGL_ALL check in target code.
Yeah. But the above check guards the call to nvme_pci_setup_meta_sgls,
which takes a command and updates the sgls field in flags from
NVME_CMD_SGL_METABUF to NVME_CMD_SGL_METASEG, and no other place sets
NVME_CMD_SGL_METASEG. So NVME_CMD_SGL_METASEG can't be set at this
point by definition.
More information about the Linux-nvme
mailing list