nvme: rework __nvme_submit_sync_cmd()
Subsystems (3)
Hannes Reinecke
maintainercover nvme: rework __nvme_submit_sync_cmd()
Hi all,
as Jens and hch complained about the argument list to __nvme_submit_sync_cmd() getting too long, here's now a patchset to clean things up.
The first patch is to split off __nvme_alloc_rq() from __nvme_submit_sync_cmd(), which serves to reduce the number of arguments; it's also a nice cleanup as this function can be utilized to replace some open-coded versions.
The second patch is to introduce a 'retry' argument to __nvme_alloc_rq(), to indicate whether retries for this command should be allowd.
And the third is another cleanup; the 'at_head' argument to __nvme_submit_sync_cmd() really should be a boolean, as it can take only two values, and it's being converted into a boolean within __nvme_submit_sync_cmd() anyway.
As usual, comments and reviews are welcome.
Hannes Reinecke (3):
nvme: split __nvme_submit_sync_cmd()
nvme: retry internal commands if DNR status bit is not set
nvme: make 'at_head' parameter for __nvme_submit_sync_cmd() boolean
drivers/nvme/host/auth.c | 10 ++++-- drivers/nvme/host/core.c | 65 ++++++++++++++++++++++------------ drivers/nvme/host/fabrics.c | 46 +++++++++++++++++------- drivers/nvme/host/ioctl.c | 2 +- drivers/nvme/host/nvme.h | 11 +++--- drivers/nvme/host/pci.c | 9 +++-- drivers/nvme/target/passthru.c | 3 +- 7 files changed, 96 insertions(+), 50 deletions(-)
Signature · 1 line
2.35.3
Hannes Reinecke
maintainerPATCH 1/3 nvme: split __nvme_submit_sync_cmd()
Split a __nvme_alloc_rq() function from __nvme_submit_sync_cmd() to reduce the number of arguments.
--- drivers/nvme/host/auth.c | 9 ++++-- drivers/nvme/host/core.c | 59 ++++++++++++++++++++++------------ drivers/nvme/host/fabrics.c | 42 ++++++++++++++++++------ drivers/nvme/host/nvme.h | 8 ++--- drivers/nvme/host/pci.c | 8 ++--- drivers/nvme/target/passthru.c | 3 +- 6 files changed, 85 insertions(+), 44 deletions(-)
drivers/nvme/host/auth.c +6 -3
@@ -62,6 +62,7 @@ static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid,struct nvme_command cmd = {};blk_mq_req_flags_t flags =nvme_auth_flags_from_qid (qid);struct request_queue *q =nvme_auth_queue_from_qid (ctrl, qid); +struct request *req;int ret; cmd.auth_common.opcode = nvme_fabrics_command;
@@ -76,9 +77,11 @@ static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid, cmd.auth_receive.al =cpu_to_le32 (data_len); } - ret =__nvme_submit_sync_cmd (q, &cmd,NULL , data, data_len, - qid ==0 ?NVME_QID_ANY : qid, -0 , flags); + req =__nvme_alloc_rq (q, &cmd, qid ==0 ?NVME_QID_ANY : qid, flags); +if (IS_ERR (req)) +return PTR_ERR (req); + + ret =__nvme_submit_sync_cmd (q, req,NULL , data, data_len,0 );if (ret >0 )dev_warn (ctrl->device,"qid %d auth_send failed with status %d\n" , qid, ret);
drivers/nvme/host/core.c +39 -20
116 lines not on this page · raw message
drivers/nvme/host/fabrics.c +32 -10
104 lines not on this page · raw message
drivers/nvme/host/nvme.h +4 -4
@@ -813,10 +813,10 @@ static inline bool nvme_is_unique_nsid(struct nvme_ctrl *ctrl,int nvme_submit_sync_cmd (struct request_queue *q,struct nvme_command *cmd,void *buf,unsigned bufflen); -int __nvme_submit_sync_cmd (struct request_queue *q,struct nvme_command *cmd, -union nvme_result *result,void *buffer,unsigned bufflen, -int qid,int at_head, -blk_mq_req_flags_t flags); +struct request *__nvme_alloc_rq (struct request_queue *q, +struct nvme_command *cmd,int qid,blk_mq_req_flags_t flags); +int __nvme_submit_sync_cmd (struct request_queue *q,struct request *req,union nvme_result *result, +void *buffer,unsigned bufflen,int at_head);int nvme_set_features (struct nvme_ctrl *dev,unsigned int fid,unsigned int dword11,void *buffer,size_t buflen,u32 *result);
drivers/nvme/host/pci.c +3 -5
@@ -1376,13 +1376,12 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req)nvme_get_opcode_str (nvme_req (req)->cmd->common.opcode), nvmeq->qid); - abort_req =blk_mq_alloc_request (dev->ctrl.admin_q,nvme_req_op (&cmd), -BLK_MQ_REQ_NOWAIT ); + abort_req =__nvme_alloc_rq (dev->ctrl.admin_q, &cmd, +NVME_QID_ANY ,BLK_MQ_REQ_NOWAIT );if (IS_ERR (abort_req)) {atomic_inc (&dev->ctrl.abort_limit);return BLK_EH_RESET_TIMER ; } -nvme_init_request (abort_req, &cmd); abort_req->end_io = abort_endio; abort_req->end_io_data =NULL ;
@@ -2391,10 +2390,9 @@ static int nvme_delete_queue(struct nvme_queue *nvmeq, u8 opcode) cmd.delete_queue.opcode = opcode; cmd.delete_queue.qid =cpu_to_le16 (nvmeq->qid); - req =blk_mq_alloc_request (q,nvme_req_op (&cmd),BLK_MQ_REQ_NOWAIT ); + req =__nvme_alloc_rq (q, &cmd,NVME_QID_ANY ,BLK_MQ_REQ_NOWAIT );if (IS_ERR (req))return PTR_ERR (req); -nvme_init_request (req, &cmd);if (opcode == nvme_admin_delete_cq) req->end_io = nvme_del_cq_end;
drivers/nvme/target/passthru.c +1 -2
@@ -316,12 +316,11 @@ static void nvmet_passthru_execute_cmd(struct nvmet_req *req) timeout =nvmet_req_subsys (req)->admin_timeout; } - rq =blk_mq_alloc_request (q,nvme_req_op (req->cmd),0 ); + rq =__nvme_alloc_rq (q, req->cmd,NVME_QID_ANY ,0 );if (IS_ERR (rq)) { status =NVME_SC_INTERNAL ; goto out_put_ns; } -nvme_init_request (rq, req->cmd);if (timeout) rq->timeout = timeout;
Signature · 1 line
2.35.3
Re: [PATCH 1/3] nvme: split __nvme_submit_sync_cmd()
Quoted 27 lines · Hannes Reinecke
Split a
__nvme_alloc_rq()function from__nvme_submit_sync_cmd()to reduce the number of arguments.Signed-off-by Hannes Reinecke <[email protected]>---
drivers/nvme/host/auth.c | 9 ++++-- drivers/nvme/host/core.c | 59 ++++++++++++++++++++++------------ drivers/nvme/host/fabrics.c | 42 ++++++++++++++++++------ drivers/nvme/host/nvme.h | 8 ++--- drivers/nvme/host/pci.c | 8 ++--- drivers/nvme/target/passthru.c | 3 +- 6 files changed, 85 insertions(+), 44 deletions(-)drivers/nvme/host/auth.c +1
-0@@ -62,6 +62,7 @@ static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid,struct nvme_command cmd = {};blk_mq_req_flags_t flags =nvme_auth_flags_from_qid (qid);struct request_queue *q =nvme_auth_queue_from_qid (ctrl, qid); +struct request *req;int ret; cmd.auth_common.opcode = nvme_fabrics_command;@@ -76,9 +77,11 @@ static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid, cmd.auth_receive.al =cpu_to_le32 (data_len);
drivers/nvme/host/auth.c static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid, · line 84
Quoted 10 lines
drivers/nvme/host/auth.c +5
-3} - ret =__nvme_submit_sync_cmd (q, &cmd,NULL , data, data_len, - qid ==0 ?NVME_QID_ANY : qid, -0 , flags); + req =__nvme_alloc_rq (q, &cmd, qid ==0 ?NVME_QID_ANY : qid, flags); +if (IS_ERR (req)) +return PTR_ERR (req); + + ret =__nvme_submit_sync_cmd (q, req,NULL , data, data_len,0 );
First argument 'q' of above can also be killed.
Hannes Reinecke
maintainerRe: [PATCH 1/3] nvme: split __nvme_submit_sync_cmd()
Quoted 32 lines · Kanchan Joshi
Quoted 31 lines · Hannes Reinecke
Split a
__nvme_alloc_rq()function from__nvme_submit_sync_cmd()to reduce the number of arguments.Signed-off-by Hannes Reinecke <[email protected]>---
drivers/nvme/host/auth.c | 9 ++++-- drivers/nvme/host/core.c | 59 ++++++++++++++++++++++------------ drivers/nvme/host/fabrics.c | 42 ++++++++++++++++++------ drivers/nvme/host/nvme.h | 8 ++--- drivers/nvme/host/pci.c | 8 ++---drivers/nvme/target/passthru.c| 3 +-6 files changed, 85 insertions(+), 44 deletions(-)drivers/nvme/host/auth.c +1
-0@@ -62,6 +62,7 @@ static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid, struct nvme_command cmd = {}; blk_mq_req_flags_t flags = nvme_auth_flags_from_qid(qid); struct request_queue *q = nvme_auth_queue_from_qid(ctrl, qid); + struct request *req; int ret;cmd.auth_common.opcode =
nvme_fabrics_command;drivers/nvme/host/auth.c +0
-0@@ -76,9 +77,11 @@ static int nvme_auth_submit(struct nvme_ctrl *ctrl,int qid, cmd.auth_receive.al = cpu_to_le32(data_len); }
Quoted 12 lines
drivers/nvme/host/auth.c static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid, · line 84
Quoted 9 lines
drivers/nvme/host/auth.c +5
-3- ret = __nvme_submit_sync_cmd(q, &cmd, NULL, data, data_len, - qid == 0 ? NVME_QID_ANY : qid, - 0, flags); + req = __nvme_alloc_rq(q, &cmd, qid == 0 ? NVME_QID_ANY : qid, flags); + if (IS_ERR(req)) + return PTR_ERR(req); + + ret = __nvme_submit_sync_cmd(q, req, NULL, data, data_len, 0);First argument 'q' of above can also be killed.
Indeed.
Cheers,
Hannes
Hannes Reinecke
maintainerPATCH 2/3 nvme: retry internal commands if DNR status bit is not set
In reply to Hannes ReineckeAdd a 'retry' argument to __nvme_alloc_rq() to instruct the function to not set the FAILFAST_DRIVER bit for the command, causing it to be retried in nvme_decide_disposition() if the DNR bit is not set in the command result.
And modify the authentication code to allow for retries.
--- drivers/nvme/host/auth.c | 3 ++- drivers/nvme/host/core.c | 18 ++++++++++-------- drivers/nvme/host/fabrics.c | 10 +++++----- drivers/nvme/host/ioctl.c | 2 +- drivers/nvme/host/nvme.h | 5 +++-- drivers/nvme/host/pci.c | 5 +++-- drivers/nvme/target/passthru.c | 2 +- 7 files changed, 25 insertions(+), 20 deletions(-)
drivers/nvme/host/auth.c +2 -1
@@ -77,7 +77,8 @@ static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid, cmd.auth_receive.al =cpu_to_le32 (data_len); } - req =__nvme_alloc_rq (q, &cmd, qid ==0 ?NVME_QID_ANY : qid, flags); + req =__nvme_alloc_rq (q, &cmd, qid ==0 ?NVME_QID_ANY : qid, + flags, true);if (IS_ERR (req))return PTR_ERR (req);
drivers/nvme/host/core.c +10 -8
@@ -663,7 +663,8 @@ static inline void nvme_clear_nvme_request(struct request *req) }/* initialize a passthrough request */ -void nvme_init_request (struct request *req,struct nvme_command *cmd) +void nvme_init_request (struct request *req,struct nvme_command *cmd, +bool retry) {if (req->q->queuedata) req->timeout =NVME_IO_TIMEOUT ;
@@ -673,7 +674,8 @@ void nvme_init_request(struct request *req, struct nvme_command *cmd)/* passthru commands should let the driver set the SGL flags */ cmd->common.flags &= ~NVME_CMD_SGL_ALL ; - req->cmd_flags |=REQ_FAILFAST_DRIVER ; +if (!retry) + req->cmd_flags |=REQ_FAILFAST_DRIVER ;if (req->mq_hctx->type ==HCTX_TYPE_POLL ) req->cmd_flags |=REQ_POLLED ;nvme_clear_nvme_request (req);
@@ -1019,7 +1021,7 @@ EXPORT_SYMBOL_NS_GPL(nvme_execute_rq, NVME_TARGET_PASSTHRU);struct request *__nvme_alloc_rq (struct request_queue *q,struct nvme_command *cmd,int qid, -blk_mq_req_flags_t flags) +blk_mq_req_flags_t flags,bool retry) {struct request *req;
@@ -1029,7 +1031,7 @@ struct request *__nvme_alloc_rq(struct request_queue *q, req =blk_mq_alloc_request_hctx (q,nvme_req_op (cmd), flags, qid -1 );if (!IS_ERR (req)) -nvme_init_request (req, cmd); +nvme_init_request (req, cmd, retry);return req; }
@@ -1064,7 +1066,7 @@ int nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd, {struct request *req; - req =__nvme_alloc_rq (q, cmd,NVME_QID_ANY ,0 ); + req =__nvme_alloc_rq (q, cmd,NVME_QID_ANY ,0 , false);if (IS_ERR (req))return PTR_ERR (req);
@@ -1211,7 +1213,7 @@ static void nvme_keep_alive_work(struct work_struct *work) } rq =__nvme_alloc_rq (ctrl->admin_q, &ctrl->ka_cmd,NVME_QID_ANY , -BLK_MQ_REQ_RESERVED |BLK_MQ_REQ_NOWAIT ); +BLK_MQ_REQ_RESERVED |BLK_MQ_REQ_NOWAIT , false);if (IS_ERR (rq)) {/* allocation failure, reset the controller */ dev_err (ctrl->device,"keep-alive failed: %ld\n" ,PTR_ERR (rq));
@@ -1494,7 +1496,7 @@ static int nvme_features(struct nvme_ctrl *dev, u8 op, unsigned int fid, c.features.fid =cpu_to_le32 (fid); c.features.dword11 =cpu_to_le32 (dword11); - req =__nvme_alloc_rq (dev->admin_q, &c,NVME_QID_ANY ,0 ); + req =__nvme_alloc_rq (dev->admin_q, &c,NVME_QID_ANY ,0 , false);if (IS_ERR (req))return PTR_ERR (req);
@@ -2231,7 +2233,7 @@ static int nvme_sec_submit(void *data, u16 spsp, u8 secp, void *buffer, size_t l cmd.common.cdw10 =cpu_to_le32 (((u32 )secp) <<24 | ((u32 )spsp) <<8 ); cmd.common.cdw11 =cpu_to_le32 (len); - req =__nvme_alloc_rq (ctrl->admin_q, &cmd,NVME_QID_ANY ,0 ); + req =__nvme_alloc_rq (ctrl->admin_q, &cmd,NVME_QID_ANY ,0 , false);if (IS_ERR (req))return PTR_ERR (req);
drivers/nvme/host/fabrics.c +5 -5
@@ -153,7 +153,7 @@ int nvmf_reg_read32(struct nvme_ctrl *ctrl, u32 off, u32 *val) cmd.prop_get.fctype = nvme_fabrics_type_property_get; cmd.prop_get.offset =cpu_to_le32 (off); - req =__nvme_alloc_rq (ctrl->fabrics_q, &cmd,NVME_QID_ANY ,0 ); + req =__nvme_alloc_rq (ctrl->fabrics_q, &cmd,NVME_QID_ANY ,0 , false);if (IS_ERR (req))return PTR_ERR (req);
@@ -203,7 +203,7 @@ int nvmf_reg_read64(struct nvme_ctrl *ctrl, u32 off, u64 *val) cmd.prop_get.attrib =1 ; cmd.prop_get.offset =cpu_to_le32 (off); - req =__nvme_alloc_rq (ctrl->fabrics_q, &cmd,NVME_QID_ANY ,0 ); + req =__nvme_alloc_rq (ctrl->fabrics_q, &cmd,NVME_QID_ANY ,0 , false);if (IS_ERR (req))return PTR_ERR (req);
@@ -252,7 +252,7 @@ int nvmf_reg_write32(struct nvme_ctrl *ctrl, u32 off, u32 val) cmd.prop_set.offset =cpu_to_le32 (off); cmd.prop_set.value =cpu_to_le64 (val); - req =__nvme_alloc_rq (ctrl->fabrics_q, &cmd,NVME_QID_ANY ,0 ); + req =__nvme_alloc_rq (ctrl->fabrics_q, &cmd,NVME_QID_ANY ,0 , false);if (IS_ERR (req))return PTR_ERR (req);
@@ -413,7 +413,7 @@ int nvmf_connect_admin_queue(struct nvme_ctrl *ctrl)strncpy (data->hostnqn, ctrl->opts->host->nqn,NVMF_NQN_SIZE ); req =__nvme_alloc_rq (ctrl->fabrics_q, &cmd,NVME_QID_ANY , -BLK_MQ_REQ_RESERVED |BLK_MQ_REQ_NOWAIT ); +BLK_MQ_REQ_RESERVED |BLK_MQ_REQ_NOWAIT , false);if (IS_ERR (req))return PTR_ERR (req);
@@ -504,7 +504,7 @@ int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid)strncpy (data->hostnqn, ctrl->opts->host->nqn,NVMF_NQN_SIZE ); req =__nvme_alloc_rq (ctrl->fabrics_q, &cmd,NVME_QID_ANY , -BLK_MQ_REQ_RESERVED |BLK_MQ_REQ_NOWAIT ); +BLK_MQ_REQ_RESERVED |BLK_MQ_REQ_NOWAIT , false);if (IS_ERR (req))return PTR_ERR (req);
drivers/nvme/host/ioctl.c +1 -1
@@ -154,7 +154,7 @@ static struct request *nvme_alloc_user_request(struct request_queue *q, req =blk_mq_alloc_request (q,nvme_req_op (cmd) | rq_flags, blk_flags);if (IS_ERR (req))return req; -nvme_init_request (req, cmd); +nvme_init_request (req, cmd, false);nvme_req (req)->flags |=NVME_REQ_USERCMD ;return req; }
drivers/nvme/host/nvme.h +3 -2
@@ -774,7 +774,8 @@ static inline enum req_op nvme_req_op(struct nvme_command *cmd) }#define NVME_QID_ANY -1 -void nvme_init_request (struct request *req,struct nvme_command *cmd); +void nvme_init_request (struct request *req,struct nvme_command *cmd, +bool retry);void nvme_cleanup_cmd (struct request *req);blk_status_t nvme_setup_cmd (struct nvme_ns *ns,struct request *req); blk_status_t nvme_fail_nonready_command(struct nvme_ctrl *ctrl,
@@ -814,7 +815,7 @@ static inline bool nvme_is_unique_nsid(struct nvme_ctrl *ctrl,int nvme_submit_sync_cmd (struct request_queue *q,struct nvme_command *cmd,void *buf,unsigned bufflen);struct request *__nvme_alloc_rq (struct request_queue *q, -struct nvme_command *cmd,int qid,blk_mq_req_flags_t flags); +struct nvme_command *cmd,int qid,blk_mq_req_flags_t flags,bool retry);int __nvme_submit_sync_cmd (struct request_queue *q,struct request *req,union nvme_result *result,void *buffer,unsigned bufflen,int at_head); int nvme_set_features(struct nvme_ctrl *dev, unsigned int fid,
drivers/nvme/host/pci.c +3 -2
@@ -1377,7 +1377,7 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req) nvmeq->qid); abort_req =__nvme_alloc_rq (dev->ctrl.admin_q, &cmd, -NVME_QID_ANY ,BLK_MQ_REQ_NOWAIT ); +NVME_QID_ANY ,BLK_MQ_REQ_NOWAIT , false);if (IS_ERR (abort_req)) {atomic_inc (&dev->ctrl.abort_limit);return BLK_EH_RESET_TIMER ;
@@ -2390,7 +2390,8 @@ static int nvme_delete_queue(struct nvme_queue *nvmeq, u8 opcode) cmd.delete_queue.opcode = opcode; cmd.delete_queue.qid =cpu_to_le16 (nvmeq->qid); - req =__nvme_alloc_rq (q, &cmd,NVME_QID_ANY ,BLK_MQ_REQ_NOWAIT ); + req =__nvme_alloc_rq (q, &cmd,NVME_QID_ANY , +BLK_MQ_REQ_NOWAIT , false);if (IS_ERR (req))return PTR_ERR (req);
drivers/nvme/target/passthru.c +1 -1
@@ -316,7 +316,7 @@ static void nvmet_passthru_execute_cmd(struct nvmet_req *req) timeout =nvmet_req_subsys (req)->admin_timeout; } - rq =__nvme_alloc_rq (q, req->cmd,NVME_QID_ANY ,0 ); + rq =__nvme_alloc_rq (q, req->cmd,NVME_QID_ANY ,0 , false);if (IS_ERR (rq)) { status =NVME_SC_INTERNAL ; goto out_put_ns;
Signature · 1 line
2.35.3
Re: [PATCH 2/3] nvme: retry internal commands if DNR status bit is not set
Quoted 5 lines · Hannes Reinecke
Add a 'retry' argument to
__nvme_alloc_rq()to instruct the function to not set theFAILFAST_DRIVERbit for the command, causing it to be retried innvme_decide_disposition()if the DNR bit is not set in the command result.
And modify the authentication code to allow for retries.
This new argument is sent as true only at one place.
Will it be better to have that case handled in that place itself? By clearing REQ_FAILFAST_DRIVER bit from req->cmd_flags in auth code.
Hannes Reinecke
maintainerRe: [PATCH 2/3] nvme: retry internal commands if DNR status bit is not set
Quoted 8 lines · Kanchan Joshi
Quoted 5 lines · Hannes Reinecke
Add a 'retry' argument to
__nvme_alloc_rq()to instruct the function to not set theFAILFAST_DRIVERbit for the command, causing it to be retried innvme_decide_disposition()if the DNR bit is not set in the command result.
And modify the authentication code to allow for retries.
Quoted 4 lines
This new argument is sent as true only at one place.
Will it be better to have that case handled in that place itself? By clearingREQ_FAILFAST_DRIVERbit fromreq->cmd_flagsin auth code.
Good point. Will be resending.
Cheers,
Hannes
Hannes Reinecke
maintainerPATCH 3/3 nvme: make 'at_head' parameter for __nvme_submit_sync_cmd() boolean
In reply to Hannes ReineckeUse a boolean for the 'at_head' parameter in __nvme_submit_sync_cmd() to improve readability and consistency; it's being converted into a boolean anyway.
--- drivers/nvme/host/auth.c | 2 +- drivers/nvme/host/core.c | 8 ++++---- drivers/nvme/host/fabrics.c | 10 +++++----- drivers/nvme/host/nvme.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-)
drivers/nvme/host/auth.c +1 -1
@@ -82,7 +82,7 @@ static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid,if (IS_ERR (req))return PTR_ERR (req); - ret =__nvme_submit_sync_cmd (q, req,NULL , data, data_len,0 ); + ret =__nvme_submit_sync_cmd (q, req,NULL , data, data_len, false);if (ret >0 )dev_warn (ctrl->device,"qid %d auth_send failed with status %d\n" , qid, ret);
drivers/nvme/host/core.c +4 -4
@@ -1042,7 +1042,7 @@ EXPORT_SYMBOL_GPL(__nvme_alloc_rq);* if the result is positive, it's an NVM Express status code */ int __nvme_submit_sync_cmd (struct request_queue *q,struct request *req, -union nvme_result *result,void *buffer,unsigned bufflen,int at_head) +union nvme_result *result,void *buffer,unsigned bufflen,bool at_head) {int ret;
@@ -1070,7 +1070,7 @@ int nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,if (IS_ERR (req))return PTR_ERR (req); -return __nvme_submit_sync_cmd (q, req,NULL , buffer, bufflen,0 ); +return __nvme_submit_sync_cmd (q, req,NULL , buffer, bufflen, false); }EXPORT_SYMBOL_GPL (nvme_submit_sync_cmd);
@@ -1501,7 +1501,7 @@ static int nvme_features(struct nvme_ctrl *dev, u8 op, unsigned int fid,return PTR_ERR (req); ret =__nvme_submit_sync_cmd (dev->admin_q, req, &res, - buffer, buflen,0 ); + buffer, buflen, false);if (ret >=0 && result) *result =le32_to_cpu (res.u32);return ret;
@@ -2237,7 +2237,7 @@ static int nvme_sec_submit(void *data, u16 spsp, u8 secp, void *buffer, size_t lif (IS_ERR (req))return PTR_ERR (req); -return __nvme_submit_sync_cmd (ctrl->admin_q, req,NULL , buffer, len,1 ); +return __nvme_submit_sync_cmd (ctrl->admin_q, req,NULL , buffer, len, true); }static void nvme_configure_opal (struct nvme_ctrl *ctrl,bool was_suspended)
drivers/nvme/host/fabrics.c +5 -5
@@ -157,7 +157,7 @@ int nvmf_reg_read32(struct nvme_ctrl *ctrl, u32 off, u32 *val)if (IS_ERR (req))return PTR_ERR (req); - ret =__nvme_submit_sync_cmd (ctrl->fabrics_q, req, &res,NULL ,0 ,0 ); + ret =__nvme_submit_sync_cmd (ctrl->fabrics_q, req, &res,NULL ,0 , false);if (ret >=0 ) *val =le64_to_cpu (res.u64);
@@ -207,7 +207,7 @@ int nvmf_reg_read64(struct nvme_ctrl *ctrl, u32 off, u64 *val)if (IS_ERR (req))return PTR_ERR (req); - ret =__nvme_submit_sync_cmd (ctrl->fabrics_q, req, &res,NULL ,0 ,0 ); + ret =__nvme_submit_sync_cmd (ctrl->fabrics_q, req, &res,NULL ,0 , false);if (ret >=0 ) *val =le64_to_cpu (res.u64);
@@ -256,7 +256,7 @@ int nvmf_reg_write32(struct nvme_ctrl *ctrl, u32 off, u32 val)if (IS_ERR (req))return PTR_ERR (req); - ret =__nvme_submit_sync_cmd (ctrl->fabrics_q, req,NULL ,NULL ,0 ,0 ); + ret =__nvme_submit_sync_cmd (ctrl->fabrics_q, req,NULL ,NULL ,0 , false);if (unlikely (ret)) dev_err(ctrl->device, "Property Set error: %d, offset %#x\n",
@@ -418,7 +418,7 @@ int nvmf_connect_admin_queue(struct nvme_ctrl *ctrl)return PTR_ERR (req); ret =__nvme_submit_sync_cmd (ctrl->fabrics_q, req, &res, - data,sizeof (*data),1 ); + data,sizeof (*data), true);if (ret) {nvmf_log_connect_error (ctrl, ret,le32_to_cpu (res.u32), &cmd, data);
@@ -509,7 +509,7 @@ int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid)return PTR_ERR (req); ret =__nvme_submit_sync_cmd (ctrl->connect_q, req, &res, - data,sizeof (*data),1 ); + data,sizeof (*data), true);if (ret) {nvmf_log_connect_error (ctrl, ret,le32_to_cpu (res.u32), &cmd, data);
drivers/nvme/host/nvme.h +1 -1
@@ -817,7 +817,7 @@ int nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,struct request *__nvme_alloc_rq (struct request_queue *q,struct nvme_command *cmd,int qid,blk_mq_req_flags_t flags,bool retry);int __nvme_submit_sync_cmd (struct request_queue *q,struct request *req,union nvme_result *result, -void *buffer,unsigned bufflen,int at_head); +void *buffer,unsigned bufflen,bool at_head);int nvme_set_features (struct nvme_ctrl *dev,unsigned int fid,unsigned int dword11,void *buffer,size_t buflen,u32 *result);
Signature · 1 line
2.35.3