+31
−2
+6
−4
Loading
The controller destroy sequence is as follows: - Set `CC.SHN` to request shutdown - Wait for `CSTS.SHST` to be set to `0b10` (Shutdown complete) - Destroy the associated structs when it's done or after a timeout To do it, two things should be done: - First, call `nvme_ctrlr_destruct_async` - Then, poll `nvme_ctrlr_destruct_poll_async` However, when a controller fails to initialize on probe, this polling is done synchronously using `nvme_ctrlr_destruct`, which introduces 1ms sleep between each poll. This is really bad if a controller does not behave as expected and does not set its `CSTS.SHST` in a timely manner because it burdens the probe thread with tons of sleep. If hot-plug is enabled, it makes things even worse because this operation is retried again and again. Fix this by doing an asynchronous destruct when the controller fails to initialize. Add contexts for this operation on the probe context and poll for controllers destruction in the probe poller function. Signed-off-by:Nathan Claudel <nclaudel@kalrayinc.com> Change-Id: Ic072a2b7c3351a229d3b6e5c667b71dca2a84b93 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/25414 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Reviewed-by:
Vasuki Manikarnike <vasuki.manikarnike@hpe.com> Community-CI: Community CI Samsung <spdk.community.ci.samsung@gmail.com> Reviewed-by:
Jim Harris <jim.harris@nvidia.com> Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by:
Ankit Kumar <ankit.kumar@samsung.com> Reviewed-by:
Changpeng Liu <changpeliu@tencent.com> Community-CI: Mellanox Build Bot