From d786273dc1c604f15bcbd7b020af6992431421df Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Sun, 7 Feb 2021 22:47:34 +0800 Subject: [PATCH] nvmf/vfio-user: connect IO queue pair after creating SQ The CQ is created first, so it's more reasonable to connect the IO queue pair after creating the SQ. Change-Id: I196c19a54a015310a3777d9bfca7db8735a4d5b2 Signed-off-by: Changpeng Liu Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6309 Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- lib/nvmf/vfio_user.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/nvmf/vfio_user.c b/lib/nvmf/vfio_user.c index 92807edb8..549bafe77 100644 --- a/lib/nvmf/vfio_user.c +++ b/lib/nvmf/vfio_user.c @@ -889,6 +889,7 @@ handle_create_io_q(struct nvmf_vfio_user_ctrlr *ctrlr, sc = SPDK_NVME_SC_INTERNAL_DEVICE_ERROR; goto out; } + } else { /* * After we've returned from the nvmf_vfio_user_poll_group_poll thread, once * nvmf_vfio_user_accept executes it will pick up this QP and will eventually @@ -897,6 +898,7 @@ handle_create_io_q(struct nvmf_vfio_user_ctrlr *ctrlr, * completion callback. */ TAILQ_INSERT_TAIL(&ctrlr->transport->new_qps, ctrlr->qp[cmd->cdw10_bits.create_io_q.qid], link); + } insert_queue(ctrlr, &io_q, is_cq, cmd->cdw10_bits.create_io_q.qid);