From 3aaf8e0a0b0d0438565bae73e3bec10a1651cfee Mon Sep 17 00:00:00 2001 From: Alexey Marchuk Date: Fri, 28 Aug 2020 13:05:32 +0300 Subject: [PATCH] nvmf: Stop pg poller when all qpairs are destroyed We stopped the poller to early, so we were not able to reap all completions on ibv CQ, so RDMA qpair was not freed. This patch stops the poller when all references to poll group are released (all qpairs are destroyed) Fixes #1578 Change-Id: I15c1697db13aef9da7567c7312476306c3ee1d62 Signed-off-by: Alexey Marchuk Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3962 Reviewed-by: Ziye Yang Reviewed-by: Ben Walker Reviewed-by: Changpeng Liu Community-CI: Mellanox Build Bot Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins --- lib/nvmf/nvmf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nvmf/nvmf.c b/lib/nvmf/nvmf.c index bc58f1da7..942e3eaf5 100644 --- a/lib/nvmf/nvmf.c +++ b/lib/nvmf/nvmf.c @@ -185,6 +185,8 @@ nvmf_tgt_destroy_poll_group(void *io_device, void *ctx_buf) free(group->sgroups); + spdk_poller_unregister(&group->poller); + if (group->destroy_cb_fn) { group->destroy_cb_fn(group->destroy_cb_arg, 0); } @@ -225,8 +227,6 @@ nvmf_tgt_destroy_poll_group_qpairs(struct spdk_nvmf_poll_group *group) return; } - spdk_poller_unregister(&group->poller); - ctx->group = group; _nvmf_tgt_disconnect_next_qpair(ctx); }