Skip to content

Commit 36e3b1f

Browse files
Chunguang.xukeithbusch
authored andcommitted
nvme-tcp: remove nvme_tcp_destroy_io_queues()
Now when destroying the IO queue we call nvme_tcp_stop_io_queues() twice, nvme_tcp_destroy_io_queues() has an unnecessary call. Here we try to remove nvme_tcp_destroy_io_queues() and merge it into nvme_tcp_teardown_io_queues(), simplify the code and align with nvme-rdma, make it easy to maintaince. Signed-off-by: Chunguang.xu <chunguang.xu@shopee.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 74d1696 commit 36e3b1f

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

drivers/nvme/host/tcp.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,14 +2024,6 @@ static int nvme_tcp_alloc_io_queues(struct nvme_ctrl *ctrl)
20242024
return __nvme_tcp_alloc_io_queues(ctrl);
20252025
}
20262026

2027-
static void nvme_tcp_destroy_io_queues(struct nvme_ctrl *ctrl, bool remove)
2028-
{
2029-
nvme_tcp_stop_io_queues(ctrl);
2030-
if (remove)
2031-
nvme_remove_io_tag_set(ctrl);
2032-
nvme_tcp_free_io_queues(ctrl);
2033-
}
2034-
20352027
static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new)
20362028
{
20372029
int ret, nr_queues;
@@ -2176,9 +2168,11 @@ static void nvme_tcp_teardown_io_queues(struct nvme_ctrl *ctrl,
21762168
nvme_sync_io_queues(ctrl);
21772169
nvme_tcp_stop_io_queues(ctrl);
21782170
nvme_cancel_tagset(ctrl);
2179-
if (remove)
2171+
if (remove) {
21802172
nvme_unquiesce_io_queues(ctrl);
2181-
nvme_tcp_destroy_io_queues(ctrl, remove);
2173+
nvme_remove_io_tag_set(ctrl);
2174+
}
2175+
nvme_tcp_free_io_queues(ctrl);
21822176
}
21832177

21842178
static void nvme_tcp_reconnect_or_remove(struct nvme_ctrl *ctrl,
@@ -2267,7 +2261,9 @@ static int nvme_tcp_setup_ctrl(struct nvme_ctrl *ctrl, bool new)
22672261
nvme_sync_io_queues(ctrl);
22682262
nvme_tcp_stop_io_queues(ctrl);
22692263
nvme_cancel_tagset(ctrl);
2270-
nvme_tcp_destroy_io_queues(ctrl, new);
2264+
if (new)
2265+
nvme_remove_io_tag_set(ctrl);
2266+
nvme_tcp_free_io_queues(ctrl);
22712267
}
22722268
destroy_admin:
22732269
nvme_stop_keep_alive(ctrl);

0 commit comments

Comments
 (0)