[PATCH 3/5] nvme/pci: End stopped queue requests directly

Sagi Grimberg sagi at grimberg.me
Tue Jan 23 05:14:52 PST 2018


> +static void nvme_end_stopped_queue_request(struct request *req, void *data,
> +				   bool reserved)

nvme_pci_end_stopped_queue_request

> +{
> +	struct nvme_iod *iod = blk_mq_rq_to_pdu(req);
> +	struct nvme_queue *nvmeq = iod->nvmeq;
> +
> +	if (nvmeq->cq_vector != -1)
> +		return;
> +	dev_dbg_ratelimited(((struct nvme_ctrl *) data)->device,
> +			    "Ending I/O %d QID:%d", req->tag, nvmeq->qid);
> +	blk_mq_end_request(req, BLK_STS_IOERR);
> +}
> +
>   static void nvme_reset_work(struct work_struct *work)
>   {
>   	struct nvme_dev *dev =
> @@ -2344,6 +2357,8 @@ static void nvme_reset_work(struct work_struct *work)
>   		nvme_remove_namespaces(&dev->ctrl);
>   		new_state = NVME_CTRL_ADMIN_ONLY;
>   	} else {
> +		nvme_set_iter(&dev->ctrl, dev->ctrl.tagset,
> +			      nvme_end_stopped_queue_request);

It would have been good if we could reuse that in other transports
where we maintain state flags (NVME_*_Q_LIVE).



More information about the Linux-nvme mailing list