nvmf/vfio-user: complete queue deletion on correct thread

If the queue was on another poll group, we need to send a message back
to the admin CQ's thread to post the completion from the correct
context.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I997987d5d6b822a1a5124f54fc29ce5d7f03190d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14057
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
John Levon 2022-08-16 08:47:15 +00:00 committed by Tomasz Zawadzki
parent e93ba047ac
commit 2eaae37ded

View File

@ -1624,6 +1624,10 @@ post_completion(struct nvmf_vfio_user_ctrlr *ctrlr, struct nvmf_vfio_user_cq *cq
return 0;
}
if (cq->qid == 0) {
assert(spdk_get_thread() == cq->thread);
}
if (cq_is_full(cq)) {
SPDK_ERRLOG("%s: cqid:%d full (tail=%d, head=%d)\n",
ctrlr_id(ctrlr), cq->qid, *cq_tailp(cq),
@ -2117,10 +2121,19 @@ vfio_user_qpair_delete_cb(void *cb_arg)
{
struct vfio_user_delete_sq_ctx *ctx = cb_arg;
struct nvmf_vfio_user_ctrlr *vu_ctrlr = ctx->vu_ctrlr;
struct nvmf_vfio_user_cq *admin_cq = vu_ctrlr->cqs[0];
post_completion(vu_ctrlr, vu_ctrlr->cqs[0], 0, 0, ctx->delete_io_sq_cmd.cid,
if (admin_cq->thread != spdk_get_thread()) {
assert(admin_cq->thread != NULL);
spdk_thread_send_msg(admin_cq->thread,
vfio_user_qpair_delete_cb,
cb_arg);
} else {
post_completion(vu_ctrlr, vu_ctrlr->cqs[0], 0, 0,
ctx->delete_io_sq_cmd.cid,
SPDK_NVME_SC_SUCCESS, SPDK_NVME_SCT_GENERIC);
free(ctx);
}
}
/*