From 3d4b9ba0d49a613385dbb5b7744064a1d85d2b57 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Tue, 27 Apr 2021 21:02:31 +0800 Subject: [PATCH] nvmf/vfio-user: rename destroy_qp to free_qp The original destroy_qp() only release the queue pair related memory, and free_qp() will be called inside destroy_ctrlr() function, so also remove one duplicated line here. Change-Id: I2a06a6704b514361685068acda4e65ed5d502f0d Signed-off-by: Changpeng Liu Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7622 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto Reviewed-by: --- lib/nvmf/vfio_user.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/nvmf/vfio_user.c b/lib/nvmf/vfio_user.c index 963ee7fec..1b663b092 100644 --- a/lib/nvmf/vfio_user.c +++ b/lib/nvmf/vfio_user.c @@ -727,12 +727,8 @@ unmap_qp(struct nvmf_vfio_user_qpair *qp) } } -/* - * TODO we can immediately remove the QP from the list because this function - * is now executed by the SPDK thread. - */ static void -destroy_qp(struct nvmf_vfio_user_ctrlr *ctrlr, uint16_t qid) +free_qp(struct nvmf_vfio_user_ctrlr *ctrlr, uint16_t qid) { struct nvmf_vfio_user_qpair *qpair; @@ -1601,7 +1597,7 @@ _destroy_ctrlr(void *ctx) int i; for (i = 0; i < NVMF_VFIO_USER_DEFAULT_MAX_QPAIRS_PER_CTRLR; i++) { - destroy_qp(ctrlr, i); + free_qp(ctrlr, i); } if (ctrlr->endpoint) { @@ -2002,7 +1998,6 @@ handle_queue_connect_rsp(struct nvmf_vfio_user_req *req, void *cb_arg) if (spdk_nvme_cpl_is_error(&req->req.rsp->nvme_cpl)) { SPDK_ERRLOG("SC %u, SCT %u\n", req->req.rsp->nvme_cpl.status.sc, req->req.rsp->nvme_cpl.status.sct); - destroy_qp(ctrlr, qpair->qpair.qid); destroy_ctrlr(ctrlr); return -1; } @@ -2172,7 +2167,7 @@ nvmf_vfio_user_close_qpair(struct spdk_nvmf_qpair *qpair, assert(qpair != NULL); vu_qpair = SPDK_CONTAINEROF(qpair, struct nvmf_vfio_user_qpair, qpair); - destroy_qp(vu_qpair->ctrlr, qpair->qid); + free_qp(vu_qpair->ctrlr, qpair->qid); if (cb_fn) { cb_fn(cb_arg);