[PATCH 1/7] nvme-pci: don't try to use SGLs for metadata on the admin queue

Leon Romanovsky leon at kernel.org
Tue May 13 00:45:15 PDT 2025


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.

  1642 u16 nvmet_parse_admin_cmd(struct nvmet_req *req)
  1643 {

<...>

  1656         /* For PCI controllers, admin commands shall not use SGL. */
  1657         if (nvmet_is_pci_ctrl(req->sq->ctrl) && !req->sq->qid &&
  1658             cmd->common.flags & NVME_CMD_SGL_ALL)
  1659                 return NVME_SC_INVALID_FIELD | NVME_STATUS_DNR;

Thanks



More information about the Linux-nvme mailing list