From 623d5cc4563d21d0a4089525c0f7b81f68fa9352 Mon Sep 17 00:00:00 2001 From: Alexey Marchuk Date: Fri, 23 Oct 2020 20:32:35 +0300 Subject: [PATCH] nvme: Don't log an error when we can't resubmit all requests In TCP NVME initiator with zero copy enabled requests might be completed asynchronously - out of qpair_process_completions context. At the same time we calculate requests completed asynchronously so that generic NVME layer can resubmit queued requests after calling qpair_process_requests (or poll_group_process_requests). But there is a time gap between async request complete and qpair_process_completions and the user can submit new IO thereby decrease the number of free TCP requests. That means that there might be less free requests than we excpected when we try to resubmit queued requests. The solution is change ERRLOG to DEBUG log since it is not a fatal case. Signed-off-by: Alexey Marchuk Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4859 (master) (cherry picked from commit e385cafa7296ef656aae71b869eef0a211e0a0e9) Change-Id: If045ecd331cc6693e8ef450d8e15432dfa5d8812 Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4872 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Aleksey Marchuk --- lib/nvme/nvme_qpair.c | 2 +- test/unit/lib/nvme/nvme_qpair.c/nvme_qpair_ut.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/nvme/nvme_qpair.c b/lib/nvme/nvme_qpair.c index 401ff017d9..8ff2f70a46 100644 --- a/lib/nvme/nvme_qpair.c +++ b/lib/nvme/nvme_qpair.c @@ -667,7 +667,7 @@ nvme_qpair_resubmit_requests(struct spdk_nvme_qpair *qpair, uint32_t num_request STAILQ_REMOVE_HEAD(&qpair->queued_req, stailq); resubmit_rc = nvme_qpair_resubmit_request(qpair, req); if (spdk_unlikely(resubmit_rc != 0)) { - SPDK_ERRLOG("Unable to resubmit as many requests as we completed.\n"); + SPDK_DEBUGLOG(nvme, "Unable to resubmit as many requests as we completed.\n"); break; } } diff --git a/test/unit/lib/nvme/nvme_qpair.c/nvme_qpair_ut.c b/test/unit/lib/nvme/nvme_qpair.c/nvme_qpair_ut.c index 02c4ed1708..d6e141aae8 100644 --- a/test/unit/lib/nvme/nvme_qpair.c/nvme_qpair_ut.c +++ b/test/unit/lib/nvme/nvme_qpair.c/nvme_qpair_ut.c @@ -44,6 +44,8 @@ bool trace_flag = false; #include "nvme/nvme_qpair.c" +SPDK_LOG_REGISTER_COMPONENT(nvme) + struct nvme_driver _g_nvme_driver = { .lock = PTHREAD_MUTEX_INITIALIZER, };