nvme: share one routine between Delete I/O CQ and Delete I/O SQ

Reviewed by:	imp, adrian
Differential Revision:	https://reviews.freebsd.org/D60021
This commit is contained in:
Abdelkader Boudih committed 2026-09-25 22:42:42 +01:00
1 parent 8a860e8286
commit 4bfe52650c
1 file changed
+15 -21
+15 -21
View File
@@ -121,9 +121,9 @@ nvme_ctrlr_cmd_create_io_sq(struct nvme_controller *ctrlr,
nvme_ctrlr_submit_admin_request(ctrlr, req);
}
void
nvme_ctrlr_cmd_delete_io_cq(struct nvme_controller *ctrlr,
struct nvme_qpair *io_que, nvme_cb_fn_t cb_fn, void *cb_arg)
static void
nvme_ctrlr_cmd_delete_io_queue(struct nvme_controller *ctrlr,
struct nvme_qpair *io_que, uint8_t opc, nvme_cb_fn_t cb_fn, void *cb_arg)
{
struct nvme_request *req;
struct nvme_command *cmd;
@@ -131,36 +131,30 @@ nvme_ctrlr_cmd_delete_io_cq(struct nvme_controller *ctrlr,
req = nvme_allocate_request_null(M_WAITOK, cb_fn, cb_arg);
cmd = &req->cmd;
cmd->opc = NVME_OPC_DELETE_IO_CQ;
cmd->opc = opc;
/*
* TODO: create a delete io completion queue command data
* structure.
* TODO: create a delete io queue command data structure.
*/
cmd->cdw10 = htole32(io_que->id);
nvme_ctrlr_submit_admin_request(ctrlr, req);
}
void
nvme_ctrlr_cmd_delete_io_cq(struct nvme_controller *ctrlr,
struct nvme_qpair *io_que, nvme_cb_fn_t cb_fn, void *cb_arg)
{
nvme_ctrlr_cmd_delete_io_queue(ctrlr, io_que, NVME_OPC_DELETE_IO_CQ,
cb_fn, cb_arg);
}
void
nvme_ctrlr_cmd_delete_io_sq(struct nvme_controller *ctrlr,
struct nvme_qpair *io_que, nvme_cb_fn_t cb_fn, void *cb_arg)
{
struct nvme_request *req;
struct nvme_command *cmd;
req = nvme_allocate_request_null(M_WAITOK, cb_fn, cb_arg);
cmd = &req->cmd;
cmd->opc = NVME_OPC_DELETE_IO_SQ;
/*
* TODO: create a delete io submission queue command data
* structure.
*/
cmd->cdw10 = htole32(io_que->id);
nvme_ctrlr_submit_admin_request(ctrlr, req);
nvme_ctrlr_cmd_delete_io_queue(ctrlr, io_que, NVME_OPC_DELETE_IO_SQ,
cb_fn, cb_arg);
}
void