nvmf/vfio-user: reduce libvfio-user socket poll frequency

Constantly polling the socket degrades performance significantly.
Polling the socket at a much lower frequency, every 1ms, is good enough
for now.

fixes #2494

Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Co-authored-by: John Levon <john.levon@nutanix.com>
Change-Id: I4a7d35c45ece863b9df756324c23f41736df49f8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12494
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
This commit is contained in:
Thanos Makatos 2022-05-04 11:50:07 +00:00 committed by Jim Harris
parent dc43293241
commit 1535e9dbb6

View File

@ -4597,11 +4597,13 @@ handle_queue_connect_rsp(struct nvmf_vfio_user_req *req, void *cb_arg)
vu_ctrlr->thread = spdk_get_thread(); vu_ctrlr->thread = spdk_get_thread();
vu_ctrlr->ctrlr = sq->qpair.ctrlr; vu_ctrlr->ctrlr = sq->qpair.ctrlr;
vu_ctrlr->state = VFIO_USER_CTRLR_RUNNING; vu_ctrlr->state = VFIO_USER_CTRLR_RUNNING;
vu_ctrlr->vfu_ctx_poller = SPDK_POLLER_REGISTER(vfio_user_poll_vfu_ctx, vu_ctrlr, 0);
cq->thread = spdk_get_thread(); cq->thread = spdk_get_thread();
if (in_interrupt_mode(endpoint->transport)) { if (in_interrupt_mode(endpoint->transport)) {
vu_ctrlr->vfu_ctx_poller = SPDK_POLLER_REGISTER(vfio_user_poll_vfu_ctx,
vu_ctrlr, 0);
vu_ctrlr->intr_fd = vfu_get_poll_fd(vu_ctrlr->endpoint->vfu_ctx); vu_ctrlr->intr_fd = vfu_get_poll_fd(vu_ctrlr->endpoint->vfu_ctx);
assert(vu_ctrlr->intr_fd != -1); assert(vu_ctrlr->intr_fd != -1);
@ -4614,6 +4616,9 @@ handle_queue_connect_rsp(struct nvmf_vfio_user_req *req, void *cb_arg)
spdk_poller_register_interrupt(vu_ctrlr->vfu_ctx_poller, spdk_poller_register_interrupt(vu_ctrlr->vfu_ctx_poller,
vfio_user_set_intr_mode, vfio_user_set_intr_mode,
vu_ctrlr); vu_ctrlr);
} else {
vu_ctrlr->vfu_ctx_poller = SPDK_POLLER_REGISTER(vfio_user_poll_vfu_ctx,
vu_ctrlr, 1000);
} }
} else { } else {
/* For I/O queues this command was generated in response to an /* For I/O queues this command was generated in response to an