From 673859cd0d1a8bcef998d8b8d7005140f0acf83d Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Tue, 15 Feb 2022 20:55:27 +0800 Subject: [PATCH] nvmf/vfio-user: remove unnecessary controller SHN state check The CSTS.SHN is changed only in shutting down the controller, nvmf library already ensure that all the outstanding IOs will be flushed before that, so we can remove this check here. Change-Id: Ib93a256e986b7b2ec1da0fc7992feb3a02c1d657 Signed-off-by: Changpeng Liu Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11674 Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Thanos Makatos Reviewed-by: Jim Harris Reviewed-by: Ben Walker Reviewed-by: Dong Yi Reviewed-by: Aleksey Marchuk --- lib/nvmf/vfio_user.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/nvmf/vfio_user.c b/lib/nvmf/vfio_user.c index f8bb0d659..01c590526 100644 --- a/lib/nvmf/vfio_user.c +++ b/lib/nvmf/vfio_user.c @@ -1593,7 +1593,6 @@ post_completion(struct nvmf_vfio_user_ctrlr *ctrlr, struct nvmf_vfio_user_cq *cq uint32_t cdw0, uint16_t sqid, uint16_t cid, uint16_t sc, uint16_t sct) { struct spdk_nvme_status cpl_status = { 0 }; - const struct spdk_nvmf_registers *regs; struct spdk_nvme_cpl *cpl; int err; @@ -1603,14 +1602,6 @@ post_completion(struct nvmf_vfio_user_ctrlr *ctrlr, struct nvmf_vfio_user_cq *cq return 0; } - regs = spdk_nvmf_ctrlr_get_regs(ctrlr->ctrlr); - if (regs->csts.bits.shst != SPDK_NVME_SHST_NORMAL) { - SPDK_DEBUGLOG(nvmf_vfio, - "%s: ignore completion sqid:%d cid=%d status=%#x\n", - ctrlr_id(ctrlr), sqid, cid, sc); - return 0; - } - if (cq_is_full(cq)) { SPDK_ERRLOG("%s: cqid:%d full (tail=%d, head=%d)\n", ctrlr_id(ctrlr), cq->qid, *cq_tailp(cq),