Re: [RFC PATCH 03/14] nvmet: Implement CCR nvme command
From: Sagi Grimberg
Date: Sat Dec 27 2025 - 04:40:09 EST
'i' stands for impacted controller. Also, if you see sctrl the 's'+void nvmet_execute_cross_ctrl_reset(struct nvmet_req *req)What does the 'i' stand for?
+{
+ struct nvmet_ctrl *ictrl, *ctrl = req->sq->ctrl;
+ struct nvme_command *cmd = req->cmd;
+ struct nvmet_ccr *ccr, *new_ccr;
+ int ccr_active, ccr_total;
+ u16 cntlid, status = 0;
+
+ cntlid = le16_to_cpu(cmd->ccr.icid);
+ if (ctrl->cntlid == cntlid) {
+ req->error_loc =
+ offsetof(struct nvme_cross_ctrl_reset_cmd, icid);
+ status = NVME_SC_INVALID_FIELD | NVME_STATUS_DNR;
+ goto out;
+ }
+
+ ictrl = nvmet_ctrl_find_get_ccr(ctrl->subsys, ctrl->hostnqn,
stands for source controller. These terms are from TP8028.
Can you perhaps add a comment on this?
No, we do not need to wait for ictrl->fatal_err_work to complete. An AEN+ new_ccr->ciu = cmd->ccr.ciu;Don't you need to wait for it to complete?
+ new_ccr->icid = cntlid;
+ new_ccr->ctrl = ictrl;
+ list_add_tail(&new_ccr->entry, &ctrl->ccrs);
+ mutex_unlock(&ctrl->lock);
+
+ nvmet_ctrl_fatal_error(ictrl);
e.g. flush_work(&ictrl->fatal_err_work);
Or is that done async? will need to look downstream...
will be sent when ictrl exits. It is okay if AEN is sent before CCR
request is completed. The initiator should expect this behavior and deal
with it.
Yes, saw that in a later patch (didn't get to do a full review yet)