[PATCH v4 03/15] nvmet: Implement CCR nvme command

Randy Jennings randyj at purestorage.com
Thu May 14 17:18:37 PDT 2026


On Fri, Mar 27, 2026 at 5:45 PM Mohamed Khalfella
<mkhalfella at purestorage.com> wrote:
>
> Defined by TP8028 Rapid Path Failure Recovery, CCR (Cross-Controller
> Reset) command is an nvme command issued to source controller by
> initiator to reset impacted controller. Implement CCR command for linux
> nvme target.
>
> Signed-off-by: Mohamed Khalfella <mkhalfella at purestorage.com>
> ---

> +       mutex_lock(&sctrl->lock);
> +       list_for_each_entry(ccr, &sctrl->ccr_list, entry) {
> +               if (ccr->ctrl == ictrl) {
> +                       status = NVME_SC_CCR_IN_PROGRESS | NVME_STATUS_DNR;
> +                       goto out_unlock;
> +               }
> +
> +               ccr_total++;
> +               if (ccr->ctrl)
> +                       ccr_active++;
> +       }
> +
> +       if (ccr_active >= NVMF_CCR_LIMIT) {
> +               status = NVME_SC_CCR_LIMIT_EXCEEDED;
> +               goto out_unlock;
> +       }
> +       if (ccr_total >= NVMF_CCR_PER_PAGE) {
> +               status = NVME_SC_CCR_LOGPAGE_FULL;
> +               goto out_unlock;
> +       }
> +
> +       new_ccr = kmalloc_obj(*new_ccr, GFP_KERNEL);
This allocation could be done optimistically outside of the mutex.
But that would lead to more complicated code; probably not worth it
here.

Reviewed-by: Randy Jennings <randyj at purestorage.com>



More information about the Linux-nvme mailing list