From 10feaff29901c7cc1ea4a3ff5277c064f17066e1 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Mon, 19 Apr 2021 11:51:51 -0700 Subject: [PATCH] nvme: only process io_msg in primary process The io_msg qpair is allocated and managed by the primary process, so don't try polling it from secondary processes. This fixes a bug where an SPDK target has configured cuse, and we try to run fio (for example) as a secondary process. Signed-off-by: Jim Harris Change-Id: I48e2b89597196ce2ba1fc02ea3a7c76c5a33281a Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7482 Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto Reviewed-by: Tested-by: SPDK CI Jenkins --- lib/nvme/nvme_io_msg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/nvme/nvme_io_msg.c b/lib/nvme/nvme_io_msg.c index fb5aec3d4d..28aa3379ee 100644 --- a/lib/nvme/nvme_io_msg.c +++ b/lib/nvme/nvme_io_msg.c @@ -87,6 +87,10 @@ nvme_io_msg_process(struct spdk_nvme_ctrlr *ctrlr) return 0; } + if (!spdk_process_is_primary()) { + return 0; + } + spdk_nvme_qpair_process_completions(ctrlr->external_io_msgs_qpair, 0); count = spdk_ring_dequeue(ctrlr->external_io_msgs, requests,