bdev/nvme: Rename functions for a full ctrlr reset sequence

Rename a few functions for a full ctrlr reset sequence to
clarify what we do and make the following patches easier.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I051e3ab68c3cd77fd6040a2d069d50a700123ae6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10920
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Shuhei Matsumoto 2021-12-30 14:15:20 +09:00 committed by Jim Harris
parent 521a9bb22c
commit 3308bdf1b9

View File

@ -3,7 +3,7 @@
*
* Copyright (c) Intel Corporation. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies LTD. All rights reserved.
* Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* Copyright (c) 2021, 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -1390,7 +1390,7 @@ bdev_nvme_reset_create_qpair(struct spdk_io_channel_iter *i)
}
static int
bdev_nvme_ctrlr_reset_poll(void *arg)
bdev_nvme_reconnect_ctrlr_poll(void *arg)
{
struct nvme_ctrlr *nvme_ctrlr = arg;
int rc;
@ -1413,6 +1413,16 @@ bdev_nvme_ctrlr_reset_poll(void *arg)
return SPDK_POLLER_BUSY;
}
static void
bdev_nvme_reconnect_ctrlr(struct nvme_ctrlr *nvme_ctrlr)
{
spdk_nvme_ctrlr_reconnect_async(nvme_ctrlr->ctrlr);
assert(nvme_ctrlr->reset_detach_poller == NULL);
nvme_ctrlr->reset_detach_poller = SPDK_POLLER_REGISTER(bdev_nvme_reconnect_ctrlr_poll,
nvme_ctrlr, 0);
}
static void
bdev_nvme_reset_ctrlr(struct spdk_io_channel_iter *i, int status)
{
@ -1428,11 +1438,7 @@ bdev_nvme_reset_ctrlr(struct spdk_io_channel_iter *i, int status)
rc = spdk_nvme_ctrlr_disconnect(nvme_ctrlr->ctrlr);
assert(rc == 0);
spdk_nvme_ctrlr_reconnect_async(nvme_ctrlr->ctrlr);
assert(nvme_ctrlr->reset_detach_poller == NULL);
nvme_ctrlr->reset_detach_poller = SPDK_POLLER_REGISTER(bdev_nvme_ctrlr_reset_poll,
nvme_ctrlr, 0);
bdev_nvme_reconnect_ctrlr(nvme_ctrlr);
}
static void