From 8611bc17ca11c51440b975f79a36dc79d42a10ad Mon Sep 17 00:00:00 2001 From: Naresh Gottumukkala Date: Wed, 9 Dec 2020 10:26:31 +0000 Subject: [PATCH] nvmf/fc: Fix unfair LS queue pending processing. If ls_pending_queue is not empty, then add the ls_rqst to ls_pending_queue instead of trying to get xri. Signed-off-by: Naresh Gottumukkala Change-Id: I97e48f30cb6d4fd69548d48e6360275d9f1adec0 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5502 Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Aleksey Marchuk Reviewed-by: Shuhei Matsumoto Reviewed-by: Anil Veerabhadrappa --- lib/nvmf/fc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/nvmf/fc.c b/lib/nvmf/fc.c index 21a4c91ca..f4f7e10d4 100644 --- a/lib/nvmf/fc.c +++ b/lib/nvmf/fc.c @@ -1516,7 +1516,12 @@ nvmf_fc_hwqp_process_frame(struct spdk_nvmf_fc_hwqp *hwqp, ls_rqst->rport = rport; ls_rqst->nvmf_tgt = g_nvmf_ftransport->transport.tgt; - ls_rqst->xchg = nvmf_fc_get_xri(hwqp); + if (TAILQ_EMPTY(&hwqp->ls_pending_queue)) { + ls_rqst->xchg = nvmf_fc_get_xri(hwqp); + } else { + ls_rqst->xchg = NULL; + } + if (ls_rqst->xchg) { /* Handover the request to LS module */ nvmf_fc_handle_ls_rqst(ls_rqst);