nvmf/vfio-user: rename self_kick()

Reflect that we are kicking the entire controller.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: If5723a5f485745ef0a2456942b6df1d54133815b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12665
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
This commit is contained in:
John Levon 2022-05-23 14:05:56 +01:00 committed by Jim Harris
parent fa4ddd2d8c
commit faa0ba86e0

View File

@ -394,7 +394,7 @@ struct nvmf_vfio_user_ctrlr {
uint64_t eventidx_buffer;
bool adaptive_irqs_enabled;
bool self_kick_requested;
bool kick_requested;
};
/* Endpoint in vfio-user is associated with a socket file, which
@ -606,17 +606,20 @@ vfio_user_ctrlr_intr_wrapper(void *ctx)
vfio_user_ctrlr_intr(ctx);
}
/*
* Arrange for this controller to immediately wake up and process everything.
*/
static inline int
self_kick(struct nvmf_vfio_user_ctrlr *ctrlr)
ctrlr_kick(struct nvmf_vfio_user_ctrlr *ctrlr)
{
assert(ctrlr != NULL);
assert(ctrlr->thread != NULL);
if (ctrlr->self_kick_requested) {
if (ctrlr->kick_requested) {
return 0;
}
ctrlr->self_kick_requested = true;
ctrlr->kick_requested = true;
return spdk_thread_send_msg(ctrlr->thread,
vfio_user_ctrlr_intr_wrapper,
@ -1473,7 +1476,7 @@ vfio_user_sq_rearm(struct nvmf_vfio_user_ctrlr *ctrlr,
* we raced with the producer too many times; force ourselves to wake up
* instead. We'll process all queues at that point.
*/
self_kick(ctrlr);
ctrlr_kick(ctrlr);
return count;
}
@ -4594,7 +4597,7 @@ vfio_user_ctrlr_intr(void *ctx)
assert(ctrlr->sqs[0] != NULL);
assert(ctrlr->sqs[0]->group != NULL);
ctrlr->self_kick_requested = false;
ctrlr->kick_requested = false;
/*
* Poll vfio-user for this controller.
@ -4731,12 +4734,14 @@ handle_queue_connect_rsp(struct nvmf_vfio_user_req *req, void *cb_arg)
sq->post_create_io_sq_completion = false;
} else if (in_interrupt_mode(endpoint->transport)) {
/*
* FIXME self_kick() ends up polling all queues on the
* controller thread, and this will be wrong if we ever
* support interrupt mode with I/O queues in a
* different poll group than the controller's.
* If we're live migrating a guest, there is a window
* where the I/O queues haven't been set up but the
* device is in running state, during which the guest
* might write to a doorbell. This doorbell write will
* go unnoticed, so let's poll the whole controller to
* pick that up.
*/
self_kick(vu_ctrlr);
ctrlr_kick(vu_ctrlr);
}
sq->sq_state = VFIO_USER_SQ_ACTIVE;
}