From 4c8ccb54035292fcf37926198b9fc21ff4a72fd8 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Fri, 24 Dec 2021 00:24:16 +0900 Subject: [PATCH] nvme: Remove poll_group_disconnect_qpair() call from poll_group_remove() spdk_nvme_poll_group_remove() is available only for disconnected qpairs now. Hence spdk_nvme_poll_group_remove() does not have to check if qpair is connected and call nvme_ctrlr_disconnect_qpair(). Signed-off-by: Shuhei Matsumoto Change-Id: I3b05246c4be6adfa3392b8f0e5ecaf274a8a7795 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10846 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Aleksey Marchuk Reviewed-by: Monica Kenguva --- lib/nvme/nvme_rdma.c | 4 +--- lib/nvme/nvme_tcp.c | 7 ++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/nvme/nvme_rdma.c b/lib/nvme/nvme_rdma.c index 637001f8f6..32bb0e0c5c 100644 --- a/lib/nvme/nvme_rdma.c +++ b/lib/nvme/nvme_rdma.c @@ -2686,9 +2686,7 @@ static int nvme_rdma_poll_group_remove(struct spdk_nvme_transport_poll_group *tgroup, struct spdk_nvme_qpair *qpair) { - if (qpair->poll_group_tailq_head == &tgroup->connected_qpairs) { - return nvme_poll_group_disconnect_qpair(qpair); - } + assert(qpair->poll_group_tailq_head == &tgroup->disconnected_qpairs); return 0; } diff --git a/lib/nvme/nvme_tcp.c b/lib/nvme/nvme_tcp.c index 5cfe965438..a608ba5844 100644 --- a/lib/nvme/nvme_tcp.c +++ b/lib/nvme/nvme_tcp.c @@ -2284,18 +2284,15 @@ nvme_tcp_poll_group_remove(struct spdk_nvme_transport_poll_group *tgroup, struct spdk_nvme_qpair *qpair) { struct nvme_tcp_qpair *tqpair; - int rc = 0; - if (qpair->poll_group_tailq_head == &tgroup->connected_qpairs) { - rc = nvme_poll_group_disconnect_qpair(qpair); - } + assert(qpair->poll_group_tailq_head == &tgroup->disconnected_qpairs); tqpair = nvme_tcp_qpair(qpair); assert(tqpair->shared_stats == true); tqpair->stats = &g_dummy_stats; - return rc; + return 0; } static int64_t