nvmf: save association timeout value in ctrlr
Currently we fetch the value from the transport via the admin_qpair. But there are corner cases where the admin_qpair may be disconnected after an EN=0 or shutdown process has started. We could do something like detect if the controller is being destructed before starting the association timer, but I think just saving the timeout value in the ctrlr is a bit cleaner. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Iaf4ceb2f9d38cee3c9a258e1fdf367972030fbe9 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6056 Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: <dongx.yi@intel.com>
This commit is contained in:
parent
12f4a2c62d
commit
3f2d21a0a6
@ -263,6 +263,7 @@ _nvmf_ctrlr_add_admin_qpair(void *ctx)
|
||||
struct spdk_nvmf_ctrlr *ctrlr = qpair->ctrlr;
|
||||
|
||||
ctrlr->admin_qpair = qpair;
|
||||
ctrlr->association_timeout = qpair->transport->opts.association_timeout;
|
||||
nvmf_ctrlr_start_keep_alive_timer(ctrlr);
|
||||
ctrlr_add_qpair_and_update_rsp(qpair, ctrlr, rsp);
|
||||
_nvmf_request_complete(req);
|
||||
@ -851,7 +852,7 @@ nvmf_ctrlr_cc_shn_done(struct spdk_io_channel_iter *i, int status)
|
||||
nvmf_ctrlr_stop_association_timer(ctrlr);
|
||||
}
|
||||
ctrlr->association_timer = SPDK_POLLER_REGISTER(nvmf_ctrlr_association_remove, ctrlr,
|
||||
ctrlr->admin_qpair->transport->opts.association_timeout * 1000);
|
||||
ctrlr->association_timeout * 1000);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -875,7 +876,7 @@ nvmf_ctrlr_cc_reset_done(struct spdk_io_channel_iter *i, int status)
|
||||
nvmf_ctrlr_stop_association_timer(ctrlr);
|
||||
}
|
||||
ctrlr->association_timer = SPDK_POLLER_REGISTER(nvmf_ctrlr_association_remove, ctrlr,
|
||||
ctrlr->admin_qpair->transport->opts.association_timeout * 1000);
|
||||
ctrlr->association_timeout * 1000);
|
||||
}
|
||||
|
||||
const struct spdk_nvmf_registers *
|
||||
|
@ -236,6 +236,7 @@ struct spdk_nvmf_ctrlr {
|
||||
uint8_t nr_aer_reqs;
|
||||
struct spdk_uuid hostid;
|
||||
|
||||
uint32_t association_timeout; /* in milliseconds */
|
||||
uint16_t changed_ns_list_count;
|
||||
struct spdk_nvme_ns_list changed_ns_list;
|
||||
uint64_t log_page_count;
|
||||
|
Loading…
x
Reference in New Issue
Block a user