From ae131ad0c99d2d1c70dcd90f9e12404c254ccf96 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Thu, 12 Aug 2021 23:08:09 +0800 Subject: [PATCH] nvmf/vfio-user: disable shared IO CQ case Existing vfio-user assumes that the IO SQ/CQ are paired, so we return an error when creating SQ with shared CQID. Leave a TODO comment, we may support this in future. Change-Id: I297ce53eb9a119469145e2453177d03252b629c8 Signed-off-by: Changpeng Liu Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9173 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker Reviewed-by: Thanos Makatos --- lib/nvmf/vfio_user.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/nvmf/vfio_user.c b/lib/nvmf/vfio_user.c index 35cf3e9d0..ff1aa273d 100644 --- a/lib/nvmf/vfio_user.c +++ b/lib/nvmf/vfio_user.c @@ -1174,6 +1174,12 @@ handle_create_io_q(struct nvmf_vfio_user_ctrlr *ctrlr, sc = SPDK_NVME_SC_INVALID_CONTROLLER_MEM_BUF; goto out; } + /* TODO: support shared IO CQ */ + if (qid != cmd->cdw11_bits.create_io_sq.cqid) { + SPDK_ERRLOG("%s: doesn't support shared CQ now\n", ctrlr_id(ctrlr)); + sct = SPDK_NVME_SCT_COMMAND_SPECIFIC; + sc = SPDK_NVME_SC_INVALID_QUEUE_IDENTIFIER; + } io_q = &ctrlr->qp[qid]->sq; io_q->cqid = cmd->cdw11_bits.create_io_sq.cqid;