[PATCH 2/3] nvme: simplify __nvme_submit_sync_cmd() calling conventions

Nicky Chorley ndchorley at gmail.com
Sat Jan 27 10:00:47 PST 2024


On Sat, 27 Jan 2024, hare at kernel.org wrote:

> 	ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, &cmd, &res,
> -			data, sizeof(*data), NVME_QID_ANY, 1,
> -			BLK_MQ_REQ_RESERVED | BLK_MQ_REQ_NOWAIT);
> +			data, sizeof(*data), NVME_QID_ANY,
> +			NVME_SUBMIT_AT_HEAD |
> +			NVME_SUBMIT_NOWAIT |
> +			NVME_SUBMIT_RESERVED);
> 	if (ret) {
> 		nvmf_log_connect_error(ctrl, ret, le32_to_cpu(res.u32),
> 				       &cmd, data);
> @@ -525,8 +527,10 @@ int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid)
> 		return -ENOMEM;
>
> 	ret = __nvme_submit_sync_cmd(ctrl->connect_q, &cmd, &res,
> -			data, sizeof(*data), qid, 1,
> -			BLK_MQ_REQ_RESERVED | BLK_MQ_REQ_NOWAIT);
> +			data, sizeof(*data), qid,
> +			NVME_SUBMIT_AT_HEAD |
> +			NVME_SUBMIT_RESERVED |
> +			NVME_SUBMIT_NOWAIT);

Is it worth writing the new flags in the first hunk above in the same 
order as in the second (so NVME_SUBMIT_AT_HEAD | NVME_SUBMIT_RESERVED | 
NVME_SUBMIT_NOWAIT)? That way they're consistent with the old ones so 
might make reading the diff a little easier.

Nicky



More information about the Linux-nvme mailing list