Re: [RFC PATCH 10/14] nvme-tcp: Use CCR to recover controller that hits an error

From: Sagi Grimberg
Date: Sun Jan 04 2026 - 16:19:19 EST




On 31/12/2025 2:13, Randy Jennings wrote:
On Sat, Dec 27, 2025 at 2:35 AM Sagi Grimberg <sagi@xxxxxxxxxxx> wrote:
On 26/11/2025 4:11, Mohamed Khalfella wrote:
...
+ dev_info(ctrl->device,
+ "CCR failed, switch to time-based recovery, timeout = %ums\n",
+ jiffies_to_msecs(rem));
+ set_bit(NVME_CTRL_RECOVERED, &ctrl->flags);
+ queue_delayed_work(nvme_reset_wq, &to_tcp_ctrl(ctrl)->err_work, rem);
+ return -EAGAIN;
I don't think that reusing the same work to handle two completely
different things
is the right approach here.

How about splitting to fence_work and err_work? That should eliminate
some of the
ctrl state inspections and simplify error recovery.
If the work was independent and could happen separately (probably
in parallel), I could understand having separate work structures. But they
are not independent, and they have a definite relationship.

The relationship that is defined here is that error recovery does not start
before fencing is completed.

Like Mohamed,
I thought of them as different stages of the same work. Having an extra
work item takes up more space (I would be concerned about scalability to
thousands or 10s of thousands of associations and then go one order of
magnitude higher for margin), and it also causes a connection object
(referenced during IO) to take up more cache lines. Is it worth taking up
that space, when the separate work items would be different, dependent
stages in the same process?

Yes, IMO the added space of an additional work_struct is much better than
adding more state around a single work handler that is queued up multiple
times doing effectively different things.