nvme: add option to keep existing timeout
It will allow the async callbacks to retain the existing timeout while changing controller's state. Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: I4210f2cf7d4171444c338b8926334b985129a6c7 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8613 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
38091aade8
commit
d953072d21
@ -1312,6 +1312,12 @@ nvme_ctrlr_set_state(struct spdk_nvme_ctrlr *ctrlr, enum nvme_ctrlr_state state,
|
||||
uint64_t ticks_per_ms, timeout_in_ticks, now_ticks;
|
||||
|
||||
ctrlr->state = state;
|
||||
if (timeout_in_ms == NVME_TIMEOUT_KEEP_EXISTING) {
|
||||
NVME_CTRLR_DEBUGLOG(ctrlr, "setting state to %s (keeping existing timeout)\n",
|
||||
nvme_ctrlr_state_string(ctrlr->state));
|
||||
return;
|
||||
}
|
||||
|
||||
if (timeout_in_ms == NVME_TIMEOUT_INFINITE) {
|
||||
goto inf;
|
||||
}
|
||||
|
@ -740,7 +740,8 @@ enum nvme_ctrlr_state {
|
||||
NVME_CTRLR_STATE_ERROR
|
||||
};
|
||||
|
||||
#define NVME_TIMEOUT_INFINITE 0
|
||||
#define NVME_TIMEOUT_INFINITE 0
|
||||
#define NVME_TIMEOUT_KEEP_EXISTING UINT64_MAX
|
||||
|
||||
struct spdk_nvme_ctrlr_aer_completion_list {
|
||||
struct spdk_nvme_cpl cpl;
|
||||
|
Loading…
Reference in New Issue
Block a user