[PATCH 2/2] nvme: use driver pdu command for passthrough

Keith Busch kbusch at kernel.org
Tue Mar 16 18:08:37 GMT 2021


On Tue, Mar 16, 2021 at 10:44:11AM -0700, Sagi Grimberg wrote:
> 
> > -blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req,
> > -		struct nvme_command *cmd)
> > +blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req)
> >   {
> > +	struct nvme_command *cmd = nvme_req(req)->cmd;
> >   	blk_status_t ret = BLK_STS_OK;
> >   	if (!(req->rq_flags & RQF_DONTPREP))
> >   		nvme_clear_nvme_request(req);
> > -	memset(cmd, 0, sizeof(*cmd));
> 
> I'm assuming nothing broke with this clearing removed...

It's not really removed, it's just relocated to
nvme_clear_nvme_request(). The passthrough case calls it before
.queue_rq(), so this must makes sure we don't clear it twice.
 
> Did you happen to run blktests?
> - ./check nvme
> - nvme_trtype=rdma ./check nvme
> - nvme_trtype=tcp ./check nvme

I'll give this a try.



More information about the Linux-nvme mailing list