nvme_rdma: Remove a guard for recursive calls from poll_group_disconnect_qpair()
nvme_poll_group_disconnect_qpair() is called only by a single place now. We do not need the flag poll_group_disconnect_in_progress any more. Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Change-Id: I8f9c0f14baa8fcb9b0637635a5bb3d34a8b11af5 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10673 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: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
4c8ccb5403
commit
728e3721a4
@ -209,8 +209,6 @@ struct nvme_rdma_qpair {
|
||||
|
||||
bool delay_cmd_submit;
|
||||
|
||||
bool poll_group_disconnect_in_progress;
|
||||
|
||||
uint32_t num_completions;
|
||||
|
||||
/* Parallel arrays of response buffers + response SGLs of size num_entries */
|
||||
@ -2633,24 +2631,10 @@ nvme_rdma_poll_group_disconnect_qpair(struct spdk_nvme_qpair *qpair)
|
||||
struct nvme_rdma_qpair *rqpair = nvme_rdma_qpair(qpair);
|
||||
struct nvme_rdma_poll_group *group;
|
||||
struct nvme_rdma_destroyed_qpair *destroyed_qpair;
|
||||
enum nvme_qpair_state state;
|
||||
|
||||
if (rqpair->poll_group_disconnect_in_progress) {
|
||||
return -EINPROGRESS;
|
||||
}
|
||||
|
||||
rqpair->poll_group_disconnect_in_progress = true;
|
||||
state = nvme_qpair_get_state(qpair);
|
||||
group = nvme_rdma_poll_group(qpair->poll_group);
|
||||
rqpair->cq = NULL;
|
||||
|
||||
/*
|
||||
* We want to guard against an endless recursive loop while making
|
||||
* sure the qpair is disconnected before we disconnect it from the qpair.
|
||||
*/
|
||||
if (state > NVME_QPAIR_DISCONNECTING && state != NVME_QPAIR_DESTROYING) {
|
||||
nvme_ctrlr_disconnect_qpair(qpair);
|
||||
}
|
||||
rqpair->cq = NULL;
|
||||
|
||||
/* qpair has requests submitted to HW, need to wait for their completion.
|
||||
* Allocate a tracker and attach it to poll group */
|
||||
@ -2671,7 +2655,6 @@ nvme_rdma_poll_group_disconnect_qpair(struct spdk_nvme_qpair *qpair)
|
||||
|
||||
rqpair->defer_deletion_to_pg = true;
|
||||
|
||||
rqpair->poll_group_disconnect_in_progress = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* BSD LICENSE
|
||||
*
|
||||
* Copyright (c) Intel Corporation. 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
|
||||
@ -1038,7 +1038,6 @@ test_nvme_rdma_poll_group_connect_disconnect_qpair(void)
|
||||
rc = nvme_rdma_poll_group_disconnect_qpair(&rqpair->qpair);
|
||||
CU_ASSERT(rc == 0);
|
||||
CU_ASSERT(rqpair->defer_deletion_to_pg == true);
|
||||
CU_ASSERT(rqpair->poll_group_disconnect_in_progress == false);
|
||||
CU_ASSERT(rqpair->cq == NULL);
|
||||
CU_ASSERT(!STAILQ_EMPTY(&group.destroyed_qpairs));
|
||||
|
||||
@ -1068,11 +1067,6 @@ test_nvme_rdma_poll_group_connect_disconnect_qpair(void)
|
||||
CU_ASSERT(rc == -EINVAL);
|
||||
CU_ASSERT(rqpair->cq == NULL);
|
||||
|
||||
/* Poll group disconnect in progress */
|
||||
rqpair->poll_group_disconnect_in_progress = true;
|
||||
|
||||
rc = nvme_rdma_poll_group_disconnect_qpair(&rqpair->qpair);
|
||||
CU_ASSERT(rc == -EINPROGRESS);
|
||||
free(rqpair);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user